Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
attempt to fix en issue when timing functions are called before initialization
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index 85dd53a..0057999 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2020. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2021. 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. */
@@ -127,6 +127,8 @@ int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* comm_out)
 {
   CHECK_NULL(4, MPI_ERR_ARG, comm_out)
   CHECK_COMM2(1, comm)
+  if( color != MPI_UNDEFINED)//we use a negative value for MPI_UNDEFINED 
+    CHECK_NEGATIVE(3, MPI_ERR_ARG, color)
   smpi_bench_end();
   *comm_out = comm->split(color, key);
   smpi_bench_begin();
@@ -157,7 +159,7 @@ int PMPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int, MPI_Comm* comm_o
 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){
@@ -273,6 +275,7 @@ int PMPI_Errhandler_free(MPI_Errhandler* errhandler){
 int PMPI_Errhandler_create(MPI_Handler_function* function, MPI_Errhandler* errhandler){
   CHECK_NULL(2, MPI_ERR_ARG, errhandler)
   *errhandler=new simgrid::smpi::Errhandler(function);
+  (*errhandler)->add_f();
   return MPI_SUCCESS;
 }