/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "mc/mc.h"
#include "src/instr/instr_private.hpp"
#include "src/kernel/EngineImpl.hpp"
#include "src/mc/mc_replay.hpp"
#include "mc/mc.h"
#include "src/instr/instr_private.hpp"
#include "src/kernel/EngineImpl.hpp"
#include "src/mc/mc_replay.hpp"
xbt::signal<void()> Engine::on_simulation_end;
xbt::signal<void(double)> Engine::on_time_advance;
xbt::signal<void(void)> Engine::on_deadlock;
xbt::signal<void()> Engine::on_simulation_end;
xbt::signal<void(double)> Engine::on_time_advance;
xbt::signal<void(void)> Engine::on_deadlock;
void Engine::add_model(std::shared_ptr<kernel::resource::Model> model,
const std::vector<kernel::resource::Model*>& dependencies)
{
void Engine::add_model(std::shared_ptr<kernel::resource::Model> model,
const std::vector<kernel::resource::Model*>& dependencies)
{
- kernel::actor::simcall([this, &model, &dependencies] { pimpl->add_model(std::move(model), dependencies); });
+ kernel::actor::simcall_answered([this, &model, &dependencies] { pimpl->add_model(std::move(model), dependencies); });
- simgrid::kernel::actor::simcall([this, name, &code]() { pimpl->register_function(name, code); });
+ simgrid::kernel::actor::simcall_answered([this, name, &code]() { pimpl->register_function(name, code); });
Mailbox* Engine::mailbox_by_name_or_create(const std::string& name) const
{
/* two actors may have pushed the same mbox_create simcall at the same time */
Mailbox* Engine::mailbox_by_name_or_create(const std::string& name) const
{
/* two actors may have pushed the same mbox_create simcall at the same time */
auto m = pimpl->mailboxes_.emplace(name, nullptr);
if (m.second) {
m.first->second = new kernel::activity::MailboxImpl(name);
auto m = pimpl->mailboxes_.emplace(name, nullptr);
if (m.second) {
m.first->second = new kernel::activity::MailboxImpl(name);
/** @brief Register a new netpoint to the system */
void Engine::netpoint_register(kernel::routing::NetPoint* point)
{
/** @brief Register a new netpoint to the system */
void Engine::netpoint_register(kernel::routing::NetPoint* point)
{
}
/** @brief Unregister a given netpoint */
void Engine::netpoint_unregister(kernel::routing::NetPoint* point)
{
}
/** @brief Unregister a given netpoint */
void Engine::netpoint_unregister(kernel::routing::NetPoint* point)
{
-Engine* Engine::set_default_comm_data_copy_callback(void (*callback)(kernel::activity::CommImpl*, void*, size_t))
+Engine* Engine::set_default_comm_data_copy_callback(
+ const std::function<void(kernel::activity::CommImpl*, void*, size_t)>& callback)
/* **************************** Public C interface *************************** */
void simgrid_init(int* argc, char** argv)
{
/* **************************** Public C interface *************************** */
void simgrid_init(int* argc, char** argv)
{