class BoostParallelContext : public BoostContext {
public:
BoostParallelContext(std::function<void()> code,
class BoostParallelContext : public BoostContext {
public:
BoostParallelContext(std::function<void()> code,
xbt_os_thread_key_t BoostContext::worker_id_key_;
unsigned long BoostContext::process_index_ = 0;
BoostContext* BoostContext::maestro_context_ = nullptr;
xbt_os_thread_key_t BoostContext::worker_id_key_;
unsigned long BoostContext::process_index_ = 0;
BoostContext* BoostContext::maestro_context_ = nullptr;
xbt_die("No thread support for parallel context execution");
#else
int nthreads = SIMIX_context_get_nthreads();
xbt_die("No thread support for parallel context execution");
#else
int nthreads = SIMIX_context_get_nthreads();
if (BoostContext::parmap_) {
xbt_parmap_destroy(BoostContext::parmap_);
BoostContext::parmap_ = nullptr;
if (BoostContext::parmap_) {
xbt_parmap_destroy(BoostContext::parmap_);
BoostContext::parmap_ = nullptr;
context = this->new_context<BoostParallelContext>(
std::move(code), cleanup_func, process);
#else
context = this->new_context<BoostParallelContext>(
std::move(code), cleanup_func, process);
#else
if (BoostContext::parallel_) {
BoostContext::threads_working_ = 0;
xbt_parmap_apply(BoostContext::parmap_,
if (BoostContext::parallel_) {
BoostContext::threads_working_ = 0;
xbt_parmap_apply(BoostContext::parmap_,
boost::context::jump_fcontext(
maestro_context_->fc_, this->fc_,
(intptr_t) this);
#else
boost::context::jump_fcontext(
boost::context::jump_fcontext(
maestro_context_->fc_, this->fc_,
(intptr_t) this);
#else
boost::context::jump_fcontext(
boost::context::jump_fcontext(
this->fc_, next_context->fc_, (intptr_t) next_context);
#else
boost::context::jump_fcontext(
this->fc_, next_context->fc_, (intptr_t) next_context);
#else
next_context = static_cast<BoostParallelContext*>(
workers_context_[worker_id]);
}
SIMIX_context_set_current((smx_context_t) next_context);
next_context = static_cast<BoostParallelContext*>(
workers_context_[worker_id]);
}
SIMIX_context_set_current((smx_context_t) next_context);
boost::context::jump_fcontext(
this->fc_, next_context->fc_, (intptr_t)next_context);
#else
boost::context::jump_fcontext(
this->fc_, next_context->fc_, (intptr_t)next_context);
#else
xbt_os_thread_set_specific(worker_id_key_, (void*) worker_id);
BoostParallelContext* worker_context =
xbt_os_thread_set_specific(worker_id_key_, (void*) worker_id);
BoostParallelContext* worker_context =
boost::context::jump_fcontext(
worker_context->fc_, this->fc_, (intptr_t) this);
#else
boost::context::jump_fcontext(
worker_context->fc_, this->fc_, (intptr_t) this);
#else