BUG: collated fails with controlDict watch files
- files might have been set during token reading so only on known on master processor. Broadcast names to all processors (even alhough they are only checked on master) so that the watched states remain synchronised
This commit is contained in:
parent
32386d0b39
commit
09edb23c1d
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
Copyright (C) 2023 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,18 +39,28 @@ using namespace Foam;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::noParallel();
|
||||
argList::addBoolOption("setTime", "Time::setTime(..) for each instance");
|
||||
// timeSelector::addOptions();
|
||||
timeSelector::addOptions(true, true);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
Info<< "Times found:" << runTime.times() << endl;
|
||||
Info<< "Using fileHandler: " << fileHandler().type() << endl;
|
||||
|
||||
#include "createTime.H"
|
||||
|
||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||
|
||||
Info<< "Times selected:" << timeDirs << endl;
|
||||
Pout<< "Times selected:" << timeDirs << endl;
|
||||
|
||||
if (args.found("setTime"))
|
||||
{
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "\nEnd\n" << endl;
|
||||
|
||||
return 0;
|
||||
|
@ -397,6 +397,12 @@ void Foam::Time::setMonitoring(const bool forceProfiling)
|
||||
if (runTimeModifiable_)
|
||||
{
|
||||
// Monitor all files that controlDict depends on
|
||||
// Files might have been set during token reading so only on master
|
||||
// processor. Broadcast names to all processors
|
||||
// (even although they are only checked on master)
|
||||
// so that the watched states are synchronised
|
||||
|
||||
Pstream::broadcast(controlDict_.files(), UPstream::worldComm);
|
||||
fileHandler().addWatches(controlDict_, controlDict_.files());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user