X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b8d73e39d7ad879522cdb542e4ed69e2077a6f9e..fec5fff327fcad427d0a399ebc3dbbb35de2852e:/src/smpi/smpi_base.c diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 5362b82ff6..9ac0887107 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -260,8 +260,8 @@ void smpi_action_trace_run(char *path) action_fp=NULL; if (path) { action_fp = fopen(path, "r"); - xbt_assert(action_fp != NULL, "Cannot open %s: %s", path, - strerror(errno)); + if (action_fp == NULL) + xbt_die("Cannot open %s: %s", path, strerror(errno)); } if (!xbt_dict_is_empty(action_queues)) { @@ -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 @@ -376,6 +376,12 @@ void smpi_mpi_start(MPI_Request request) if(request->old_type->has_subtype == 0){ 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_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); } @@ -404,7 +410,8 @@ void smpi_mpi_start(MPI_Request request) simcall_comm_isend(mailbox, request->size, -1.0, buf, request->real_size, &match_send, - &xbt_free, // how to free the userdata if a detached send fails + &xbt_free_f, // 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); @@ -587,6 +594,15 @@ static void finish_wait(MPI_Request * request, MPI_Status * status) MPI_Datatype datatype = req->old_type; if(datatype->has_subtype == 1){ + if (!_xbt_replay_is_active()){ + if( smpi_privatize_global_variables + && ((char*)req->old_buf >= start_data_exe) + && ((char*)req->old_buf < start_data_exe + size_data_exe ) + ){ + XBT_VERB("Privatization : We are unserializing to a zone in global memory - Switch data segment "); + switch_data_segment(smpi_process_index()); + } + } // This part handles the problem of non-contignous memory // the unserialization at the reception s_smpi_subtype_t *subtype = datatype->substruct;