From 8268d8aaba9fde5e3a532ecc56f1b731517b7647 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Dec 2020 15:42:09 +0000 Subject: [PATCH] BUG: redistributePar: avoid par comms. Fixes #1953 --- .../redistributePar/redistributePar.C | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C index e81ca5ef3d..1d2f5a5a11 100644 --- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C +++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C @@ -2314,6 +2314,19 @@ int main(int argc, char *argv[]) // (replacement for setRootCase that does not abort) argList args(argc, argv); + + + // As much as possible avoid synchronised operation. To be looked at more + // closely for the three scenarios: + // - decompose - reads on master (and from parent directory) and sends + // dictionary to slaves + // - distribute - reads on potentially a different number of processors + // than it writes to + // - reconstruct - reads parallel, write on master only and to parent + // directory + const_cast(fileHandler()).distributed(true); + + #include "foamDlOpenLibs.H" const bool reconstruct = args.found("reconstruct"); @@ -2569,12 +2582,14 @@ int main(int argc, char *argv[]) // See where the mesh is + //const bool oldParRun = Pstream::parRun(false); fileName facesInstance = runTime.findInstance ( meshSubDir, "faces", IOobject::READ_IF_PRESENT ); + //Pstream::parRun(oldParRun); //Pout<< "facesInstance:" << facesInstance << endl; Pstream::scatter(facesInstance); @@ -2941,12 +2956,14 @@ int main(int argc, char *argv[]) runTime.caseName() = baseRunTime.caseName(); } + const bool oldParRun = Pstream::parRun(false); masterInstDir = runTime.findInstance ( meshSubDir, "faces", IOobject::READ_IF_PRESENT ); + Pstream::parRun(oldParRun); if (decompose) {