-const char* encode_datatype(MPI_Datatype datatype)
-{
- if (datatype==MPI_BYTE)
- return "";
- if(datatype==MPI_DOUBLE)
- return "0";
- if(datatype==MPI_INT)
- return "1";
- if(datatype==MPI_CHAR)
- return "2";
- if(datatype==MPI_SHORT)
- return "3";
- if(datatype==MPI_LONG)
- return "4";
- if(datatype==MPI_FLOAT)
- return "5";
- // default - not implemented.
- // do not warn here as we pass in this function even for other trace formats
- return "-1";
-}
-
-#define CHECK_ACTION_PARAMS(action, mandatory, optional) {\
- int i=0;\
- while(action[i]!=nullptr)\
- i++;\
- if(i<mandatory+2) \
- THROWF(arg_error, 0, "%s replay failed.\n" \
- "%d items were given on the line. First two should be process_id and action. " \
- "This action needs after them %d mandatory arguments, and accepts %d optional ones. \n" \
- "Please contact the Simgrid team if support is needed", __FUNCTION__, i, mandatory, optional);\
- }
-