Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change xbt_cfg_get_int -> simgrid::config::get_config<int>.
[simgrid.git] / src / smpi / mpi / smpi_request.cpp
index 180d9fd..3b4f02d 100644 (file)
@@ -95,6 +95,10 @@ int Request::detached(){
   return detached_;
 }
 
+MPI_Datatype Request::type(){
+  return old_type_;
+}
+
 size_t Request::size(){
   return size_;
 }
@@ -354,7 +358,7 @@ void Request::start()
 
     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)
@@ -412,8 +416,9 @@ void Request::start()
     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);
@@ -448,7 +453,7 @@ void Request::start()
       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();
 
@@ -543,7 +548,7 @@ int Request::test(MPI_Request * request, MPI_Status * status) {
       nsleeps=1;//reset the number of sleeps we will do next time
       if (*request != MPI_REQUEST_NULL && ((*request)->flags_ & PERSISTENT) == 0)
         *request = MPI_REQUEST_NULL;
-    } else if (xbt_cfg_get_boolean("smpi/grow-injected-times")){
+    } else if (simgrid::config::get_config<bool>("smpi/grow-injected-times")) {
       nsleeps++;
     }
   }
@@ -678,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
-  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){
@@ -705,7 +710,7 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   }
   else {
     *flag = 0;
-    if (xbt_cfg_get_boolean("smpi/grow-injected-times"))
+    if (simgrid::config::get_config<bool>("smpi/grow-injected-times"))
       nsleeps++;
   }
   unref(&request);