-/* Copyright (c) 2006-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2006-2018. 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 "simdag_private.hpp"
+#include "simgrid/kernel/resource/Action.hpp"
#include "simgrid/s4u/Engine.hpp"
-#include "simgrid/sg_config.h"
-#include "src/include/instr/instr_interface.h"
+#include "simgrid/sg_config.hpp"
+#include "src/include/instr/instr_interface.hpp"
#include "src/surf/surf_interface.hpp"
XBT_LOG_NEW_CATEGORY(sd, "Logging specific to SimDag");
/* let's see which tasks are done */
for (auto const& model : *all_existing_models) {
- surf_action_t action = surf_model_extract_done_action_set(model);
- while (action != nullptr) {
- SD_task_t task = static_cast<SD_task_t>(action->getData());
+ simgrid::kernel::resource::Action* action = surf_model_extract_done_action_set(model);
+ while (action != nullptr && action->get_data() != nullptr) {
+ SD_task_t task = static_cast<SD_task_t>(action->get_data());
XBT_VERB("Task '%s' done", SD_task_get_name(task));
SD_task_set_state(task, SD_DONE);
/* let's see which tasks have just failed */
action = surf_model_extract_failed_action_set(model);
while (action != nullptr) {
- SD_task_t task = static_cast<SD_task_t>(action->getData());
+ SD_task_t task = static_cast<SD_task_t>(action->get_data());
XBT_VERB("Task '%s' failed", SD_task_get_name(task));
SD_task_set_state(task, SD_FAILED);
sd_global->return_set->insert(task);
surf_init(argc, argv);
- xbt_cfg_setdefault_string("host/model", "ptask_L07");
- if(xbt_cfg_get_boolean("clean-atexit"))
+ simgrid::config::set_default<std::string>("host/model", "ptask_L07");
+ if (simgrid::config::get_value<bool>("clean-atexit"))
atexit(SD_exit);
if (_sg_cfg_exit_asap) {
exit(0);
* Do --help on any simgrid binary to see the list of currently existing configuration variables, and
* see Section @ref options.
*
- * Example: SD_config("host/model","default");
+ * Example: SD_config("host/model","default")
*/
void SD_config(const char *key, const char *value){
xbt_assert(sd_global,"ERROR: Please call SD_init() before using SD_config()");
- xbt_cfg_set_as_string(key, value);
+ simgrid::config::set_as_string(key, value);
}
/**