CONFIG: adjust compile-time value of maxThreadFileBufferSize to 0

- consistent with etc/controlDict default

STYLE: update banner message for collated
This commit is contained in:
Mark Olesen 2023-09-07 14:34:30 +02:00
parent e3b7c2e6ee
commit ff567dbe71
2 changed files with 31 additions and 16 deletions

View File

@ -114,7 +114,7 @@ OptimisationSwitches
// (sized with magnitude of value) is large enough to hold all
// outstanding writes so will not try to initialise the Pstream with
// threading support.
// Default: 1e9
// Default: 0
maxThreadFileBufferSize 0;
//- masterUncollated: non-blocking buffer size.

View File

@ -59,7 +59,7 @@ namespace fileOperations
float collatedFileOperation::maxThreadFileBufferSize
(
debug::floatOptimisationSwitch("maxThreadFileBufferSize", 1e9)
debug::floatOptimisationSwitch("maxThreadFileBufferSize", 0)
);
registerOptSwitch
(
@ -90,26 +90,41 @@ void Foam::fileOperations::collatedFileOperation::printBanner
DetailInfo
<< "I/O : " << this->type();
if (maxThreadFileBufferSize == 0)
{
DetailInfo
<< " [unthreaded] (maxThreadFileBufferSize = 0)." << nl
<< " Writing may be slow for large file sizes."
<< endl;
}
else
if (mag(maxThreadFileBufferSize) > 1)
{
// FUTURE: deprecate or remove threading?
DetailInfo
<< " [threaded] (maxThreadFileBufferSize = "
<< maxThreadFileBufferSize << ")." << nl
<< " Requires buffer large enough to collect all data"
" or thread support" << nl
<< " enabled in MPI. If MPI thread support cannot be"
" enabled, deactivate" << nl
<< " threading by setting maxThreadFileBufferSize"
" to 0 in" << nl
" or MPI thread support." << nl
<< " To avoid MPI threading [slow], set"
" (maxThreadFileBufferSize = 0) in" << nl
<< " OpenFOAM etc/controlDict" << endl;
}
else
{
DetailInfo
<< " [unthreaded] (maxThreadFileBufferSize = 0)." << nl;
if (mag(maxMasterFileBufferSize) < 1)
{
DetailInfo
<< " With scheduled transfer" << nl;
}
else if (maxMasterFileBufferSize >= 1)
{
DetailInfo
<< " With non-blocking transfer,"
" buffer-size = " << maxMasterFileBufferSize << nl;
}
else
{
DetailInfo
<< " With non-blocking transfer,"
" minimal buffer size" << nl;
}
}
if (withRanks)
{
@ -455,7 +470,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
{
// Re-check static maxThreadFileBufferSize variable to see
// if needs to use threading
const bool useThread = (maxThreadFileBufferSize != 0);
const bool useThread = (mag(maxThreadFileBufferSize) > 1);
if (debug)
{