X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/64a11402f73a49312abcc8cb324a3c662dce926e..fc6f9c6d91e16fedad411f4e0c403d2174af735a:/src/smpi/internals/smpi_replay.cpp diff --git a/src/smpi/internals/smpi_replay.cpp b/src/smpi/internals/smpi_replay.cpp index cab8ee5773..676685c42a 100644 --- a/src/smpi/internals/smpi_replay.cpp +++ b/src/smpi/internals/smpi_replay.cpp @@ -27,10 +27,16 @@ static std::unordered_map*> reqq; static MPI_Datatype MPI_DEFAULT_TYPE; -static int sendbuffer_size = 0; -static char* sendbuffer = nullptr; -static int recvbuffer_size = 0; -static char* recvbuffer = nullptr; +#define CHECK_ACTION_PARAMS(action, mandatory, optional) {\ + int i=0;\ + while(action[i]!=nullptr)\ + i++;\ + if(i *mpi_request) reqq.insert({Actor::self()->getPid(), mpi_request}); } -//allocate a single buffer for all sends, growing it if needed -void* smpi_get_tmp_sendbuffer(int size) -{ - if (not smpi_process()->replaying()) - return xbt_malloc(size); - if (sendbuffer_size(xbt_realloc(sendbuffer,size)); - sendbuffer_size=size; - } - return sendbuffer; -} - -//allocate a single buffer for all recv -void* smpi_get_tmp_recvbuffer(int size){ - if (not smpi_process()->replaying()) - return xbt_malloc(size); - if (recvbuffer_size(xbt_realloc(recvbuffer,size)); - recvbuffer_size=size; - } - return recvbuffer; -} - -void smpi_free_tmp_buffer(void* buf){ - if (not smpi_process()->replaying()) - xbt_free(buf); -} - /* Helper function */ static double parse_double(const char *string) { @@ -107,17 +85,6 @@ const char* encode_datatype(MPI_Datatype datatype) return datatype->encode(); } -#define CHECK_ACTION_PARAMS(action, mandatory, optional) {\ - int i=0;\ - while(action[i]!=nullptr)\ - i++;\ - if(isimulated_elapsed()); - xbt_free(sendbuffer); - xbt_free(recvbuffer); + smpi_free_replay_tmp_buffers(); } TRACE_smpi_comm_in(Actor::self()->getPid(), "smpi_replay_run_finalize", new simgrid::instr::NoOpTIData("finalize"));