it denotes, so use JniException that is a RuntimeException (not to
be catched explicitely).
+ S4U
+ - New callbacks:
+ - simgrid::s4u::onPlatformCreated: right before the simulation starts
+
-- target_date=March 20 2017 -- Da SimGrid team <simgrid-devel@lists.gforge.inria.fr>
SimGrid (3.14.159) stable; urgency=low
private:
static s4u::Engine *instance_;
};
+
+/* Callback called when the platform is created (ie, the xml file parsed),
+ * right before the actual simulation starts.
+ */
+extern XBT_PRIVATE xbt::signal<void(void)> onPlatformCreated;
}} // namespace simgrid::s4u
#endif /* SIMGRID_S4U_ENGINE_HPP */
/* 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 "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
#include "instr/instr_interface.h"
#include "mc/mc.h"
#include "src/msg/msg_private.h"
-#include "src/surf/xml/platf_private.hpp" // FIXME: KILLME by removing MSG_post_create_environment()
XBT_LOG_NEW_CATEGORY(msg, "All MSG categories");
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(msg_kernel, msg, "Logging specific to MSG (kernel)");
SIMIX_function_register_process_create(MSG_process_create_from_SIMIX);
SIMIX_function_register_process_cleanup(MSG_process_cleanup_from_SIMIX);
- simgrid::surf::on_postparse.connect(MSG_post_create_environment);
+ simgrid::s4u::onPlatformCreated.connect(MSG_post_create_environment);
simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
MSG_host_create_(&host);
});
namespace simgrid {
namespace s4u {
+xbt::signal<void(void)> onPlatformCreated;
Engine *Engine::instance_ = nullptr; /* That singleton is awful, but I don't see no other solution right now. */
#include <xbt/functional.hpp>
-#include <simgrid/s4u/host.hpp>
+#include "simgrid/s4u/engine.hpp"
+#include "simgrid/s4u/host.hpp"
#include "src/surf/surf_interface.hpp"
#include "src/surf/storage_interface.hpp"
#endif
/* register a function to be called by SURF after the environment creation */
sg_platf_init();
- simgrid::surf::on_postparse.connect(SIMIX_post_create_environment);
+ simgrid::s4u::onPlatformCreated.connect(SIMIX_post_create_environment);
simgrid::s4u::Host::onCreation.connect([](simgrid::s4u::Host& host) {
host.extension_set<simgrid::simix::Host>(new simgrid::simix::Host());
});
}
double time = 0;
- smx_actor_t process;
do {
XBT_DEBUG("New Schedule Round; size(queue)=%lu", xbt_dynar_length(simix_global->process_to_run));
*/
unsigned int iter;
+ smx_actor_t process;
xbt_dynar_foreach(simix_global->process_that_ran, iter, process) {
if (process->simcall.call != SIMCALL_NONE) {
SIMIX_simcall_handle(&process->simcall, 0);
#include "simgrid/s4u/engine.hpp"
#include "simgrid/s4u/host.hpp"
+
#include "src/kernel/routing/NetZoneImpl.hpp"
#include "src/surf/network_interface.hpp"
#include "src/surf/xml/platf_private.hpp"
//to create the rootContainer and the rootType properly
if (!TRACE_needs_platform()) return;
simgrid::surf::Link::onCreation.connect(instr_routing_parse_start_link);
- simgrid::surf::on_postparse.connect(instr_routing_parse_end_platform);
+ simgrid::s4u::onPlatformCreated.connect(instr_routing_parse_end_platform);
}
/*
});
simgrid::surf::on_cluster.connect(&clusterCreation_cb);
- simgrid::surf::on_postparse.connect(&postparse_cb);
+ simgrid::s4u::onPlatformCreated.connect(&postparse_cb);
simgrid::s4u::NetZone::onRouteCreation.connect(&routeCreation_cb);
LogComponentEnable("UdpEchoClientApplication", ns3::LOG_LEVEL_INFO);
smpi_lat_factor = parse_factor(xbt_cfg_get_string("smpi/lat-factor"));
double current=1.0;
- for (auto fact: smpi_lat_factor) {
+ for (const auto& fact : smpi_lat_factor) {
if (size <= fact.factor) {
XBT_DEBUG("%f <= %zu return %f", size, fact.factor, current);
return current;
-/* Copyright (c) 2006-2014. The SimGrid Team.
- * All rights reserved. */
/* 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 "simgrid/s4u/engine.hpp"
+
#include "src/kernel/EngineImpl.hpp"
#include "src/simix/smx_private.h"
namespace surf {
simgrid::xbt::signal<void(sg_platf_cluster_cbarg_t)> on_cluster;
-simgrid::xbt::signal<void(void)> on_postparse;
}
}
/** Module management function: frees all internal data structures */
void sg_platf_exit() {
simgrid::surf::on_cluster.disconnect_all_slots();
- simgrid::surf::on_postparse.disconnect_all_slots();
+ simgrid::s4u::onPlatformCreated.disconnect_all_slots();
/* make sure that we will reinit the models while loading the platf once reinited */
surf_parse_models_setup_already_called = 0;
void sg_platf_begin() { /* Do nothing: just for symmetry of user code */ }
void sg_platf_end() {
- simgrid::surf::on_postparse();
+ simgrid::s4u::onPlatformCreated();
}
/* Pick the right models for CPU, net and host, and call their model_init_preparse */
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "storage_n11.hpp"
+#include "simgrid/s4u/engine.hpp"
#include "src/kernel/routing/NetPoint.hpp"
#include "surf_private.h"
#include <math.h> /*ceil*/
void storage_register_callbacks()
{
- simgrid::surf::on_postparse.connect(check_disk_attachment);
+ simgrid::s4u::onPlatformCreated.connect(check_disk_attachment);
instr_routing_define_callbacks();
ROUTING_STORAGE_LEVEL = xbt_lib_add_level(storage_lib, xbt_free_f);
SG_END_DECL()
-namespace simgrid {
-namespace surf {
-
-extern XBT_PRIVATE xbt::signal<void(void)> on_postparse;
-
-}
-}
-
#endif