X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/59ac2881c249eebacf32dd1c9cc6885408bdb95e..9451efc97c14403a6f030ce37a2269b2b9491b7e:/src/surf/trace_mgr.cpp diff --git a/src/surf/trace_mgr.cpp b/src/surf/trace_mgr.cpp index a67c7d437c..f100e2e1a0 100644 --- a/src/surf/trace_mgr.cpp +++ b/src/surf/trace_mgr.cpp @@ -1,11 +1,10 @@ -/* Copyright (c) 2004-2005, 2007, 2009-2014. The SimGrid Team. +/* Copyright (c) 2004-2005, 2007, 2009-2014, 2016-2017. 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 "xbt/sysdep.h" -#include "xbt/dict.h" #include "xbt/log.h" #include "xbt/str.h" @@ -16,8 +15,8 @@ #include #include #include +#include #include -#include #include #include @@ -77,7 +76,7 @@ tmgr_trace_t tmgr_trace_new_from_string(const char* name, std::string input, dou continue; if (sscanf(val.c_str(), "PERIODICITY %lg\n", &periodicity) == 1) continue; - if (sscanf(val.c_str(), "WAITFOR %lg\n", &periodicity) == 1) + if (sscanf(val.c_str(), "LOOPAFTER %lg\n", &periodicity) == 1) continue; xbt_assert(sscanf(val.c_str(), "%lg %lg\n", &event.date_, &event.value_) == 2, "%s:%d: Syntax error in trace\n%s", @@ -110,7 +109,7 @@ tmgr_trace_t tmgr_trace_new_from_file(const char *filename) xbt_assert(trace_list.find(filename) == trace_list.end(), "Refusing to define trace %s twice", filename); std::ifstream* f = surf_ifsopen(filename); - xbt_assert(!f->fail(), "Cannot open file '%s' (path=%s)", filename, (boost::join(surf_path, ":")).c_str()); + xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", filename, (boost::join(surf_path, ":")).c_str()); std::stringstream buffer; buffer << f->rdbuf(); @@ -182,6 +181,7 @@ void tmgr_finalize() xbt_free((char*)kv.first); delete kv.second; } + trace_list.clear(); } void tmgr_trace_event_unref(tmgr_trace_event_t* trace_event)