-/* Copyright (c) 2004-2021. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2004-2022. 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 "surf_interface.hpp"
+#include <simgrid/s4u/Engine.hpp>
+#include <xbt/module.h>
+
#include "mc/mc.h"
-#include "simgrid/s4u/Engine.hpp"
#include "simgrid/sg_config.hpp"
#include "src/kernel/resource/profile/FutureEvtSet.hpp"
#include "src/kernel/resource/profile/Profile.hpp"
#include "src/surf/HostImpl.hpp"
-#include "src/surf/xml/platf.hpp"
-#include "surf/surf.hpp"
-#include "xbt/module.h"
-#include "xbt/xbt_modinter.h" /* whether initialization was already done */
+#include "src/surf/surf_interface.hpp"
#include <fstream>
#include <string>
simgrid::kernel::profile::FutureEvtSet future_evt_set;
std::vector<std::string> surf_path;
-/* Don't forget to update the option description in smx_config when you change this */
const std::vector<surf_model_description_t> surf_network_model_description = {
{"LV08",
"Realistic network analytic model (slow-start modeled by multiplying latency by 13.01, bandwidth by .97; "
{"default", "Simplistic disk model.", &surf_disk_model_init_default},
};
-double NOW = 0;
-
-double surf_get_clock()
-{
- return NOW;
-}
-
/* returns whether #file_path is an absolute file path. Surprising, isn't it ? */
static bool is_absolute_file_path(const std::string& file_path)
{
const surf_model_description_t* find_model_description(const std::vector<surf_model_description_t>& table,
const std::string& name)
{
- auto pos = std::find_if(table.begin(), table.end(),
- [&name](const surf_model_description_t& item) { return item.name == name; });
- if (pos != table.end())
+ if (auto pos = std::find_if(table.begin(), table.end(),
+ [&name](const surf_model_description_t& item) { return item.name == name; });
+ pos != table.end())
return &*pos;
std::string sep;
}
xbt_die("Model '%s' is invalid! Valid models are: %s.", name.c_str(), name_list.c_str());
}
-
-void surf_init(int* argc, char** argv)
-{
- if (xbt_initialized > 0)
- return;
-
- xbt_init(argc, argv);
-
- sg_config_init(argc, argv);
-}
-
-void surf_exit()
-{
- simgrid::s4u::Engine::shutdown();
-
- tmgr_finalize();
- sg_platf_exit();
-
- NOW = 0; /* Just in case the user plans to restart the simulation afterward */
-}