X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7b5d97a0198ce4ecbe5654a7cfe978bd1880f936..d947ff7466b473eeec602007934f8336a9b17f3c:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 594e4b74ca..2c99064110 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -11,6 +11,7 @@ #include #include "simix/smx_private.h" #include "surf/surf.h" +#include "simgrid/sg_config.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)"); @@ -73,7 +74,7 @@ static MPI_Request build_request(void *buf, int count, if(datatype->has_subtype == 1){ // This part handles the problem of non-contiguous memory old_buf = buf; - buf = malloc(count*smpi_datatype_size(datatype)); + buf = xbt_malloc(count*smpi_datatype_size(datatype)); if (flags & SEND) { subtype->serialize(old_buf, buf, count, datatype->substruct); } @@ -182,7 +183,7 @@ void smpi_mpi_start(MPI_Request request) "Cannot (re)start a non-finished communication"); if(request->flags & RECV) { print_request("New recv", request); - if (request->size < surf_cfg_get_int("smpi/async_small_thres")) + if (request->size < sg_cfg_get_int("smpi/async_small_thres")) mailbox = smpi_process_mailbox_small(); else mailbox = smpi_process_mailbox(); @@ -198,7 +199,7 @@ void smpi_mpi_start(MPI_Request request) /* return;*/ /* }*/ print_request("New send", request); - if (request->size < surf_cfg_get_int("smpi/async_small_thres")) { // eager mode + if (request->size < sg_cfg_get_int("smpi/async_small_thres")) { // eager mode mailbox = smpi_process_remote_mailbox_small(receiver); }else{ XBT_DEBUG("Send request %p is not in the permanent receive mailbox (buf: %p)",request,request->buf); @@ -211,7 +212,7 @@ void smpi_mpi_start(MPI_Request request) if(request->old_type->has_subtype == 0){ oldbuf = request->buf; if (oldbuf){ - request->buf = malloc(request->size); + request->buf = xbt_malloc(request->size); memcpy(request->buf,oldbuf,request->size); } } @@ -494,7 +495,7 @@ void smpi_mpi_iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status* print_request("New iprobe", request); // We have to test both mailboxes as we don't know if we will receive one one or another - if (surf_cfg_get_int("smpi/async_small_thres")>0){ + if (sg_cfg_get_int("smpi/async_small_thres")>0){ mailbox = smpi_process_mailbox_small(); XBT_DEBUG("trying to probe the perm recv mailbox"); request->action = simcall_comm_iprobe(mailbox, request->src, request->tag, &match_recv, (void*)request);