return -1;
}
+std::string JournalTool::gen_dump_file_path(const std::string &prefix) {
+ if (!all_ranks) {
+ return prefix;
+ }
+
+ return prefix + "." + std::to_string(rank);
+}
+
/**
* Handle arguments for 'journal' mode
*
}
}
+ const std::string dump_path = gen_dump_file_path(output_path);
+
// Execute command
// ===============
JournalScanner js(input, rank, type, filter);
// Generate output
// ===============
- EventOutput output(js, output_path);
+ EventOutput output(js, dump_path);
int output_result = 0;
if (output_style == "binary") {
output_result = output.binary();
if (import) {
r = dumper.undump(path.c_str(), force);
} else {
- r = dumper.dump(path.c_str());
+ const std::string ex_path = gen_dump_file_path(path);
+ r = dumper.dump(ex_path.c_str());
}
}
// Bit hacky, use this `rank` member to control behaviour of the
// various main_ functions.
mds_rank_t rank;
+ // when set, generate per rank dump file path
+ bool all_ranks = false;
std::string type;
//validate type
int validate_type(const std::string &type);
+
+ // generate output file path for dump/export
+ std::string gen_dump_file_path(const std::string &prefix);
public:
static void usage();
JournalTool() :