Skip to content

Commit e6ce260

Browse files
authored
Histor created all processors 329 (SimVascular#330)
* Change file name. * Add check for master process to open histor.dat file.
1 parent 98a6982 commit e6ce260

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Code/Source/solver/initialize.cpp

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,21 @@ void initialize(Simulation* simulation, Vector<double>& timeP)
328328
dmsg.banner();
329329
#endif
330330

331-
std::string hist_file_name;
331+
// Setup logging to history file.
332+
if (!simulation->com_mod.cm.slv(simulation->cm_mod)) {
333+
std::string hist_file_name;
332334

333-
if (chnl_mod.appPath != "") {
334-
auto mkdir_arg = std::string("mkdir -p ") + chnl_mod.appPath;
335-
std::system(mkdir_arg.c_str());
336-
hist_file_name = chnl_mod.appPath + "/" + simulation->history_file_name;
337-
} else {
338-
hist_file_name = simulation->history_file_name;
339-
}
335+
if (chnl_mod.appPath != "") {
336+
auto mkdir_arg = std::string("mkdir -p ") + chnl_mod.appPath;
337+
std::system(mkdir_arg.c_str());
338+
hist_file_name = chnl_mod.appPath + "/" + simulation->history_file_name;
339+
} else {
340+
hist_file_name = simulation->history_file_name;
341+
}
340342

341-
// Setup logging to history file.
342-
bool output_to_cout = true;
343-
simulation->logger.initialize(hist_file_name, output_to_cout);
343+
bool output_to_cout = true;
344+
simulation->logger.initialize(hist_file_name, output_to_cout);
345+
}
344346

345347
#ifdef debug_initialize
346348
dmsg << "Set time " << std::endl;

0 commit comments

Comments
 (0)