From: Martin Quinson Date: Mon, 20 Nov 2023 13:45:13 +0000 (+0000) Subject: Merge branch 'task-docs' into 'master' X-Git-Tag: v3.35~7^2~1 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/8c077434920dc49c791c9ed5c3ad7cbbc8faec15?hp=ebec9c6104a6bbe60b7bf4586baeaf0b88f53505 Merge branch 'task-docs' into 'master' fix missing doc for Tasks See merge request simgrid/simgrid!180 --- diff --git a/examples/sthread/pthread-producer-consumer.c b/examples/sthread/pthread-producer-consumer.c index 52a0080256..fe3fe5d960 100644 --- a/examples/sthread/pthread-producer-consumer.c +++ b/examples/sthread/pthread-producer-consumer.c @@ -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); diff --git a/include/smpi/smpi_extended_traces.h b/include/smpi/smpi_extended_traces.h index 1e1fefb901..f0757ec0fc 100644 --- a/include/smpi/smpi_extended_traces.h +++ b/include/smpi/smpi_extended_traces.h @@ -134,7 +134,9 @@ #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__)) @@ -396,11 +398,7 @@ #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__)) diff --git a/include/smpi/smpi_extended_traces_fortran.h b/include/smpi/smpi_extended_traces_fortran.h index 4684b6b61f..4e114f08c2 100644 --- a/include/smpi/smpi_extended_traces_fortran.h +++ b/include/smpi/smpi_extended_traces_fortran.h @@ -261,8 +261,12 @@ #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 @@ -781,39 +785,15 @@ #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 diff --git a/src/plugins/battery.cpp b/src/plugins/battery.cpp index 9639bf67e5..c682e178ac 100644 --- a/src/plugins/battery.cpp +++ b/src/plugins/battery.cpp @@ -208,18 +208,16 @@ void Battery::update() energy_stored_j_ = std::min(energy_stored_j_, 3600 * capacity_wh_); last_updated_ = now; - std::vector> 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); }); } diff --git a/src/plugins/jbod.cpp b/src/plugins/jbod.cpp index ee767fba6f..8e169c45bd 100644 --- a/src/plugins/jbod.cpp +++ b/src/plugins/jbod.cpp @@ -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) diff --git a/tools/cmake/MaintainerMode.cmake b/tools/cmake/MaintainerMode.cmake index 9a4f3b5cda..42b4789db8 100644 --- a/tools/cmake/MaintainerMode.cmake +++ b/tools/cmake/MaintainerMode.cmake @@ -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 + )