From: Arnaud Giersch Date: Mon, 19 Mar 2018 11:28:16 +0000 (+0100) Subject: Use src_proc/dst_proc to switch data segment. X-Git-Tag: v3.19~23 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6a30adb178a07c0e5287b374128eabd1a6756e99 Use src_proc/dst_proc to switch data segment. Error has been introduced with commit a1d0f5ae6be48d26770a264562100706e9a5e9ff. --- diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 769c00900d..b3e4714a63 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -192,8 +192,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && (static_cast(buff) >= smpi_data_exe_start) && (static_cast(buff) < smpi_data_exe_start + smpi_data_exe_size)) { XBT_DEBUG("Privatization : We are copying from a zone inside global memory... Saving data to temp buffer !"); - - smpi_switch_data_segment(Actor::self()->getPid()); + smpi_switch_data_segment(comm->src_proc->pid); tmpbuff = static_cast(xbt_malloc(buff_size)); memcpy_private(tmpbuff, buff, private_blocks); } @@ -201,7 +200,7 @@ void smpi_comm_copy_buffer_callback(smx_activity_t synchro, void *buff, size_t b if ((smpi_privatize_global_variables == SMPI_PRIVATIZE_MMAP) && ((char*)comm->dst_buff >= smpi_data_exe_start) && ((char*)comm->dst_buff < smpi_data_exe_start + smpi_data_exe_size)) { XBT_DEBUG("Privatization : We are copying to a zone inside global memory - Switch data segment"); - smpi_switch_data_segment(Actor::self()->getPid()); + smpi_switch_data_segment(comm->dst_proc->pid); } XBT_DEBUG("Copying %zu bytes from %p to %p", buff_size, tmpbuff,comm->dst_buff); memcpy_private(comm->dst_buff, tmpbuff, private_blocks);