// TODO: choose dynamically when SIMIX_context_get_parallel_threshold() > 1
ParallelRawContext::initialize();
// TODO: choose dynamically when SIMIX_context_get_parallel_threshold() > 1
ParallelRawContext::initialize();
}
Context* RawContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
smx_actor_t process)
{
}
Context* RawContextFactory::create_context(std::function<void()> code, void_pfn_smxprocess_t cleanup_func,
smx_actor_t process)
{
return this->new_context<SerialRawContext>(std::move(code), cleanup_func, process);
}
void RawContextFactory::run_all()
{
return this->new_context<SerialRawContext>(std::move(code), cleanup_func, process);
}
void RawContextFactory::run_all()
{
XBT_DEBUG("No more process to run");
next_context = static_cast<SerialRawContext*>(RawContext::get_maestro());
}
XBT_DEBUG("No more process to run");
next_context = static_cast<SerialRawContext*>(RawContext::get_maestro());
}
RawContext::swap(this, next_context);
}
void SerialRawContext::resume()
{
RawContext::swap(this, next_context);
}
void SerialRawContext::resume()
{
simgrid::xbt::Parmap<smx_actor_t>* ParallelRawContext::parmap_;
std::atomic<uintptr_t> ParallelRawContext::threads_working_; /* number of threads that have started their work */
uintptr_t thread_local ParallelRawContext::worker_id_; /* thread-specific storage for the thread id */
simgrid::xbt::Parmap<smx_actor_t>* ParallelRawContext::parmap_;
std::atomic<uintptr_t> ParallelRawContext::threads_working_; /* number of threads that have started their work */
uintptr_t thread_local ParallelRawContext::worker_id_; /* thread-specific storage for the thread id */
XBT_DEBUG("Restoring worker stack %zu (working threads = %zu)", worker_id_, threads_working_.load());
}
XBT_DEBUG("Restoring worker stack %zu (working threads = %zu)", worker_id_, threads_working_.load());
}
ParallelRawContext* worker_context = static_cast<ParallelRawContext*>(SIMIX_context_self());
workers_context_[worker_id_] = worker_context;
XBT_DEBUG("Saving worker stack %zu", worker_id_);
ParallelRawContext* worker_context = static_cast<ParallelRawContext*>(SIMIX_context_self());
workers_context_[worker_id_] = worker_context;
XBT_DEBUG("Saving worker stack %zu", worker_id_);
ContextFactory* raw_factory()
{
XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");
ContextFactory* raw_factory()
{
XBT_VERB("Using raw contexts. Because the glibc is just not good enough for us.");