X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/78f60c03e259edfbb61fd09ecc94962186517541..79bcf7d543aa95b4425f4a6791241978cd5233c7:/src/smpi/smpi_mpi_dt.c diff --git a/src/smpi/smpi_mpi_dt.c b/src/smpi/smpi_mpi_dt.c index 852b4d4a9c..29843af1a1 100644 --- a/src/smpi/smpi_mpi_dt.c +++ b/src/smpi/smpi_mpi_dt.c @@ -182,12 +182,20 @@ MPI_Datatype smpi_datatype_dup(MPI_Datatype datatype) int smpi_datatype_extent(MPI_Datatype datatype, MPI_Aint * lb, MPI_Aint * extent) { + if(datatype == MPI_DATATYPE_NULL){ + *lb=0; + *extent=0; + return MPI_SUCCESS; + } *lb = datatype->lb; *extent = datatype->ub - datatype->lb; return MPI_SUCCESS; } MPI_Aint smpi_datatype_get_extent(MPI_Datatype datatype){ + if(datatype == MPI_DATATYPE_NULL){ + return 0; + } return datatype->ub - datatype->lb; } @@ -205,7 +213,7 @@ int smpi_datatype_copy(void *sendbuf, int sendcount, MPI_Datatype sendtype, { int count; if(smpi_privatize_global_variables){ - switch_data_segment(smpi_process_index()); + smpi_switch_data_segment(smpi_process_index()); } /* First check if we really have something to do */ if (recvcount > 0 && recvbuf != sendbuf) { @@ -1608,8 +1616,8 @@ 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()); + XBT_DEBUG("Applying operation, switch to the right data frame "); + smpi_switch_data_segment(smpi_process_index()); } if(!_xbt_replay_is_active())