A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a first draft for automatic privatization of global variables for smpi.
[simgrid.git]
/
src
/
smpi
/
smpi_mpi_dt.c
diff --git
a/src/smpi/smpi_mpi_dt.c
b/src/smpi/smpi_mpi_dt.c
index
8be8134
..
ee348b8
100644
(file)
--- a/
src/smpi/smpi_mpi_dt.c
+++ b/
src/smpi/smpi_mpi_dt.c
@@
-1489,6
+1489,11
@@
void smpi_op_destroy(MPI_Op op)
void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
MPI_Datatype * datatype)
{
void smpi_op_apply(MPI_Op op, void *invec, void *inoutvec, int *len,
MPI_Datatype * datatype)
{
+ if(smpi_privatize_global_variables){ //we need to switch here, as the called function may silently touch global variables
+ XBT_VERB("Applying operation, switch to the right data frame ");
+ switch_data_segment(smpi_process_index());
+ }
+
if(!_xbt_replay_is_active())
op->func(invec, inoutvec, len, datatype);
}
if(!_xbt_replay_is_active())
op->func(invec, inoutvec, len, datatype);
}