-/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
MPI_Comm PMPI_Comm_f2c(MPI_Fint comm){
if(comm==-1)
return MPI_COMM_NULL;
- return static_cast<MPI_Comm>(simgrid::smpi::Comm::f2c(comm));
+ return simgrid::smpi::Comm::f2c(comm);
}
MPI_Fint PMPI_Comm_c2f(MPI_Comm comm){
||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE)
return MPI_ERR_ARG;
else
- return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
+ return comm->attr_put<simgrid::smpi::Comm>(keyval, attr_value);
}
int PMPI_Errhandler_free(MPI_Errhandler* errhandler){
int PMPI_Comm_call_errhandler(MPI_Comm comm,int errorcode){
CHECK_COMM(1)
- comm->errhandler()->call(comm, errorcode);
+ MPI_Errhandler err = comm->errhandler();
+ err->call(comm, errorcode);
+ simgrid::smpi::Errhandler::unref(err);
return MPI_SUCCESS;
}