Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add private (optional) data copy function callback to _send _isend _recv _irecv simcalls
[simgrid.git] / src / smpi / smpi_base.c
index 6295038..4b5fe09 100644 (file)
@@ -335,7 +335,7 @@ void smpi_mpi_start(MPI_Request request)
     smpi_datatype_use(request->old_type);
     smpi_comm_use(request->comm);
     request->action = simcall_comm_irecv(mailbox, request->buf,
-                                         &request->real_size, &match_recv,
+                                         &request->real_size, &match_recv, &smpi_comm_copy_buffer_callback,
                                          request, -1.0);
 
     //integrate pseudo-timing for buffering of small messages, do not bother to execute the simcall if 0
@@ -377,14 +377,11 @@ void smpi_mpi_start(MPI_Request request)
         oldbuf = request->buf;
         if (!_xbt_replay_is_active() && oldbuf && request->size!=0){
           if((smpi_privatize_global_variables)
-           && ((char*)request->buf >= start_data_exe)
-           && ((char*)request->buf < start_data_exe + size_data_exe )
-       ){
-                 XBT_WARN("Privatization : We are sending from a zone inside global memory. Switch data segment ");
-                 switch_data_segment(smpi_process_index());
-       }
-
-
+             && ((char*)request->buf >= start_data_exe)
+             && ((char*)request->buf < start_data_exe + size_data_exe )){
+            XBT_DEBUG("Privatization : We are sending from a zone inside global memory. Switch data segment ");
+                   switch_data_segment(smpi_process_index());
+         }
           buf = xbt_malloc(request->size);
           memcpy(buf,oldbuf,request->size);
         }
@@ -414,6 +411,7 @@ void smpi_mpi_start(MPI_Request request)
                          buf, request->real_size,
                          &match_send,
                          &xbt_free, // how to free the userdata if a detached send fails
+                         &smpi_comm_copy_buffer_callback,
                          request,
                          // detach if msg size < eager/rdv switch limit
                          request->detached);