X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/b024b9e443552c94609fc56a240cdb199a329853..510c97d4c651c63ef9851a7e1d9c328f62b5b00b:/src/instr/instr_config.cpp diff --git a/src/instr/instr_config.cpp b/src/instr/instr_config.cpp index c6cdff7c5f..415e3baa95 100644 --- a/src/instr/instr_config.cpp +++ b/src/instr/instr_config.cpp @@ -4,6 +4,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "include/xbt/config.hpp" +#include "simgrid/Exception.hpp" #include "simgrid/s4u/Engine.hpp" #include "src/instr/instr_private.hpp" #include "surf/surf.hpp" @@ -103,7 +104,9 @@ static void TRACE_start() std::string filename = TRACE_get_filename(); tracing_file.open(filename.c_str(), std::ofstream::out); if (tracing_file.fail()) { - THROWF(system_error, 1, "Tracefile %s could not be opened for writing.", filename.c_str()); + throw simgrid::TracingError( + XBT_THROW_POINT, + simgrid::xbt::string_printf("Tracefile %s could not be opened for writing.", filename.c_str())); } XBT_DEBUG("Filename %s is open for writing", filename.c_str()); @@ -301,15 +304,15 @@ static void print_line(const char* option, const char* desc, const char* longdes std::string str = std::string("--cfg=") + option + " "; int len = str.size(); - printf("%s%*.*s %s\n", str.c_str(), 30 - len, 30 - len, "", desc); + XBT_HELP("%s%*.*s %s", str.c_str(), 30 - len, 30 - len, "", desc); if (longdesc != nullptr) { - printf ("%s\n\n", longdesc); + XBT_HELP("%s\n", longdesc); } } void TRACE_help() { - printf("Description of the tracing options accepted by this simulator:\n\n"); + XBT_HELP("Description of the tracing options accepted by this simulator:\n"); print_line(OPT_TRACING_SMPI, "Trace the MPI Interface (SMPI)", " This option only has effect if this simulator is SMPI-based. Traces the MPI\n" " interface and generates a trace that can be analyzed using Gantt-like\n"