Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix lua platform script
[simgrid.git] / src / smpi / smpi_base.c
index 594e4b7..2c99064 100644 (file)
@@ -11,6 +11,7 @@
 #include <errno.h>
 #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);