X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/7da57caf7dc9f4515aa6eb8275dfcb054de51df7..061f1e9720921cc227dab4f6ddeca9d30028e5d4:/src/smpi/mpi/smpi_op.cpp diff --git a/src/smpi/mpi/smpi_op.cpp b/src/smpi/mpi/smpi_op.cpp index e81b93ff0a..bb52d0e4ec 100644 --- a/src/smpi/mpi/smpi_op.cpp +++ b/src/smpi/mpi/smpi_op.cpp @@ -242,5 +242,17 @@ Op* Op::f2c(int id){ return static_cast(F2C::f2c(id)); } +void Op::ref(){ + refcount_++; +} + +void Op::unref(MPI_Op* op){ + if((*op)!=MPI_OP_NULL){ + (*op)->refcount_--; + if((*op)->refcount_==0) + delete(*op); + } +} + } }