Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'task-docs' into 'master'
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 20 Nov 2023 13:45:13 +0000 (13:45 +0000)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Mon, 20 Nov 2023 13:45:13 +0000 (13:45 +0000)
fix missing doc for Tasks

See merge request simgrid/simgrid!180

examples/sthread/pthread-producer-consumer.c
include/smpi/smpi_extended_traces.h
include/smpi/smpi_extended_traces_fortran.h
src/plugins/battery.cpp
src/plugins/jbod.cpp
tools/cmake/MaintainerMode.cmake

index 52a0080..fe3fe5d 100644 (file)
@@ -45,9 +45,10 @@ static void* consumer(void* id)
   for (int i = 0; i < AmountConsumed; i++) {
     sem_wait(&full);
     pthread_mutex_lock(&mutex);
-    int item = buffer[out];
-    if (do_output)
+    if (do_output) {
+      int item = buffer[out];
       fprintf(stderr, "Consumer %d: Remove Item %d from %d\n", *((int*)id), item, out);
+    }
     out = (out + 1) % BufferSize;
     pthread_mutex_unlock(&mutex);
     sem_post(&empty);
index 1e1fefb..f0757ec 100644 (file)
 #define MPI_Rsend_init(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Rsend_init"), MPI_Rsend_init(__VA_ARGS__))
 #define MPI_Irsend(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Irsend"), MPI_Irsend(__VA_ARGS__))
 #define MPI_Sendrecv(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Sendrecv"), MPI_Sendrecv(__VA_ARGS__))
+#define MPI_Isendrecv(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Isendrecv"), MPI_Isendrecv(__VA_ARGS__))
 #define MPI_Sendrecv_replace(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Sendrecv_replace"), MPI_Sendrecv_replace(__VA_ARGS__))
+#define MPI_Isendrecv_replace(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Isendrecv_replace"), MPI_Isendrecv_replace(__VA_ARGS__))
 #define MPI_Test(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Test"), MPI_Test(__VA_ARGS__))
 #define MPI_Testany(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Testany"), MPI_Testany(__VA_ARGS__))
 #define MPI_Testall(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Testall"), MPI_Testall(__VA_ARGS__))
 #define MPI_Status_c2f(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Status_c2f"), MPI_Status_c2f(__VA_ARGS__))
 #define MPI_Parrived(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Parrived"), MPI_Parrived(__VA_ARGS__))
 #define MPI_Pready(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Pready"), MPI_Pready(__VA_ARGS__))
-#define MPI_Pready_range(...)                                                                                          \
-  (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Pready_range"), MPI_Pready_range(__VA_ARGS__))
-#define MPI_Pready_list(...)                                                                                           \
-  (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Pready_list"), MPI_Pready_list(__VA_ARGS__))
-#define MPI_Precv_init(...)                                                                                            \
-  (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Precv_init"), MPI_Precv_init(__VA_ARGS__))
-#define MPI_Psend_init(...)                                                                                            \
-  (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Psend_init"), MPI_Psend_init(__VA_ARGS__))
+#define MPI_Pready_range(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Pready_range"), MPI_Pready_range(__VA_ARGS__))
+#define MPI_Pready_list(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Pready_list"), MPI_Pready_list(__VA_ARGS__))
+#define MPI_Precv_init(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Precv_init"), MPI_Precv_init(__VA_ARGS__))
+#define MPI_Psend_init(...) (smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_Psend_init"), MPI_Psend_init(__VA_ARGS__))
index 4684b6b..4e114f0 100644 (file)
 #define MPI_IRSEND smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_IRSEND"); call MPI_Irsend
 #define mpi_sendrecv smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_sendrecv"); call MPI_Sendrecv
 #define MPI_SENDRECV smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_SENDRECV"); call MPI_Sendrecv
+#define mpi_isendrecv smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_isendrecv"); call MPI_Isendrecv
+#define MPI_ISENDRECV smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_ISENDRECV"); call MPI_Isendrecv
 #define mpi_sendrecv_replace smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_sendrecv_replace"); call MPI_Sendrecv_replace
 #define MPI_SENDRECV_REPLACE smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_SENDRECV_REPLACE"); call MPI_Sendrecv_replace
+#define mpi_isendrecv_replace smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_isendrecv_replace"); call MPI_Isendrecv_replace
+#define MPI_ISENDRECV_REPLACE smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_ISENDRECV_REPLACE"); call MPI_Isendrecv_replace
 #define mpi_test smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_test"); call MPI_Test
 #define MPI_TEST smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_TEST"); call MPI_Test
 #define mpi_testany smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_testany"); call MPI_Testany
 #define MPI_STATUS_F2C smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_STATUS_F2C"); call MPI_Status_f2c
 #define mpi_status_c2f smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_status_c2f"); call MPI_Status_c2f
 #define MPI_STATUS_C2F smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_STATUS_C2F"); call MPI_Status_c2f
-#define mpi_parrived                                                                                                   \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_parrived");                                                    \
-  call MPI_Parrived
-#define MPI_PARRIVED                                                                                                   \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PARRIVED");                                                    \
-  call MPI_Parrived
-#define mpi_pready                                                                                                     \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_pready");                                                      \
-  call MPI_Pready
-#define MPI_PREADY                                                                                                     \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PREADY");                                                      \
-  call MPI_Pready
-#define mpi_pready_range                                                                                               \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_pready_range");                                                \
-  call MPI_Pready_range
-#define MPI_PREADY_RANGE                                                                                               \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PREADY_RANGE");                                                \
-  call MPI_Pready_range
-#define mpi_pready_list                                                                                                \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_pready_list");                                                 \
-  call MPI_Pready_list
-#define MPI_PREADY_LIST                                                                                                \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PREADY_LIST");                                                 \
-  call MPI_Pready_list
-#define mpi_precv_init                                                                                                 \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_precv_init");                                                  \
-  call MPI_Precv_init
-#define MPI_PRECV_INIT                                                                                                 \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PRECV_INIT");                                                  \
-  call MPI_Precv_init
-#define mpi_psend_init                                                                                                 \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "mpi_psend_init");                                                  \
-  call MPI_Psend_init
-#define MPI_PSEND_INIT                                                                                                 \
-  smpi_trace_set_call_location(__FILE__, __LINE__, "MPI_PSEND_INIT");                                                  \
-  call MPI_Psend_init
+#define mpi_parrived smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_parrived"); call MPI_Parrived
+#define MPI_PARRIVED smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PARRIVED"); call MPI_Parrived
+#define mpi_pready smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_pready"); call MPI_Pready
+#define MPI_PREADY smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PREADY"); call MPI_Pready
+#define mpi_pready_range smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_pready_range"); call MPI_Pready_range
+#define MPI_PREADY_RANGE smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PREADY_RANGE"); call MPI_Pready_range
+#define mpi_pready_list smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_pready_list"); call MPI_Pready_list
+#define MPI_PREADY_LIST smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PREADY_LIST"); call MPI_Pready_list
+#define mpi_precv_init smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_precv_init"); call MPI_Precv_init
+#define MPI_PRECV_INIT smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PRECV_INIT"); call MPI_Precv_init
+#define mpi_psend_init smpi_trace_set_call_location(__FILE__,__LINE__,"mpi_psend_init"); call MPI_Psend_init
+#define MPI_PSEND_INIT smpi_trace_set_call_location(__FILE__,__LINE__,"MPI_PSEND_INIT"); call MPI_Psend_init
index 9639bf6..c682e17 100644 (file)
@@ -208,18 +208,16 @@ void Battery::update()
     energy_stored_j_ = std::min(energy_stored_j_, 3600 * capacity_wh_);
     last_updated_    = now;
 
-    std::vector<std::shared_ptr<Handler>> to_delete = {};
-    for (auto handler : handlers_) {
+    auto handlers_2 = handlers_;
+    for (auto handler : handlers_2) {
       if (abs(handler->time_delta_ - time_delta_s) < 0.000000001) {
         handler->callback_();
         if (handler->persistancy_ == Handler::Persistancy::PERSISTANT)
           handler->time_delta_ = -1;
         else
-          to_delete.push_back(handler);
+          delete_handler(handler);
       }
     }
-    for (auto handler : to_delete)
-      delete_handler(handler);
   });
 }
 
index ee767fb..8e169c4 100644 (file)
@@ -30,7 +30,7 @@ JbodPtr Jbod::create_jbod(s4u::NetZone* zone, const std::string& name, double sp
   for (unsigned int i = 0; i < num_disks; i++)
     jbod->get_controller()->create_disk(name + "_disk_" + std::to_string(i), read_bandwidth, write_bandwidth);
 
-  return JbodPtr(jbod);
+  return JbodPtr(jbod, false);
 }
 
 JbodIoPtr Jbod::read_async(sg_size_t size)
index 9a4f3b5..42b4789 100644 (file)
@@ -11,6 +11,13 @@ set(FLEX_MIN_PATCH 39)
 # Let's generate header files required by SMPI when the call location tracing
 # has been activated.
 if(enable_maintainer_mode)
+  if (enable_ns3)
+    message(STATUS "Maintainer mode activated with ns-3, not enabling GLIBCXX_DEBUG (diable ns-3 to get it).")
+  else()
+    message(STATUS "Maintainer mode activated, enabling GLIBCXX_DEBUG.")
+    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_DEBUG")
+  endif()
+
   add_custom_command(OUTPUT ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces.h
                             ${CMAKE_HOME_DIRECTORY}/include/smpi/smpi_extended_traces_fortran.h
     DEPENDS
@@ -173,9 +180,9 @@ if(enable_maintainer_mode)
 
 endif()
 
-    add_custom_target(maintainer_files
-      DEPENDS ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.h
-              ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.c
-              ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h
-              ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.c
-      )
+add_custom_target(maintainer_files
+  DEPENDS ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.h
+          ${CMAKE_HOME_DIRECTORY}/src/kernel/xml/simgrid_dtd.c
+          ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.h
+          ${CMAKE_HOME_DIRECTORY}/src/dag/dax_dtd.c
+  )