13using json = nlohmann::json;
33 os <<
"numranks " << numranks <<
";" << std::endl;
45 myfile.open(
filename.c_str(), std::ios::out | std::ios::app);
47 myfile.open(
filename.c_str(), std::ios::out);
55 std::cerr <<
"error: missing result file definition of " << this->filename <<
" for writing" << std::endl;
65 filename = args_info->
getValue<std::string>(
"vizfilename") + std::to_string(rank) +
".out";
76 os <<
"osend " << rank
94 os <<
"orecv " << rank
111 std::stringstream os;
112 os <<
"loclop " << rank
129 std::stringstream os;
130 os <<
"transmission " << source
164 std::map<std::string, DisCosTiC_Indextype>
arc;
170 this->filename = args_info->
getValue<std::string>(
"chromevizfilename") + std::to_string(
rank - 1) +
".dms";
174 this->rank =
rank - 1;
177 ofs <<
"{ \"traceEvents\": [\n";
187 auto it =
arc.find(args_name);
199 std::string duration, std::string color)
204 js[
"dur"] = duration;
207 js[
"ts"] = json::parse(
time);
226 js[
"ts"] = json::parse(
time);
243 js[
"ts"] = json::parse(
time);
261 js[
"tid"] = source_tid;
262 js[
"ts"] = json::parse(
time);
280 js[
"tid"] = dest_tid;
281 js[
"ts"] = json::parse(
time);
290 if (
ofs.is_open() && this->rank != -1)
293 {
"name",
"thread_name"},
297 {
"args", {{
"name",
"CPU" + std::to_string(this->rank)}}}};
299 ofs << std::setw(4) << j2 <<
"," << std::endl;
std::size_t DisCosTiC_Indextype
std::size_t DisCosTiC_Datatype
nlohmann::json json
< JSON for Modern C++ version 2.1.1
void flowEventEnd(std::string name, DisCosTiC_Indextype dest, DisCosTiC_Indextype dest_tid, std::string time, DisCosTiC_Indextype index)
void durationEventBegin(std::string name, DisCosTiC_Indextype rank, DisCosTiC_Indextype tid, std::string time)
void args(std::string args_name, DisCosTiC_Indextype rank)
DisCosTiC_Indextype numRanks
void completeEvents(std::string name, DisCosTiC_Indextype rank, DisCosTiC_Indextype tid, std::string time, std::string duration, std::string color)
void durationEventEnd(std::string name, DisCosTiC_Indextype rank, DisCosTiC_Indextype tid, std::string time)
std::map< std::string, DisCosTiC_Indextype > arc
ChromeTraceViz(UserInterface::ConfigParser *args_info, DisCosTiC_Datatype rank, DisCosTiC_Datatype numRanks)
DisCosTiC_Indextype max_rank_id
DisCosTiC_Indextype max_tid
void flowEventBegin(std::string name, DisCosTiC_Indextype source, DisCosTiC_Indextype source_tid, std::string time, DisCosTiC_Indextype index)
a wrapper class which contains functions for parsing the configuration file end class configParser
scalarT getValue(const std::string &key, scalarT const &defaultValue=scalarT()) const
a function that retrieves the value of a specific key
TimeRankOP(UserInterface::ConfigParser *args_info, DisCosTiC_Datatype rank, int totalrank)
constructor that initializes the coordinates
void orecv(DisCosTiC_Datatype rank, DisCosTiC_Datatype start, DisCosTiC_Datatype end, DisCosTiC_Datatype cpu, float r=0.0, float g=0.0, float b=1.0)
print time taken by overhead at receiver side to output file
void osend(DisCosTiC_Datatype rank, DisCosTiC_Datatype start, DisCosTiC_Datatype end, DisCosTiC_Datatype cpu, float r=0.0, float g=0.0, float b=1.0)
print time taken by overhead at sender side to output file
void comp(DisCosTiC_Datatype rank, DisCosTiC_Datatype start, DisCosTiC_Datatype end, DisCosTiC_Datatype cpu, float r=1.0, float g=0.0, float b=0.0)
print time taken by execution to output file
void ranknum(DisCosTiC_Datatype numranks)
print number of processes to output file
void msg(DisCosTiC_Datatype source, DisCosTiC_Datatype dest, DisCosTiC_Datatype starttime, DisCosTiC_Datatype endtime, DisCosTiC_Datatype size, DisCosTiC_Datatype G, float r=0.0, float g=0.0, float b=1.0)
print time taken by message transmission to output file
std::string content
private variables
void file_write(bool append)
print all events (i.e., osend, orecv, execution, msg transmission) to output file
#define AppendString(str, content)
append a string
it parses the user-defined configuration file (.cfg)