Stop creating file outside output_dir for parallel runs.

Only the root process did set the output_dir correctly. Others
used the default. Therefore all messages logged by non-root
processes did end up in the current directory even if an
output_dir was passed to flow_mpi.
This commit is contained in:
Markus Blatt
2016-09-15 21:42:14 +02:00
parent 61a28cf12f
commit c5fd95affe

View File

@@ -339,10 +339,14 @@ namespace Opm
{
// Write parameters used for later reference. (only if rank is zero)
output_to_files_ = output_cout_ && param_.getDefault("output", true);
// Always read output_dir as it will be set unconditionally later.
// Not doing this might cause files to be created in the current
// directory.
output_dir_ =
param_.getDefault("output_dir", std::string("."));
if (output_to_files_) {
// Create output directory if needed.
output_dir_ =
param_.getDefault("output_dir", std::string("."));
boost::filesystem::path fpath(output_dir_);
if (!is_directory(fpath)) {
try {