Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 8ec36c1c authored by Millian Poquet's avatar Millian Poquet
Browse files

[s4u] Engine, config(xbt)

Another attempt to pass Batsim from MSG to s4u.
Trying to make separated commits that compile.

Currently:
- Compiles with upstream SG (722fec866)
- Batexec tests (surprisingly) works.
- Other tests fail.
parent 5e21bb9f
Pipeline #3250 failed with stages
in 5 seconds
......@@ -31,6 +31,7 @@
#include <string>
#include <fstream>
#include <simgrid/s4u.hpp>
#include <simgrid/msg.h>
#include <smpi/smpi.h>
#include <simgrid/plugins/energy.h>
......@@ -540,27 +541,6 @@ void configure_batsim_logging_output(const MainArguments & main_args)
xbt_log_control_set("surf_energy.thresh:critical");
}
void initialize_msg(const MainArguments & main_args, int argc, char * argv[])
{
// Must be initialized before MSG_init
if (main_args.energy_used)
{
sg_host_energy_plugin_init();
}
MSG_init(&argc, argv);
// Setting SimGrid configuration if the SimGrid process tracing is enabled
if (main_args.enable_simgrid_process_tracing)
{
string sg_trace_filename = main_args.export_prefix + "_sg_processes.trace";
MSG_config("tracing", "1");
MSG_config("tracing/msg/process", "1");
MSG_config("tracing/filename", sg_trace_filename.c_str());
}
}
void load_workloads_and_workflows(const MainArguments & main_args, BatsimContext * context, int & max_nb_machines_to_use)
{
int max_nb_machines_in_workloads = -1;
......@@ -694,8 +674,24 @@ int main(int argc, char * argv[])
// Let's configure how Batsim should be logged
configure_batsim_logging_output(main_args);
// Let's initialize SimGrid
initialize_msg(main_args, argc, argv);
// Initialize the energy plugin before creating the engine
if (main_args.energy_used)
{
sg_host_energy_plugin_init();
}
// Instantiate SimGrid
simgrid::s4u::Engine engine(&argc, argv);
// Setting SimGrid configuration if the SimGrid process tracing is enabled
if (main_args.enable_simgrid_process_tracing)
{
string sg_trace_filename = main_args.export_prefix + "_sg_processes.trace";
xbt_cfg_set_as_string("tracing", "1");
xbt_cfg_set_as_string("tracing/msg/process", "1");
xbt_cfg_set_as_string("tracing/filename", sg_trace_filename.c_str());
}
// Let's create the BatsimContext, which stores information about the current instance
BatsimContext context;
......@@ -714,7 +710,7 @@ int main(int argc, char * argv[])
if (!context.smpi_used)
{
XBT_INFO("SMPI will NOT be used.");
MSG_config("host/model", "ptask_L07");
xbt_cfg_set_as_string("host/model", "ptask_L07");
}
else
{
......
......@@ -117,14 +117,6 @@ void parse_main_args(int argc, char * argv[], MainArguments & main_args,
*/
void configure_batsim_logging_output(const MainArguments & main_args);
/**
* @brief Initializes SimGrid
* @param[in] main_args Batsim arguments
* @param[in] argc The number of arguments given to the main function
* @param[in] argv The values of arguments given to the main function
*/
void initialize_msg(const MainArguments & main_args, int argc, char * argv[]);
/**
* @brief Loads the workloads defined in Batsim arguments
* @param[in] main_args Batsim arguments
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment