Skip to content
Snippets Groups Projects
Commit ff373afd authored by mattijs's avatar mattijs
Browse files

BUG: codeStream: make sure scatter result is consumed before starting again

parent affda256
Branches
Tags
No related merge requests found
...@@ -206,14 +206,26 @@ Foam::functionEntries::codeStream::getFunction ...@@ -206,14 +206,26 @@ Foam::functionEntries::codeStream::getFunction
off_t masterSize = mySize; off_t masterSize = mySize;
Pstream::scatter(masterSize); Pstream::scatter(masterSize);
if (debug)
{
Pout<< endl<< "on processor " << Pstream::myProcNo()
<< " have masterSize:" << masterSize
<< " and localSize:" << mySize
<< endl;
}
if (mySize < masterSize) if (mySize < masterSize)
{ {
Pout<< "Local file " << libPath if (debug)
<< " not of same size (" << mySize {
<< ") as master (" Pout<< "Local file " << libPath
<< masterSize << "). Waiting for " << " not of same size (" << mySize
<< regIOobject::fileModificationSkew << ") as master ("
<< " seconds." << endl; << masterSize << "). Waiting for "
<< regIOobject::fileModificationSkew
<< " seconds." << endl;
}
Foam::sleep(regIOobject::fileModificationSkew); Foam::sleep(regIOobject::fileModificationSkew);
// Recheck local size // Recheck local size
...@@ -237,6 +249,14 @@ Foam::functionEntries::codeStream::getFunction ...@@ -237,6 +249,14 @@ Foam::functionEntries::codeStream::getFunction
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
if (debug)
{
Pout<< endl<< "on processor " << Pstream::myProcNo()
<< " after waiting: have masterSize:" << masterSize
<< " and localSize:" << mySize
<< endl;
}
} }
if (isA<IOdictionary>(topDict(parentDict))) if (isA<IOdictionary>(topDict(parentDict)))
...@@ -244,6 +264,12 @@ Foam::functionEntries::codeStream::getFunction ...@@ -244,6 +264,12 @@ Foam::functionEntries::codeStream::getFunction
// Cached access to dl libs. Guarantees clean up upon destruction // Cached access to dl libs. Guarantees clean up upon destruction
// of Time. // of Time.
dlLibraryTable& dlLibs = libs(parentDict); dlLibraryTable& dlLibs = libs(parentDict);
if (debug)
{
Pout<< "Opening cached dictionary:" << libPath << endl;
}
if (!dlLibs.open(libPath, false)) if (!dlLibs.open(libPath, false))
{ {
FatalIOErrorIn FatalIOErrorIn
...@@ -261,10 +287,28 @@ Foam::functionEntries::codeStream::getFunction ...@@ -261,10 +287,28 @@ Foam::functionEntries::codeStream::getFunction
else else
{ {
// Uncached opening of libPath // Uncached opening of libPath
if (debug)
{
Pout<< "Opening uncached dictionary:" << libPath << endl;
}
lib = dlOpen(libPath, true); lib = dlOpen(libPath, true);
} }
} }
bool haveLib = lib;
reduce(haveLib, andOp<bool>());
if (!haveLib)
{
FatalIOErrorIn
(
"functionEntries::codeStream::execute(..)",
parentDict
) << "Failed loading library " << libPath
<< " on some processors."
<< exit(FatalIOError);
}
// Find the function handle in the library // Find the function handle in the library
streamingFunctionType function = streamingFunctionType function =
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment