1 /* Copyright (c) 2008-2023. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "simgrid/instr.h"
8 #include "simgrid/s4u.hpp"
10 int main(int argc, char** argv)
12 simgrid::s4u::Engine e(&argc, argv);
13 xbt_assert(argc == 3, "Usage: %s <platform_file.xml> <graphviz_file.dot|graphviz_file.csv>", argv[0]);
15 e.load_platform(argv[1]);
18 const std::string outputfile(argv[2]);
19 const std::string extension = outputfile.substr(outputfile.find_last_of(".") + 1);
20 if(extension == "csv") {
21 printf("Dumping to CSV file\n");
22 simgrid::instr::platform_graph_export_csv(outputfile);
24 else if(extension == "dot") {
25 printf("Dumping to DOT file\n");
26 simgrid::instr::platform_graph_export_graphviz(outputfile);
29 xbt_die("Unknown output file format, please use '.dot' or .csv' extension");