Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
authorFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 3 Feb 2019 16:22:53 +0000 (17:22 +0100)
committerFrederic Suter <frederic.suter@cc.in2p3.fr>
Sun, 3 Feb 2019 16:22:53 +0000 (17:22 +0100)
20 files changed:
examples/smpi/replay/replay-override-replayer.tesh
examples/smpi/replay/replay.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed1.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_noise.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr.tesh
examples/smpi/replay_multiple_manual_deploy/replay_multiple_manual_mixed2_st_sr_noise.tesh
include/simgrid/s4u/Activity.hpp
include/simgrid/simix.h
src/kernel/activity/ActivityImpl.cpp
src/kernel/activity/ActivityImpl.hpp
src/kernel/activity/ExecImpl.cpp
src/kernel/activity/ExecImpl.hpp
src/msg/msg_gos.cpp
src/msg/msg_task.cpp
src/simix/libsmx.cpp
src/simix/smx_host.cpp
src/simix/smx_host_private.hpp
src/smpi/mpi/smpi_request.cpp

index 7d1feac..745104f 100644 (file)
@@ -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
index 38496fd..92ab687 100644 (file)
@@ -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
index 793eaf6..2c75648 100644 (file)
@@ -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')
index 3e1221e..8f3de7e 100644 (file)
@@ -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')
index d67b84f..b70b166 100644 (file)
@@ -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
index 100b277..5a94862 100644 (file)
@@ -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')
index 8eaaa2e..36484ff 100644 (file)
@@ -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')
index d72130b..ed71229 100644 (file)
@@ -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')
index f9af5ac..d8b4a68 100644 (file)
@@ -90,6 +90,8 @@ public:
   /** Retrieve the user data of the Activity */
   void* get_user_data() { return user_data_; }
 
+  simgrid::kernel::activity::ActivityImplPtr get_impl() { return pimpl_; }
+
 #ifndef DOXYGEN
   XBT_ATTRIB_DEPRECATED_v324("Please use Activity::wait_for()") virtual void wait(double timeout) = 0;
   XBT_ATTRIB_DEPRECATED_v323("Please use Activity::get_state()") Activity::State getState() { return state_; }
index 3f1bb78..748f4a5 100644 (file)
@@ -180,15 +180,10 @@ XBT_PUBLIC void SIMIX_comm_finish(smx_activity_t synchro);
 
 /******************************* Host simcalls ********************************/
 #ifdef __cplusplus
-XBT_PUBLIC smx_activity_t simcall_execution_start(std::string name, std::string category, double flops_amount,
-                                                  double priority, double bound, sg_host_t host);
 XBT_PUBLIC smx_activity_t simcall_execution_parallel_start(std::string name, int host_nb, sg_host_t* host_list,
                                                            double* flops_amount, double* bytes_amount, double rate,
                                                            double timeout);
 #endif
-XBT_PUBLIC void simcall_execution_cancel(smx_activity_t execution);
-XBT_PUBLIC void simcall_execution_set_priority(smx_activity_t execution, double priority);
-XBT_PUBLIC void simcall_execution_set_bound(smx_activity_t execution, double bound);
 XBT_PUBLIC e_smx_state_t simcall_execution_wait(smx_activity_t execution);
 XBT_PUBLIC e_smx_state_t simcall_execution_test(smx_activity_t execution);
 
@@ -246,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();
index ff1cb4b..a92efa2 100644 (file)
@@ -9,6 +9,12 @@ namespace simgrid {
 namespace kernel {
 namespace activity {
 
+void simgrid::kernel::activity::ActivityImpl::set_category(std::string category)
+{
+  if (surf_action_)
+    surf_action_->set_category(category);
+}
+
 // boost::intrusive_ptr<Activity> support:
 void intrusive_ptr_add_ref(simgrid::kernel::activity::ActivityImpl* activity)
 {
index 5668b7a..7b8f091 100644 (file)
@@ -13,6 +13,7 @@
 #include "simgrid/forward.h"
 
 #include <atomic>
+#include <simgrid/kernel/resource/Action.hpp>
 #include <simgrid/simix.hpp>
 
 namespace simgrid {
@@ -33,6 +34,8 @@ public:
   virtual void resume()  = 0;
   virtual void post()    = 0; // What to do when a simcall terminates
 
+  void set_category(std::string category);
+
   // boost::intrusive_ptr<ActivityImpl> support:
   friend XBT_PUBLIC void intrusive_ptr_add_ref(ActivityImpl* activity);
   friend XBT_PUBLIC void intrusive_ptr_release(ActivityImpl* activity);
index 3cd26b0..edf9d2e 100644 (file)
@@ -78,7 +78,6 @@ double simgrid::kernel::activity::ExecImpl::get_remaining()
   xbt_assert(host_ != nullptr, "Calling remains() on a parallel execution is not allowed. "
                                "We would need to return a vector instead of a scalar. "
                                "Did you mean remainingRatio() instead?");
-
   return surf_action_ ? surf_action_->get_remains() : 0;
 }
 
@@ -102,12 +101,6 @@ void simgrid::kernel::activity::ExecImpl::set_priority(double priority)
     surf_action_->set_priority(priority);
 }
 
-void simgrid::kernel::activity::ExecImpl::set_category(std::string category)
-{
-  if (surf_action_)
-    surf_action_->set_category(category);
-}
-
 void simgrid::kernel::activity::ExecImpl::post()
 {
   if (host_ && host_->is_off()) { /* FIXME: handle resource failure for parallel tasks too */
index 6ea0231..0e6b57e 100644 (file)
@@ -28,11 +28,11 @@ public:
   double get_remaining_ratio();
   void set_bound(double bound);
   void set_priority(double priority);
-  void set_category(std::string category);
   virtual ActivityImpl* migrate(s4u::Host* to);
 
   /* The host where the execution takes place. nullptr means this is a parallel exec (and only surf knows the hosts) */
   s4u::Host* host_ = nullptr;
+
 private:
   resource::Action* timeout_detector_ = nullptr;
 
index 422ba8d..803e509 100644 (file)
@@ -4,6 +4,7 @@
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
 #include "simgrid/Exception.hpp"
+#include <cmath>
 
 #include "simgrid/s4u/Mailbox.hpp"
 #include "src/instr/instr_private.hpp"
@@ -66,11 +67,19 @@ 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 {
-      simdata->compute = boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(
-          simcall_execution_start(task->name ?: "", task->category ?: "", simdata->flops_amount, simdata->priority,
-                                  simdata->bound, MSG_process_get_host(MSG_process_self())));
+      sg_host_t host   = MSG_process_get_host(MSG_process_self());
+      simdata->compute = simgrid::simix::simcall([task, host] {
+        return simgrid::kernel::activity::ExecImplPtr(
+            new simgrid::kernel::activity::ExecImpl(task->name ?: "", task->category ?: "",
+                                                    /*timeout_detector*/ nullptr, host));
+      });
+      /* checking for infinite values */
+      xbt_assert(std::isfinite(simdata->flops_amount), "flops_amount is not finite!");
+      xbt_assert(std::isfinite(simdata->priority), "priority is not finite!");
+
+      simdata->compute->start(simdata->flops_amount, simdata->priority, simdata->bound);
     }
 
     comp_state = simcall_execution_wait(simdata->compute);
@@ -326,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;
@@ -766,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<simgrid::kernel::activity::CommImpl>(comm);
     simcall_comm_wait(comm, timeout);
   } catch (simgrid::TimeoutError& e) {
index 14b3ce6..bf8de7e 100644 (file)
@@ -6,6 +6,7 @@
 #include "msg_private.hpp"
 #include "src/simix/smx_private.hpp"
 #include <algorithm>
+#include <cmath>
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_task, msg, "Logging specific to MSG (task)");
 
@@ -186,7 +187,7 @@ msg_error_t MSG_task_cancel(msg_task_t task)
 
   simdata_task_t simdata = task->simdata;
   if (simdata->compute) {
-    simcall_execution_cancel(simdata->compute);
+    simgrid::simix::simcall([simdata] { simdata->compute->cancel(); });
   } else if (simdata->comm) {
     simcall_comm_cancel(simdata->comm);
   }
@@ -275,8 +276,9 @@ double MSG_task_get_bytes_amount(msg_task_t task)
 void MSG_task_set_priority(msg_task_t task, double priority)
 {
   task->simdata->priority = 1 / priority;
+  xbt_assert(std::isfinite(task->simdata->priority), "priority is not finite!");
   if (task->simdata->compute)
-    simcall_execution_set_priority(task->simdata->compute, task->simdata->priority);
+    simgrid::simix::simcall([task] { task->simdata->compute->set_priority(task->simdata->priority); });
 }
 
 /** @brief Changes the maximum CPU utilization of a computation task (in flops/s).
@@ -290,5 +292,5 @@ void MSG_task_set_bound(msg_task_t task, double bound)
 
   task->simdata->bound = bound;
   if (task->simdata->compute)
-    simcall_execution_set_bound(task->simdata->compute, task->simdata->bound);
+    simgrid::simix::simcall([task, bound] { task->simdata->compute->set_bound(bound); });
 }
index 7269508..8bcf662 100644 (file)
@@ -26,33 +26,6 @@ XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
 
 #include "popping_bodies.cpp"
 
-/**
- * @ingroup simix_process_management
- * @brief Creates a synchro that executes some computation of a host.
- *
- * This function creates a SURF action and allocates the data necessary
- * to create the SIMIX synchro. It can raise a HostFailureException exception if the host crashed.
- *
- * @param name Name of the execution synchro to create
- * @param category Tracing category
- * @param flops_amount amount Computation amount (in flops)
- * @param priority computation priority
- * @param bound Maximal speed for this execution (in flops) or -1 if no limit
- * @param host host where the synchro will be executed
- * @return A new SIMIX execution synchronization
- */
-smx_activity_t simcall_execution_start(std::string name, std::string category, double flops_amount, double priority,
-                                       double bound, simgrid::s4u::Host* host)
-{
-  /* checking for infinite values */
-  xbt_assert(std::isfinite(flops_amount), "flops_amount is not finite!");
-  xbt_assert(std::isfinite(priority), "priority is not finite!");
-
-  return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
-    return SIMIX_execution_start(name, category, flops_amount, priority, bound, host);
-  });
-}
-
 /**
  * @ingroup simix_process_management
  * @brief Creates a synchro that may involve parallel computation on
@@ -90,59 +63,6 @@ smx_activity_t simcall_execution_parallel_start(std::string name, int host_nb, s
   });
 }
 
-/**
- * @ingroup simix_process_management
- * @brief Cancels an execution synchro.
- *
- * This functions stops the execution. It calls a surf function.
- * @param execution The execution synchro to cancel
- */
-void simcall_execution_cancel(smx_activity_t execution)
-{
-  simgrid::kernel::activity::ExecImplPtr exec =
-      boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
-  if (exec->surf_action_ == nullptr) // FIXME: One test fails if I remove this, but I don't get why...
-    return;
-  simgrid::simix::simcall([exec] { exec->cancel(); });
-}
-
-/**
- * @ingroup simix_process_management
- * @brief Changes the priority of an execution synchro.
- *
- * This functions changes the priority only. It calls a surf function.
- * @param execution The execution synchro
- * @param priority The new priority
- */
-void simcall_execution_set_priority(smx_activity_t execution, double priority)
-{
-  /* checking for infinite values */
-  xbt_assert(std::isfinite(priority), "priority is not finite!");
-  simgrid::simix::simcall([execution, priority] {
-
-    simgrid::kernel::activity::ExecImplPtr exec =
-        boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
-    exec->set_priority(priority);
-  });
-}
-
-/**
- * @ingroup simix_process_management
- * @brief Changes the capping (the maximum CPU utilization) of an execution synchro.
- *
- * This functions changes the capping only. It calls a surf function.
- * @param execution The execution synchro
- * @param bound The new bound
- */
-void simcall_execution_set_bound(smx_activity_t execution, double bound)
-{
-  simgrid::simix::simcall([execution, bound] {
-    simgrid::kernel::activity::ExecImplPtr exec =
-        boost::static_pointer_cast<simgrid::kernel::activity::ExecImpl>(execution);
-    exec->set_bound(bound);
-  });
-}
-
 /**
  * @ingroup simix_host_management
  * @brief Waits for the completion of an execution synchro and destroy it.
@@ -354,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
  *
index df906bb..19d3516 100644 (file)
@@ -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<simgrid::kernel::activity::ExecImpl>(synchro);
-  if (exec != nullptr) {
-    exec->surf_action_->set_category(category);
-    return;
-  }
-
-  simgrid::kernel::activity::CommImplPtr comm =
-      boost::dynamic_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
-  if (comm != nullptr) {
-    comm->surf_action_->set_category(category);
-  }
-}
index 970eeab..1200479 100644 (file)
@@ -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);
index dc751be..2ba1996 100644 (file)
@@ -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);
   }