Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
say goodbye to smpi_base.cpp .. It was made quite empty recently.
authordegomme <augustin.degomme@unibas.ch>
Sun, 19 Mar 2017 00:09:00 +0000 (01:09 +0100)
committerdegomme <augustin.degomme@unibas.ch>
Sun, 19 Mar 2017 00:09:00 +0000 (01:09 +0100)
All global handling routines of smpi should be in smpi_global.cpp (and smpi_bench.cpp), now.

src/smpi/smpi_base.cpp [deleted file]
src/smpi/smpi_global.cpp
tools/cmake/DefinePackages.cmake

diff --git a/src/smpi/smpi_base.cpp b/src/smpi/smpi_base.cpp
deleted file mode 100644 (file)
index c3fd0e8..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (c) 2007-2017. 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. */
-
-#include <xbt/config.hpp>
-#include <algorithm>
-
-#include "private.h"
-#include "xbt/virtu.h"
-#include "mc/mc.h"
-#include "src/mc/mc_replay.h"
-#include <errno.h>
-#include "src/simix/smx_private.h"
-#include "surf/surf.h"
-#include "simgrid/sg_config.h"
-#include "smpi/smpi_utils.hpp"
-#include <simgrid/s4u/host.hpp>
-
-#include "src/kernel/activity/SynchroComm.hpp"
-
-XBT_LOG_NEW_DEFAULT_SUBCATEGORY(smpi_base, smpi, "Logging specific to SMPI (base)");
-
-static simgrid::config::Flag<double> smpi_wtime_sleep(
-  "smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
-static simgrid::config::Flag<double> smpi_init_sleep(
-  "smpi/init", "Time to inject inside a call to MPI_Init", 0.0);
-
-void smpi_mpi_init() {
-  if(smpi_init_sleep > 0) 
-    simcall_process_sleep(smpi_init_sleep);
-}
-
-double smpi_mpi_wtime(){
-  double time;
-  if (smpi_process()->initialized() != 0 && smpi_process()->finalized() == 0 && smpi_process()->sampling() == 0) {
-    smpi_bench_end();
-    time = SIMIX_get_clock();
-    // to avoid deadlocks if used as a break condition, such as
-    //     while (MPI_Wtime(...) < time_limit) {
-    //       ....
-    //     }
-    // because the time will not normally advance when only calls to MPI_Wtime
-    // are made -> deadlock (MPI_Wtime never reaches the time limit)
-    if(smpi_wtime_sleep > 0) 
-      simcall_process_sleep(smpi_wtime_sleep);
-    smpi_bench_begin();
-  } else {
-    time = SIMIX_get_clock();
-  }
-  return time;
-}
-
-void smpi_empty_status(MPI_Status * status)
-{
-  if(status != MPI_STATUS_IGNORE) {
-    status->MPI_SOURCE = MPI_ANY_SOURCE;
-    status->MPI_TAG = MPI_ANY_TAG;
-    status->MPI_ERROR = MPI_SUCCESS;
-    status->count=0;
-  }
-}
-
-int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype)
-{
-  return status->count / datatype->size();
-}
index a46a068..d5de927 100644 (file)
@@ -15,6 +15,7 @@
 #include "src/simix/smx_private.h"
 #include "surf/surf.h"
 #include "xbt/replay.hpp"
+#include <xbt/config.hpp>
 
 #include <float.h> /* DBL_MAX */
 #include <fstream>
@@ -51,6 +52,10 @@ MPI_Comm MPI_COMM_WORLD = MPI_COMM_UNINITIALIZED;
 MPI_Errhandler *MPI_ERRORS_RETURN = nullptr;
 MPI_Errhandler *MPI_ERRORS_ARE_FATAL = nullptr;
 MPI_Errhandler *MPI_ERRHANDLER_NULL = nullptr;
+static simgrid::config::Flag<double> smpi_wtime_sleep(
+  "smpi/wtime", "Minimum time to inject inside a call to MPI_Wtime", 0.0);
+static simgrid::config::Flag<double> smpi_init_sleep(
+  "smpi/init", "Time to inject inside a call to MPI_Init", 0.0);
 
 void (*smpi_comm_copy_data_callback) (smx_activity_t, void*, size_t) = &smpi_comm_copy_buffer_callback;
 
@@ -370,7 +375,6 @@ static void smpi_init_logs(){
   XBT_LOG_CONNECT(smpi);  /* Keep this line as soon as possible in this function: xbt_log_appender_file.c depends on it
                              DO NOT connect this in XBT or so, or it will be useless to xbt_log_appender_file.c */
   XBT_LOG_CONNECT(instr_smpi);
-  XBT_LOG_CONNECT(smpi_base);
   XBT_LOG_CONNECT(smpi_bench);
   XBT_LOG_CONNECT(smpi_coll);
   XBT_LOG_CONNECT(smpi_colls);
@@ -502,3 +506,43 @@ void SMPI_init(){
 void SMPI_finalize(){
   smpi_global_destroy();
 }
+
+void smpi_mpi_init() {
+  if(smpi_init_sleep > 0) 
+    simcall_process_sleep(smpi_init_sleep);
+}
+
+double smpi_mpi_wtime(){
+  double time;
+  if (smpi_process()->initialized() != 0 && smpi_process()->finalized() == 0 && smpi_process()->sampling() == 0) {
+    smpi_bench_end();
+    time = SIMIX_get_clock();
+    // to avoid deadlocks if used as a break condition, such as
+    //     while (MPI_Wtime(...) < time_limit) {
+    //       ....
+    //     }
+    // because the time will not normally advance when only calls to MPI_Wtime
+    // are made -> deadlock (MPI_Wtime never reaches the time limit)
+    if(smpi_wtime_sleep > 0) 
+      simcall_process_sleep(smpi_wtime_sleep);
+    smpi_bench_begin();
+  } else {
+    time = SIMIX_get_clock();
+  }
+  return time;
+}
+
+void smpi_empty_status(MPI_Status * status)
+{
+  if(status != MPI_STATUS_IGNORE) {
+    status->MPI_SOURCE = MPI_ANY_SOURCE;
+    status->MPI_TAG = MPI_ANY_TAG;
+    status->MPI_ERROR = MPI_SUCCESS;
+    status->count=0;
+  }
+}
+
+int smpi_mpi_get_count(MPI_Status * status, MPI_Datatype datatype)
+{
+  return status->count / datatype->size();
+}
index 06b423c..59e496d 100644 (file)
@@ -205,7 +205,6 @@ set(SMPI_SRC
   src/smpi/colls/smpi_openmpi_selector.cpp
   src/smpi/colls/smpi_mvapich2_selector.cpp
   src/smpi/instr_smpi.cpp
-  src/smpi/smpi_base.cpp
   src/smpi/smpi_bench.cpp
   src/smpi/smpi_memory.cpp
   src/smpi/smpi_static_variables.cpp