Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Update copyright lines for 2022.
[simgrid.git] / src / smpi / bindings / smpi_pmpi_comm.cpp
index f54d7b4..ac85cf3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2021. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2022. 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. */
@@ -130,9 +130,8 @@ int PMPI_Comm_split(MPI_Comm comm, int color, int key, MPI_Comm* 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();
+  const SmpiBenchGuard suspend_bench;
   *comm_out = comm->split(color, key);
-  smpi_bench_begin();
   return MPI_SUCCESS;
 }
 
@@ -140,9 +139,8 @@ int PMPI_Comm_split_type(MPI_Comm comm, int split_type, int key, MPI_Info info,
 {
   CHECK_COMM(1)
   CHECK_NULL(5, MPI_ERR_ARG, newcomm)
-  smpi_bench_end();
+  const SmpiBenchGuard suspend_bench;
   *newcomm = comm->split_type(split_type, key, info);
-  smpi_bench_begin();
   return MPI_SUCCESS;
 }
 
@@ -151,9 +149,8 @@ int PMPI_Comm_create_group(MPI_Comm comm, MPI_Group group, int, MPI_Comm* comm_o
   CHECK_COMM(1)
   CHECK_GROUP(2, group)
   CHECK_NULL(5, MPI_ERR_ARG, comm_out)
-  smpi_bench_end();
+  const SmpiBenchGuard suspend_bench;
   int retval = MPI_Comm_create(comm, group, comm_out);
-  smpi_bench_begin();
   return retval;
 }
 
@@ -220,7 +217,7 @@ int PMPI_Comm_test_inter(MPI_Comm comm, int* flag){
 
 int PMPI_Attr_delete(MPI_Comm comm, int keyval) {
   CHECK_COMM(1)
-  CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
+  CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
   if(keyval == MPI_TAG_UB||keyval == MPI_HOST||keyval == MPI_IO ||keyval == MPI_WTIME_IS_GLOBAL||keyval == MPI_APPNUM
        ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE)
     return MPI_ERR_ARG;
@@ -238,7 +235,7 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
   CHECK_NULL(4, MPI_ERR_ARG, flag)
   *flag = 0;
   CHECK_COMM(1)
-  CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
+  CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
 
   switch (keyval) {
   case MPI_HOST:
@@ -271,7 +268,7 @@ int PMPI_Attr_get(MPI_Comm comm, int keyval, void* attr_value, int* flag) {
 
 int PMPI_Attr_put(MPI_Comm comm, int keyval, void* attr_value) {
   CHECK_COMM(1)
-  CHECK_MPI_NULL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
+  CHECK_VAL(2, MPI_KEYVAL_INVALID, MPI_ERR_KEYVAL, keyval)
   if(keyval == MPI_TAG_UB||keyval == MPI_HOST||keyval == MPI_IO ||keyval == MPI_WTIME_IS_GLOBAL||keyval == MPI_APPNUM
        ||keyval == MPI_UNIVERSE_SIZE||keyval == MPI_LASTUSEDCODE)
     return MPI_ERR_ARG;