#include <iostream>
#include <stdexcept>
#include <unistd.h>
-#include <msg/msg.h>
+#include <simgrid/msg.h>
#include <xbt/log.h>
// Creates log categories
#include "misc.h"
#include "options.h"
#include "process.h"
+#include "simgrid_features.h"
#include "statistics.h"
#include "synchro.h"
#include "timer.h"
action.sa_handler = signal_handler;
sigemptyset(&action.sa_mask);
action.sa_flags = SA_RESTART;
- if (sigaction(SIGINT, &action, NULL) == -1) {
+ if (sigaction(SIGINT, &action, nullptr) == -1) {
std::cerr << "ERROR: sigaction: " << strerror(errno) << "\n";
exit(EXIT_FAILURE_OTHER);
}
{
int exit_status = 0; // global exit status
double simulated_time = -1.0;
- timestamp elapsed_time(timestamp::wallclock_time);
- timestamp simulation_time(timestamp::cpu_time);
- MSG_error_t res;
+ timestamp elapsed_time(timestamp::clock_type::WALLCLOCK);
+ timestamp simulation_time(timestamp::clock_type::CPU);
+ msg_error_t res;
elapsed_time.start();
simulation_time.start();
}
// Initialize some MSG internal data.
- MSG_global_init(&argc, argv);
+ MSG_init(&argc, argv);
install_signal_handler();
// Parse global parameters
"Compiled on " << version::date << "\n\n";
if (!parse_res || opt::help_requested)
opt::usage();
- MSG_clean();
exit(parse_res ? EXIT_NO_FAILURE : EXIT_FAILURE_ARGS);
}
XBT_INFO("%s v%s (%s)", opt::program_name.c_str(), version::num.c_str(),
simulated_time = MSG_get_clock();
XBT_INFO("Simulation ended at %f.", simulated_time);
- process::set_proc_mutex(NULL);
+ process::set_proc_mutex(nullptr);
delete proc_cond;
delete proc_mutex;
// Clean the MSG simulation.
hostdata::destroy();
- res = MSG_clean();
- if (res != MSG_OK) {
- XBT_ERROR("MSG_clean() failed with status %#x", res);
- exit_status |= EXIT_FAILURE_CLEAN;
- }
// Report final simulation status.
if (simulated_time >= 0.0) {