From: Frederic Suter Date: Sun, 3 Feb 2019 16:22:30 +0000 (+0100) Subject: modern simcall for set_category X-Git-Tag: v3_22~407 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/f95f8ea9351ac3abf643f5edf0b6a06ba509ae96?ds=sidebyside modern simcall for set_category --- diff --git a/examples/smpi/replay/replay-override-replayer.tesh b/examples/smpi/replay/replay-override-replayer.tesh index 7d1feac3a3..745104fb0a 100644 --- a/examples/smpi/replay/replay-override-replayer.tesh +++ b/examples/smpi/replay/replay-override-replayer.tesh @@ -215,8 +215,8 @@ p Another test of trace replay with SMPI (one trace per process) $ mkfile ./split_traces_tesh_override $ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh_override --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning -> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 > [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158 +> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 isend 0 1 1e6 0.000000 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 irecv 0 2 1e6 0.000000 @@ -233,8 +233,8 @@ p Test of barrier replay with SMPI (one trace for all processes) $ mkfile replay/one_trace_override $ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace_override --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning -> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 > [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421 +> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 > [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976 > [Jupiter:1:(2) 1.521858] [smpi_replay/VERBOSE] 1 barrier 0.003438 > [Fafard:2:(3) 1.522373] [smpi_replay/VERBOSE] 2 barrier 1.522373 diff --git a/examples/smpi/replay/replay.tesh b/examples/smpi/replay/replay.tesh index 38496fdc47..92ab687831 100644 --- a/examples/smpi/replay/replay.tesh +++ b/examples/smpi/replay/replay.tesh @@ -215,8 +215,8 @@ p Another test of trace replay with SMPI (one trace per process) $ mkfile ./split_traces_tesh $ ../../smpi_script/bin/smpirun -no-privatize -replay ./split_traces_tesh --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 2 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning -> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 > [Jupiter:1:(2) 0.167158] [smpi_replay/VERBOSE] 1 recv 0 0 1e6 0.167158 +> [Tremblay:0:(1) 0.167158] [smpi_replay/VERBOSE] 0 send 1 0 1e6 0.167158 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 compute 1e9 13.106847 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 isend 0 1 1e6 0.000000 > [Jupiter:1:(2) 13.274005] [smpi_replay/VERBOSE] 1 irecv 0 2 1e6 0.000000 @@ -233,8 +233,8 @@ p Test of barrier replay with SMPI (one trace for all processes) $ mkfile replay/one_trace $ ../../smpi_script/bin/smpirun -no-privatize -replay replay/one_trace --log=replay.thresh:critical --log=smpi_replay.thresh:verbose --log=no_loc --cfg=smpi/simulate-computation:no -np 3 -platform ${srcdir:=.}/../platforms/small_platform.xml -hostfile ${srcdir:=.}/hostfile ./replay/smpi_replay --log=smpi_kernel.thres:warning --log=xbt_cfg.thres:warning -> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 > [Jupiter:1:(2) 1.518421] [smpi_replay/VERBOSE] 1 recv 0 0 1e7 1.518421 +> [Tremblay:0:(1) 1.518421] [smpi_replay/VERBOSE] 0 send 1 0 1e7 1.518421 > [Tremblay:0:(1) 1.520397] [smpi_replay/VERBOSE] 0 barrier 0.001976 > [Jupiter:1:(2) 1.521858] [smpi_replay/VERBOSE] 1 barrier 0.003438 > [Fafard:2:(3) 1.522373] [smpi_replay/VERBOSE] 2 barrier 1.522373 diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh index 793eaf6036..2c75648f89 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh @@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir > [ 0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone') @@ -29,7 +29,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir > [ 0.000000] (job_0000@Bourassa) Executing job 0 (smpi_app 'alone') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'alone') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'alone') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'alone') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'alone') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'alone') diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh index 3e1221e534..8f3de7e85e 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh @@ -15,7 +15,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [ 0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') @@ -23,7 +23,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [1000.000000] (job_0001@Ginette) Executing job 1 (smpi_app 'job1') > [1000.000000] (rank_1_0@Ginette) Replaying rank 0 of job 1 (smpi_app 'job1') > [1000.000000] (rank_1_1@Jupiter) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1806.923160] (rank_1_0@Ginette) Simulation time 806.923160 +> [1806.923160] (rank_1_1@Jupiter) Simulation time 806.923160 > [1806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [1807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1') @@ -41,7 +41,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [ 0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') @@ -49,7 +49,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [1000.000000] (job_0001@Ginette) Executing job 1 (smpi_app 'job1') > [1000.000000] (rank_1_0@Ginette) Replaying rank 0 of job 1 (smpi_app 'job1') > [1000.000000] (rank_1_1@Jupiter) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1806.923160] (rank_1_0@Ginette) Simulation time 806.923160 +> [1806.923160] (rank_1_1@Jupiter) Simulation time 806.923160 > [1806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [1807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1') @@ -75,7 +75,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [ 0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') @@ -83,7 +83,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [1000.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1') > [1000.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1') > [1000.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1737.001374] (rank_1_0@Bourassa) Simulation time 737.001374 +> [1737.001374] (rank_1_1@Fafard) Simulation time 737.001374 > [1737.001374] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1737.001374] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [1738.001374] (job_0001@Bourassa) Finished job 1 (smpi_app 'job1') @@ -101,7 +101,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [ 0.000000] (workload@Bourassa) Sleeping 1000 seconds (waiting for job 1000, app 'job1') > [ 0.000000] (rank_0_0@Bourassa) Replaying rank 0 of job 0 (smpi_app 'job0') > [ 0.000000] (rank_0_1@Fafard) Replaying rank 1 of job 0 (smpi_app 'job0') -> [ 737.001374] (rank_0_0@Bourassa) Simulation time 737.001374 +> [ 737.001374] (rank_0_1@Fafard) Simulation time 737.001374 > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') @@ -109,7 +109,7 @@ $ ./replay_multiple_manual ${platfdir}/small_platform_with_routers.xml ${srcdir: > [1000.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1') > [1000.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1') > [1000.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1737.001374] (rank_1_0@Bourassa) Simulation time 737.001374 +> [1737.001374] (rank_1_1@Fafard) Simulation time 737.001374 > [1737.001374] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1737.001374] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [1738.001374] (job_0001@Bourassa) Finished job 1 (smpi_app 'job1') diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh index d67b84fd2f..b70b166713 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh @@ -16,8 +16,8 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') -> [ 806.923160] (rank_1_0@Ginette) Simulation time 806.923160 > [ 806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1') +> [ 806.923160] (rank_1_1@Jupiter) Simulation time 806.923160 > [ 806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [ 807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1') > [ 807.923160] (maestro@) Simulation finished! Final time: 807.923 diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh index 100b2778c9..5a948628df 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh @@ -16,7 +16,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout > [ 737.001374] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [ 737.001374] (rank_0_1@Fafard) Finished replaying rank 1 of job 0 (smpi_app 'job0') > [ 738.001374] (job_0000@Bourassa) Finished job 0 (smpi_app 'job0') -> [ 806.923160] (rank_1_0@Ginette) Simulation time 806.923160 +> [ 806.923160] (rank_1_1@Jupiter) Simulation time 806.923160 > [ 806.923160] (rank_1_0@Ginette) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [ 806.923160] (rank_1_1@Jupiter) Finished replaying rank 1 of job 1 (smpi_app 'job1') > [ 807.923160] (job_0001@Ginette) Finished job 1 (smpi_app 'job1') diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh index 8eaaa2e6aa..36484ff60b 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh @@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout > [ 0.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1') > [ 0.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1') > [ 0.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1473.975664] (rank_0_0@Bourassa) Simulation time 1473.975664 +> [1473.975664] (rank_0_1@Fafard) Simulation time 1473.975664 > [1473.975664] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1473.975664] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [1473.975664] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1') diff --git a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh index d72130b63b..ed7122928b 100644 --- a/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh +++ b/examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh @@ -13,7 +13,7 @@ $ ./replay_multiple_manual ${srcdir:=.}/../../platforms/small_platform_with_rout > [ 0.000000] (job_0001@Bourassa) Executing job 1 (smpi_app 'job1') > [ 0.000000] (rank_1_0@Bourassa) Replaying rank 0 of job 1 (smpi_app 'job1') > [ 0.000000] (rank_1_1@Fafard) Replaying rank 1 of job 1 (smpi_app 'job1') -> [1473.975664] (rank_0_0@Bourassa) Simulation time 1473.975664 +> [1473.975664] (rank_0_1@Fafard) Simulation time 1473.975664 > [1473.975664] (rank_1_0@Bourassa) Finished replaying rank 0 of job 1 (smpi_app 'job1') > [1473.975664] (rank_0_0@Bourassa) Finished replaying rank 0 of job 0 (smpi_app 'job0') > [1473.975664] (rank_1_1@Fafard) Finished replaying rank 1 of job 1 (smpi_app 'job1') diff --git a/include/simgrid/simix.h b/include/simgrid/simix.h index c0daa91530..748f4a5a96 100644 --- a/include/simgrid/simix.h +++ b/include/simgrid/simix.h @@ -241,11 +241,6 @@ XBT_PUBLIC void simcall_comm_wait(smx_activity_t comm, double timeout); XBT_PUBLIC int simcall_comm_test(smx_activity_t comm); XBT_PUBLIC int simcall_comm_testany(smx_activity_t* comms, size_t count); -/************************** Tracing handling **********************************/ -#ifdef __cplusplus -XBT_PUBLIC void simcall_set_category(smx_activity_t synchro, std::string category); -#endif - /************************** Synchro simcalls **********************************/ SG_BEGIN_DECL() XBT_PUBLIC smx_mutex_t simcall_mutex_init(); diff --git a/src/msg/msg_gos.cpp b/src/msg/msg_gos.cpp index 10e43af200..803e509f90 100644 --- a/src/msg/msg_gos.cpp +++ b/src/msg/msg_gos.cpp @@ -67,7 +67,7 @@ msg_error_t MSG_parallel_task_execute_with_timeout(msg_task_t task, double timeo simdata->bytes_parallel_amount, -1.0, timeout)); XBT_DEBUG("Parallel execution action created: %p", simdata->compute.get()); if (task->category != nullptr) - simcall_set_category(simdata->compute, task->category); + simgrid::simix::simcall([task] { task->simdata->compute->set_category(task->category); }); } else { sg_host_t host = MSG_process_get_host(MSG_process_self()); simdata->compute = simgrid::simix::simcall([task, host] { @@ -335,8 +335,9 @@ static inline msg_comm_t MSG_task_isend_internal(msg_task_t task, const char* al comm = new simgrid::msg::Comm(task, nullptr, act); } - if (TRACE_is_enabled()) - simcall_set_category(act, task->category); + if (TRACE_is_enabled() && task->category != nullptr) + simgrid::simix::simcall([act, task] { act->set_category(task->category); }); + TRACE_msg_task_put_end(); return comm; @@ -775,7 +776,7 @@ msg_error_t MSG_task_send_with_timeout(msg_task_t task, const char *alias, doubl comm = simcall_comm_isend(SIMIX_process_self(), mailbox->get_impl(), t_simdata->bytes_amount, t_simdata->rate, task, sizeof(void*), nullptr, nullptr, nullptr, nullptr, 0); if (TRACE_is_enabled() && task->category != nullptr) - simcall_set_category(comm, task->category); + simgrid::simix::simcall([comm, task] { comm->set_category(task->category); }); t_simdata->comm = boost::static_pointer_cast(comm); simcall_comm_wait(comm, timeout); } catch (simgrid::TimeoutError& e) { diff --git a/src/simix/libsmx.cpp b/src/simix/libsmx.cpp index 4907a9521e..8bcf6626db 100644 --- a/src/simix/libsmx.cpp +++ b/src/simix/libsmx.cpp @@ -274,21 +274,6 @@ void simcall_comm_wait(smx_activity_t comm, double timeout) simcall_BODY_comm_wait(comm, timeout); } -/** - * @brief Set the category of an synchro. - * - * This functions changes the category only. It calls a surf function. - * @param synchro The execution synchro - * @param category The tracing category - */ -void simcall_set_category(smx_activity_t synchro, std::string category) -{ - if (category.empty()) { - return; - } - simgrid::simix::simcall([synchro, category] { SIMIX_set_category(synchro, category); }); -} - /** * @ingroup simix_comm_management * diff --git a/src/simix/smx_host.cpp b/src/simix/smx_host.cpp index df906bb256..19d3516ab6 100644 --- a/src/simix/smx_host.cpp +++ b/src/simix/smx_host.cpp @@ -157,22 +157,3 @@ void SIMIX_execution_finish(smx_activity_t synchro) SIMIX_simcall_answer(simcall); } } - -void SIMIX_set_category(smx_activity_t synchro, std::string category) -{ - if (synchro->state_ != SIMIX_RUNNING) - return; - - simgrid::kernel::activity::ExecImplPtr exec = - boost::dynamic_pointer_cast(synchro); - if (exec != nullptr) { - exec->surf_action_->set_category(category); - return; - } - - simgrid::kernel::activity::CommImplPtr comm = - boost::dynamic_pointer_cast(synchro); - if (comm != nullptr) { - comm->surf_action_->set_category(category); - } -} diff --git a/src/simix/smx_host_private.hpp b/src/simix/smx_host_private.hpp index 970eeabe35..120047923e 100644 --- a/src/simix/smx_host_private.hpp +++ b/src/simix/smx_host_private.hpp @@ -12,8 +12,6 @@ XBT_PRIVATE void SIMIX_execution_finish(smx_activity_t synchro); -XBT_PRIVATE void SIMIX_set_category(smx_activity_t synchro, std::string category); - XBT_PRIVATE simgrid::kernel::activity::ExecImplPtr SIMIX_execution_start(std::string name, std::string category, double flops_amount, double priority, double bound, sg_host_t host); diff --git a/src/smpi/mpi/smpi_request.cpp b/src/smpi/mpi/smpi_request.cpp index dc751be4bf..2ba19966ab 100644 --- a/src/smpi/mpi/smpi_request.cpp +++ b/src/smpi/mpi/smpi_request.cpp @@ -512,8 +512,11 @@ void Request::start() XBT_DEBUG("send simcall posted"); /* FIXME: detached sends are not traceable (action_ == nullptr) */ - if (action_ != nullptr) - simcall_set_category(action_, TRACE_internal_smpi_get_category()); + if (action_ != nullptr) { + std::string category = TRACE_internal_smpi_get_category(); + simgrid::simix::simcall([this, category] { this->action_->set_category(category); }); + } + if (async_small_thresh != 0 || ((flags_ & MPI_REQ_RMA) != 0)) xbt_mutex_release(mut); }