From: Augustin Degomme Date: Fri, 26 Sep 2014 13:57:53 +0000 (+0200) Subject: for replay and collectives, only allocate buffers once (grow it if needed). X-Git-Tag: v3_12~792 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/36456b564568b97dd43f8f0acee3306b85da2078 for replay and collectives, only allocate buffers once (grow it if needed). As we don't have shared malloc on all platforms, this should be more ci-friendly --- diff --git a/src/smpi/smpi_replay.c b/src/smpi/smpi_replay.c index bf7fc596db..b95afb3844 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,23 @@ static void log_timed_action (const char *const *action, double clock){ } } +//allocate a single buffer for all sends, growing it if needed +static void* get_sendbuffer(int size){ + if (sendbuffer_size