X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ed37babb2fa9097abe82df299c0aa259ed84d5a..414839787a24ee470f3124f95659a5f6569a2cd5:/src/kernel/resource/profile/ProfileBuilder.cpp diff --git a/src/kernel/resource/profile/ProfileBuilder.cpp b/src/kernel/resource/profile/ProfileBuilder.cpp index bcb0709ce5..83c587d5c3 100644 --- a/src/kernel/resource/profile/ProfileBuilder.cpp +++ b/src/kernel/resource/profile/ProfileBuilder.cpp @@ -7,12 +7,14 @@ #include "simgrid/forward.h" #include "src/kernel/resource/profile/Profile.hpp" #include "src/kernel/resource/profile/StochasticDatedValue.hpp" -#include "src/surf/surf_interface.hpp" +#include "xbt/asserts.h" +#include "xbt/file.hpp" #include #include #include #include +#include #include #include @@ -222,17 +224,18 @@ Profile* ProfileBuilder::from_string(const std::string& name, const std::string& return new Profile(name,cb,cb.get_repeat_delay()); } -Profile* ProfileBuilder::from_file(const std::string& path) +Profile* ProfileBuilder::from_file(const std::string& filename) { - xbt_assert(not path.empty(), "Cannot parse a trace from an empty filename"); - auto f = std::unique_ptr(surf_ifsopen(path)); - xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", path.c_str(), (boost::join(surf_path, ":")).c_str()); + xbt_assert(not filename.empty(), "Cannot parse a trace from an empty filename"); + auto f = std::unique_ptr(simgrid::xbt::path_ifsopen(filename)); + xbt_assert(not f->fail(), "Cannot open file '%s' (path=%s)", filename.c_str(), + simgrid::xbt::path_to_string().c_str()); std::stringstream buffer; buffer << f->rdbuf(); LegacyUpdateCb cb(buffer.str(), -1); - return new Profile(path,cb,cb.get_repeat_delay()); + return new Profile(filename, cb, cb.get_repeat_delay()); }