Skip to content

Commit

Permalink
Merge pull request #2460 from eisenhauer/Mismatch
Browse files Browse the repository at this point in the history
Detect and warn of SST version mismatch
  • Loading branch information
eisenhauer authored Sep 12, 2020
2 parents c789adb + 27e7010 commit b046337
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
13 changes: 13 additions & 0 deletions source/adios2/toolkit/sst/cp/cp_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1318,6 +1318,18 @@ extern char *CP_GetContactString(SstStream Stream, attr_list DPAttrs)
return ret;
}

static void CP_versionError(CMConnection conn, char *formatName)
{
fprintf(stderr,
" * An invalid message of type \"%s\" has been received on an "
"incoming connection.\n",
formatName);
fprintf(stderr, " * In ADIOS2/SST this likely means a version mismatch "
"between stream participants.\n");
fprintf(stderr, " * Please ensure that all writers and readers are built "
"with the same version of ADIOS2.\n");
}

extern CP_Info CP_getCPInfo(CP_DP_Interface DPInfo, char *ControlModule)
{
CP_Info StreamCP;
Expand Down Expand Up @@ -1346,6 +1358,7 @@ extern CP_Info CP_getCPInfo(CP_DP_Interface DPInfo, char *ControlModule)
}

CMlisten(SharedCMInfo->cm);
CMregister_invalid_message_handler(SharedCMInfo->cm, CP_versionError);

if (!CP_SstParamsList)
{
Expand Down
12 changes: 11 additions & 1 deletion thirdparty/EVPath/EVPath/cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,11 @@ timeout_conn(CManager cm, void *client_data)
local_format = FFS_target_from_encode(conn->cm->FFScontext, data_buffer);
original_format = FFSTypeHandle_from_encode(conn->cm->FFScontext, data_buffer);
if (local_format == NULL) {
fprintf(stderr, "invalid format in incoming buffer\n");
if (conn->cm->unregistered_format_handler) {
conn->cm->unregistered_format_handler(conn, name_of_FMformat(FMFormat_of_original(original_format)));
} else {
fprintf(stderr, "No conversion found for incoming CM message\n");
}
return 0;
}
CMtrace_out(cm, CMDataVerbose, "CM - Receiving record of type %s, FFSformat %p\n",
Expand Down Expand Up @@ -2716,6 +2720,12 @@ timeout_conn(CManager cm, void *client_data)
}
}

extern void
INT_CMregister_invalid_message_handler(CManager cm, CMUnregCMHandler handler)
{
cm->unregistered_format_handler = handler;
}

extern int
INT_CMwrite(CMConnection conn, CMFormat format, void *data)
{
Expand Down
4 changes: 4 additions & 0 deletions thirdparty/EVPath/EVPath/cm_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ typedef struct _CManager {

func_entry *shutdown_functions;
CMperf_upcall perf_upcall;
CMUnregCMHandler unregistered_format_handler;

struct _event_path_data *evp;
FILE * CMTrace_file;
Expand Down Expand Up @@ -566,3 +567,6 @@ extern void wait_for_pending_write(CMConnection conn);
extern int
INT_CMinstall_pull_schedule(CManager cm, struct timeval *base_time,
struct timeval *period, CMavail_period_ptr avail);
extern void
INT_CMregister_invalid_message_handler(CManager cm, CMUnregCMHandler handler);

10 changes: 10 additions & 0 deletions thirdparty/EVPath/EVPath/evpath.h
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,16 @@ typedef int (*CMNonCMHandler) (CMConnection conn, CMTransport transport,
extern void
CMregister_non_CM_message_handler (int header, CMNonCMHandler handler);

/*!
* register a handler for CM messages that don't match registered handlers.
*
*/
typedef void (*CMUnregCMHandler) (CMConnection conn, char *format_name);

/*NOLOCK*/
extern void
CMregister_invalid_message_handler (CManager cm, CMUnregCMHandler handler);

/*!
* return the pointer to the static transport services structure.
*
Expand Down

0 comments on commit b046337

Please sign in to comment.