X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b531f578ec2baa41a140c677217934de645723f8..bf9897b3f75fba374088221ba582819e2aa503e0:/src/smpi/smpi_replay.c diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index 11f9d1846b..9b5ff76cc8 100644 --- a/src/smpi/smpi_replay.c +++ b/src/smpi/smpi_replay.c @@ -18,6 +18,11 @@ xbt_dynar_t *reqq = NULL; MPI_Datatype MPI_DEFAULT_TYPE; MPI_Datatype MPI_CURRENT_TYPE; +static int sendbuffer_size=0; +char* sendbuffer=NULL; +static int recvbuffer_size=0; +char* recvbuffer=NULL; + static void log_timed_action (const char *const *action, double clock){ if (XBT_LOG_ISENABLED(smpi_replay, xbt_log_priority_verbose)){ char *name = xbt_str_join_array(action, " "); @@ -26,6 +31,32 @@ static void log_timed_action (const char *const *action, double clock){ } } +//allocate a single buffer for all sends, growing it if needed +void* smpi_get_tmp_sendbuffer(int size){ + if (!_xbt_replay_is_active()) + return xbt_malloc(size); + if (sendbuffer_size2){ + char *endptr; + double value = strtod((*argv)[2], &endptr); + if (*endptr != '\0') + THROWF(unknown_error, 0, "%s is not a double", (*argv)[2]); + XBT_VERB("Delayed start for instance - Sleeping for %f flops ",value ); + smpi_execute_flops(value); + } xbt_replay_action_runner(*argc, *argv); } @@ -1031,6 +1063,8 @@ int smpi_replay_finalize(){ sim_time = smpi_process_simulated_elapsed(); XBT_INFO("Simulation time %f", sim_time); _xbt_replay_action_exit(); + xbt_free(sendbuffer); + xbt_free(recvbuffer); xbt_free(reqq); reqq = NULL; }