$ 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
$ 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
$ 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
$ 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
> [ 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')
> [ 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')
> [ 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')
> [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')
> [ 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')
> [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')
> [ 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')
> [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')
> [ 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')
> [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')
> [ 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
> [ 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')
> [ 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')
> [ 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')
/** 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_; }
/******************************* 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);
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();
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)
{
#include "simgrid/forward.h"
#include <atomic>
+#include <simgrid/kernel/resource/Action.hpp>
#include <simgrid/simix.hpp>
namespace simgrid {
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);
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;
}
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 */
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;
* 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"
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);
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;
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) {
#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)");
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);
}
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).
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); });
}
#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
});
}
-/**
- * @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.
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
*
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);
- }
-}
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);
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);
}