Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sanitize the OOP of kernel::profile
[simgrid.git] / src / smpi / mpi / smpi_request.cpp
index ebd900a..dc751be 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2018. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2019. 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. */
@@ -134,7 +134,7 @@ void Request::unref(MPI_Request* request)
   }
 }
 
-int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored)
+int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
   MPI_Request ref = static_cast<MPI_Request>(a);
   MPI_Request req = static_cast<MPI_Request>(b);
@@ -160,7 +160,7 @@ int Request::match_recv(void* a, void* b, simgrid::kernel::activity::CommImpl* i
   }else return 0;
 }
 
-int Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl* ignored)
+int Request::match_send(void* a, void* b, simgrid::kernel::activity::CommImpl*)
 {
   MPI_Request ref = static_cast<MPI_Request>(a);
   MPI_Request req = static_cast<MPI_Request>(b);
@@ -687,7 +687,9 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
                                     source == MPI_ANY_SOURCE ? MPI_ANY_SOURCE : comm->group()->actor(source)->get_pid(),
                                     simgrid::s4u::this_actor::get_pid(), tag, comm, MPI_REQ_PERSISTENT | MPI_REQ_RECV);
   if (smpi_iprobe_sleep > 0) {
-    s4u::this_actor::exec_init(/* flops to execute */ nsleeps * smpi_iprobe_sleep * speed * maxrate)
+    /** Compute the number of flops we will sleep **/
+    s4u::this_actor::exec_init(/*nsleeps: See comment above */ nsleeps *
+                               /*(in seconds)*/ smpi_iprobe_sleep * speed * maxrate)
         ->set_name("iprobe")
         ->start()
         ->wait();
@@ -710,9 +712,8 @@ void Request::iprobe(int source, int tag, MPI_Comm comm, int* flag, MPI_Status*
   }
 
   if (request->action_ != nullptr){
-    simgrid::kernel::activity::CommImplPtr sync_comm =
-        boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(request->action_);
-    MPI_Request req                            = static_cast<MPI_Request>(sync_comm->src_data);
+    kernel::activity::CommImplPtr sync_comm = boost::static_pointer_cast<kernel::activity::CommImpl>(request->action_);
+    MPI_Request req                         = static_cast<MPI_Request>(sync_comm->src_data_);
     *flag = 1;
     if (status != MPI_STATUS_IGNORE && (req->flags_ & MPI_REQ_PREPARED) == 0) {
       status->MPI_SOURCE = comm->group()->rank(req->src_);