Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change xbt_cfg_get_int -> simgrid::config::get_config<int>.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 10:57:35 +0000 (12:57 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 19 Apr 2018 14:06:43 +0000 (16:06 +0200)
src/instr/instr_config.cpp
src/smpi/internals/smpi_global.cpp
src/smpi/mpi/smpi_request.cpp
src/xbt/config.cpp

index e896000..37a1015 100644 (file)
@@ -251,7 +251,7 @@ std::string TRACE_get_comment_file()
 
 int TRACE_precision ()
 {
 
 int TRACE_precision ()
 {
-  return xbt_cfg_get_int(OPT_TRACING_PRECISION);
+  return simgrid::config::get_config<int>(OPT_TRACING_PRECISION);
 }
 
 std::string TRACE_get_filename()
 }
 
 std::string TRACE_get_filename()
index 5ff6ac3..f2a5b48 100644 (file)
@@ -214,21 +214,23 @@ void smpi_comm_null_copy_buffer_callback(smx_activity_t comm, void *buff, size_t
   /* nothing done in this version */
 }
 
   /* nothing done in this version */
 }
 
-static void smpi_check_options(){
+static void smpi_check_options()
+{
   //check correctness of MPI parameters
 
   //check correctness of MPI parameters
 
-   xbt_assert(xbt_cfg_get_int("smpi/async-small-thresh") <= xbt_cfg_get_int("smpi/send-is-detached-thresh"));
+  xbt_assert(simgrid::config::get_config<int>("smpi/async-small-thresh") <=
+             simgrid::config::get_config<int>("smpi/send-is-detached-thresh"));
 
 
-   if (xbt_cfg_is_default_value("smpi/host-speed")) {
-     XBT_INFO("You did not set the power of the host running the simulation.  "
-              "The timings will certainly not be accurate.  "
-              "Use the option \"--cfg=smpi/host-speed:<flops>\" to set its value."
-              "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information.");
-   }
+  if (xbt_cfg_is_default_value("smpi/host-speed")) {
+    XBT_INFO("You did not set the power of the host running the simulation.  "
+             "The timings will certainly not be accurate.  "
+             "Use the option \"--cfg=smpi/host-speed:<flops>\" to set its value."
+             "Check http://simgrid.org/simgrid/latest/doc/options.html#options_smpi_bench for more information.");
+  }
 
 
-   xbt_assert(xbt_cfg_get_double("smpi/cpu-threshold") >=0,
-       "The 'smpi/cpu-threshold' option cannot have negative values [anymore]. If you want to discard "
-       "the simulation of any computation, please use 'smpi/simulate-computation:no' instead.");
+  xbt_assert(xbt_cfg_get_double("smpi/cpu-threshold") >= 0,
+             "The 'smpi/cpu-threshold' option cannot have negative values [anymore]. If you want to discard "
+             "the simulation of any computation, please use 'smpi/simulate-computation:no' instead.");
 }
 
 int smpi_enabled() {
 }
 
 int smpi_enabled() {
index ca851d7..3b4f02d 100644 (file)
@@ -358,7 +358,7 @@ void Request::start()
 
     simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
 
 
     simgrid::smpi::Process* process = smpi_process_remote(simgrid::s4u::Actor::by_pid(dst_));
 
-    int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh");
+    int async_small_thresh = simgrid::config::get_config<int>("smpi/async-small-thresh");
 
     xbt_mutex_t mut = process->mailboxes_mutex();
     if (async_small_thresh != 0 || (flags_ & RMA) != 0)
 
     xbt_mutex_t mut = process->mailboxes_mutex();
     if (async_small_thresh != 0 || (flags_ & RMA) != 0)
@@ -416,8 +416,9 @@ void Request::start()
     this->print_request("New send");
 
     void* buf = buf_;
     this->print_request("New send");
 
     void* buf = buf_;
-    if ((flags_ & SSEND) == 0 && ( (flags_ & RMA) != 0
-        || static_cast<int>(size_) < xbt_cfg_get_int("smpi/send-is-detached-thresh") ) ) {
+    if ((flags_ & SSEND) == 0 &&
+        ((flags_ & RMA) != 0 ||
+         static_cast<int>(size_) < simgrid::config::get_config<int>("smpi/send-is-detached-thresh"))) {
       void *oldbuf = nullptr;
       detached_ = 1;
       XBT_DEBUG("Send request %p is detached", this);
       void *oldbuf = nullptr;
       detached_ = 1;
       XBT_DEBUG("Send request %p is detached", this);
@@ -452,7 +453,7 @@ void Request::start()
       XBT_DEBUG("sending size of %zu : sleep %f ", size_, sleeptime);
     }
 
       XBT_DEBUG("sending size of %zu : sleep %f ", size_, sleeptime);
     }
 
-    int async_small_thresh = xbt_cfg_get_int("smpi/async-small-thresh");
+    int async_small_thresh = simgrid::config::get_config<int>("smpi/async-small-thresh");
 
     xbt_mutex_t mut=process->mailboxes_mutex();
 
 
     xbt_mutex_t mut=process->mailboxes_mutex();
 
@@ -682,10 +683,10 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
 
   request->print_request("New iprobe");
   // We have to test both mailboxes as we don't know if we will receive one one or another
 
   request->print_request("New iprobe");
   // We have to test both mailboxes as we don't know if we will receive one one or another
-  if (xbt_cfg_get_int("smpi/async-small-thresh") > 0){
-      mailbox = smpi_process()->mailbox_small();
-      XBT_DEBUG("Trying to probe the perm recv mailbox");
-      request->action_ = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast<void*>(request));
+  if (simgrid::config::get_config<int>("smpi/async-small-thresh") > 0) {
+    mailbox = smpi_process()->mailbox_small();
+    XBT_DEBUG("Trying to probe the perm recv mailbox");
+    request->action_ = simcall_comm_iprobe(mailbox, 0, &match_recv, static_cast<void*>(request));
   }
 
   if (request->action_ == nullptr){
   }
 
   if (request->action_ == nullptr){
index 8e7084e..84c6b7b 100644 (file)
@@ -707,7 +707,7 @@ XBT_TEST_UNIT("use", test_config_use, "Data retrieving tests")
   {
     /* get_single_value */
     xbt_cfg_set_parse("peername:toto:42 speed:42");
   {
     /* get_single_value */
     xbt_cfg_set_parse("peername:toto:42 speed:42");
-    int ival = xbt_cfg_get_int("speed");
+    int ival = simgrid::config::get_config<int>("speed");
     if (ival != 42)
       xbt_test_fail("Speed value = %d, I expected 42", ival);
   }
     if (ival != 42)
       xbt_test_fail("Speed value = %d, I expected 42", ival);
   }