- * If path!=NULL, load a trace file containing actions, and execute them.
+ * If path!=nullptr, load a trace file containing actions, and execute them.
* Else, assume that each process gets the path in its deployment file
*/
msg_error_t MSG_action_trace_run(char *path)
{
* Else, assume that each process gets the path in its deployment file
*/
msg_error_t MSG_action_trace_run(char *path)
{
- msg_error_t res;
- char *name;
- xbt_dynar_t todo;
- xbt_dict_cursor_t cursor;
-
- xbt_action_fp=NULL;
if (path) {
if (path) {
- xbt_action_fp = fopen(path, "r");
- xbt_assert(xbt_action_fp != NULL, "Cannot open %s: %s",
- path, strerror(errno));
+ simgrid::xbt::action_fs = new std::ifstream(path, std::ifstream::in);
}
}
- res = MSG_main();
- if (!xbt_dict_is_empty(xbt_action_queues)) {
- XBT_WARN
- ("Not all actions got consumed. If the simulation ended successfully (without deadlock), you may want to add new processes to your deployment file.");
+ msg_error_t res = MSG_main();
+ if (not simgrid::xbt::action_queues.empty()) {
+ XBT_WARN("Not all actions got consumed. If the simulation ended successfully (without deadlock),"
+ " you may want to add new processes to your deployment file.");