Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
prefer this_actor:: to Actor::self()->
[simgrid.git] / src / smpi / bindings / smpi_pmpi.cpp
index 6e635fa..aa14f3b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2018. 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. */
@@ -25,7 +25,6 @@ void TRACE_smpi_set_category(const char *category)
 }
 
 /* PMPI User level calls */
-extern "C" { // Obviously, the C MPI interface should use the C linkage
 
 int PMPI_Init(int *argc, char ***argv)
 {
@@ -37,9 +36,9 @@ int PMPI_Init(int *argc, char ***argv)
   if(already_init == 0){
     simgrid::smpi::Process::init(argc, argv);
     smpi_process()->mark_as_initialized();
-    int rank = simgrid::s4u::Actor::self()->getPid();
+    int rank = simgrid::s4u::this_actor::getPid();
     TRACE_smpi_init(rank);
-    TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("init"));
+    TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("init"));
     TRACE_smpi_comm_out(rank);
     TRACE_smpi_computing_init(rank);
     smpi_bench_begin();
@@ -53,8 +52,8 @@ int PMPI_Init(int *argc, char ***argv)
 int PMPI_Finalize()
 {
   smpi_bench_end();
-  int rank = simgrid::s4u::Actor::self()->getPid();
-  TRACE_smpi_comm_in(rank, __FUNCTION__, new simgrid::instr::NoOpTIData("finalize"));
+  int rank = simgrid::s4u::this_actor::getPid();
+  TRACE_smpi_comm_in(rank, __func__, new simgrid::instr::NoOpTIData("finalize"));
 
   smpi_process()->finalize();
 
@@ -109,8 +108,9 @@ int PMPI_Is_thread_main(int *flag)
   if (flag == nullptr) {
     return MPI_ERR_ARG;
   } else {
-    *flag = simgrid::s4u::Actor::self()->getPid() == 1; // FIXME: I don't think this is correct: This just returns true if the process ID is 1,
-                                          // regardless of whether this process called MPI_Thread_Init() or not.
+    *flag = simgrid::s4u::this_actor::getPid() ==
+            1; // FIXME: I don't think this is correct: This just returns true if the process ID is 1,
+               // regardless of whether this process called MPI_Thread_Init() or not.
     return MPI_SUCCESS;
   }
 }
@@ -216,5 +216,3 @@ int PMPI_Keyval_create(MPI_Copy_function* copy_fn, MPI_Delete_function* delete_f
 int PMPI_Keyval_free(int* keyval) {
   return simgrid::smpi::Keyval::keyval_free<simgrid::smpi::Comm>(keyval);
 }
-
-} // extern "C"