From 7380f53efbf4903b5229e54d6c3fbe37a80efec9 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Fri, 14 Jul 2017 16:22:23 +0200 Subject: [PATCH] ENH: add infoSwitch to control reporting of slaves/roots (closes #531) - With many processors, the number of entries becomes quite large. New controlDict InfoSwitches: "writeSlaves", "writeRoots". --- etc/controlDict | 15 +++++++++++++-- src/OpenFOAM/global/argList/argList.C | 20 +++++++++++++++++--- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/etc/controlDict b/etc/controlDict index 2b435d1fe4..a30f85c29f 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -35,11 +35,21 @@ Documentation InfoSwitches { + // The default ASCII write precision writePrecision 6; + + // Enable job info writeJobInfo 0; + writeDictionaries 0; writeOptionalEntries 0; + // Report list of slaves/pids used (parallel) + writeSlaves 1; + + // Report list of roots used (parallel) + writeRoots 1; + // Allow profiling allowProfiling 1; @@ -88,10 +98,11 @@ OptimisationSwitches setNaN 0; // Force dumping (at next timestep) upon signal (-1 to disable) - writeNowSignal -1; // 10; + // See 'kill -l' for signal numbers (eg, 10=USR1, 12=USR2) + writeNowSignal -1; // 10; // Force dumping (at next timestep) upon signal (-1 to disable) and exit - stopAtWriteNowSignal -1; + stopAtWriteNowSignal -1; } /* Can specify fallback profiling settings diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index a5092d472e..b3b68fc872 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -885,10 +885,9 @@ void Foam::argList::parse case_ = globalCase_; } - stringList slaveProcs; - // Collect slave machine/pid + // Collect slave machine/pid, and check that the build is identical if (parRunControl_.parRun()) { if (Pstream::master()) @@ -934,6 +933,18 @@ void Foam::argList::parse } } + // Keep or discard slave and root information for reporting: + if (Pstream::master() && parRunControl_.parRun()) + { + if (!debug::infoSwitch("writeSlaves", 1)) + { + slaveProcs.clear(); + } + if (!debug::infoSwitch("writeRoots", 1)) + { + roots.clear(); + } + } if (Pstream::master() && bannerEnabled_) { @@ -942,7 +953,10 @@ void Foam::argList::parse if (parRunControl_.parRun()) { - Info<< "Slaves : " << slaveProcs << nl; + if (slaveProcs.size()) + { + Info<< "Slaves : " << slaveProcs << nl; + } if (roots.size()) { Info<< "Roots : " << roots << nl;