Skip to content

Commit 619e32a

Browse files
committed
Output the pvd to the base output dir to help on HPC systems that slow down loading the many files that are in meshes/
1 parent 64b1891 commit 619e32a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/core.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -2414,11 +2414,13 @@ void core::run()
24142414
#else
24152415
int rank = 0;
24162416
#endif
2417+
// write paths that are relative to the pvd file
2418+
boost::filesystem::path vtu_path(output_folder_path.string() + "/meshes/" + p.filename().string()+"_"+std::to_string(rank) + ".vtu");
24172419
pt::ptree &dataset = pvd.add("VTKFile.Collection.DataSet", "");
24182420
dataset.add("<xmlattr>.timestep", _global->posix_time_int());
24192421
dataset.add("<xmlattr>.group", "");
24202422
dataset.add("<xmlattr>.part", rank);
2421-
dataset.add("<xmlattr>.file", p.filename().string()+"_"+std::to_string(rank) + ".vtu");
2423+
dataset.add("<xmlattr>.file", boost::filesystem::relative(vtu_path, output_folder_path).string());
24222424
#ifdef USE_MPI
24232425
}
24242426
}
@@ -2517,7 +2519,9 @@ void core::run()
25172519
{
25182520
#endif
25192521

2520-
pt::write_xml(itr.fname + ".pvd",
2522+
// output the pvd one level higher in the main outdir than we have previously
2523+
boost::filesystem::path path(itr.fname + ".pvd");
2524+
pt::write_xml( (output_folder_path.string() / path.filename()).string(),
25212525
pvd, std::locale(), pt::xml_writer_settings<std::string>(' ', 4));
25222526
break;
25232527

0 commit comments

Comments
 (0)