mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: codeStream: make sure scatter result is consumed before starting again
This commit is contained in:
@ -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
|
|||||||
<< 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
|
|||||||
// 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
|
|||||||
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 =
|
||||||
|
|||||||
Reference in New Issue
Block a user