X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..21fe278c8460849931b37ccde22e944edec46f71:/src/smpi/bindings/smpi_pmpi_op.cpp diff --git a/src/smpi/bindings/smpi_pmpi_op.cpp b/src/smpi/bindings/smpi_pmpi_op.cpp index 6b3bd32268..b52c51804d 100644 --- a/src/smpi/bindings/smpi_pmpi_op.cpp +++ b/src/smpi/bindings/smpi_pmpi_op.cpp @@ -27,7 +27,7 @@ int PMPI_Op_free(MPI_Op * op) } else if (*op == MPI_OP_NULL) { return MPI_ERR_OP; } else { - delete (*op); + simgrid::smpi::Op::unref(op); *op = MPI_OP_NULL; return MPI_SUCCESS; } @@ -45,9 +45,13 @@ int PMPI_Op_commutative(MPI_Op op, int* commute){ } MPI_Op PMPI_Op_f2c(MPI_Fint op){ + if(op==-1) + return MPI_OP_NULL; return static_cast(simgrid::smpi::Op::f2c(op)); } MPI_Fint PMPI_Op_c2f(MPI_Op op){ + if(op==MPI_OP_NULL) + return -1; return op->c2f(); }