Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
some sorting in the [smpi/xbt]_replay stuff
[simgrid.git] / src / smpi / smpi_replay.c
index 59c1601..9ccdce0 100644 (file)
@@ -37,7 +37,9 @@ static void log_timed_action (const char *const *action, double clock){
 static xbt_dynar_t get_reqq_self(){
    char * key;
    
-   asprintf(&key, "%d", smpi_process_index());
+   int size = asprintf(&key, "%d", smpi_process_index());
+   if(size==-1)
+     xbt_die("could not allocate memory for asprintf");
    xbt_dynar_t dynar_mpi_request = (xbt_dynar_t) xbt_dict_get(reqq, key);
    free(key);
  
@@ -47,7 +49,9 @@ static xbt_dynar_t get_reqq_self(){
 static void set_reqq_self(xbt_dynar_t mpi_request){
    char * key;
    
-   asprintf(&key, "%d", smpi_process_index());
+   int size = asprintf(&key, "%d", smpi_process_index());
+   if(size==-1)
+     xbt_die("could not allocate memory for asprintf");
    xbt_dict_set(reqq, key, mpi_request, free);
    free(key);
 }
@@ -1082,7 +1086,7 @@ void smpi_replay_init(int *argc, char***argv){
     XBT_VERB("Delayed start for instance - Sleeping for %f flops ",value );
     smpi_execute_flops(value);
   } else {
-    //UGLY done to force context switch to be sure that all MSG_processes begin initialization
+    //UGLY: force a context switch to be sure that all MSG_processes begin initialization
     XBT_DEBUG("Force context switch by smpi_execute_flops  - Sleeping for 0.0 flops ");
     smpi_execute_flops(0.0);
   }