Skip to content
Snippets Groups Projects
Commit ff567dbe authored by Mark OLESEN's avatar Mark OLESEN
Browse files

CONFIG: adjust compile-time value of maxThreadFileBufferSize to 0

- consistent with etc/controlDict default

STYLE: update banner message for collated
parent e3b7c2e6
Branches
Tags
1 merge request!695OpenFOAM v2406
...@@ -114,7 +114,7 @@ OptimisationSwitches ...@@ -114,7 +114,7 @@ OptimisationSwitches
// (sized with magnitude of value) is large enough to hold all // (sized with magnitude of value) is large enough to hold all
// outstanding writes so will not try to initialise the Pstream with // outstanding writes so will not try to initialise the Pstream with
// threading support. // threading support.
// Default: 1e9 // Default: 0
maxThreadFileBufferSize 0; maxThreadFileBufferSize 0;
//- masterUncollated: non-blocking buffer size. //- masterUncollated: non-blocking buffer size.
......
...@@ -59,7 +59,7 @@ namespace fileOperations ...@@ -59,7 +59,7 @@ namespace fileOperations
float collatedFileOperation::maxThreadFileBufferSize float collatedFileOperation::maxThreadFileBufferSize
( (
debug::floatOptimisationSwitch("maxThreadFileBufferSize", 1e9) debug::floatOptimisationSwitch("maxThreadFileBufferSize", 0)
); );
registerOptSwitch registerOptSwitch
( (
...@@ -90,26 +90,41 @@ void Foam::fileOperations::collatedFileOperation::printBanner ...@@ -90,26 +90,41 @@ void Foam::fileOperations::collatedFileOperation::printBanner
DetailInfo DetailInfo
<< "I/O : " << this->type(); << "I/O : " << this->type();
if (maxThreadFileBufferSize == 0) if (mag(maxThreadFileBufferSize) > 1)
{
DetailInfo
<< " [unthreaded] (maxThreadFileBufferSize = 0)." << nl
<< " Writing may be slow for large file sizes."
<< endl;
}
else
{ {
// FUTURE: deprecate or remove threading?
DetailInfo DetailInfo
<< " [threaded] (maxThreadFileBufferSize = " << " [threaded] (maxThreadFileBufferSize = "
<< maxThreadFileBufferSize << ")." << nl << maxThreadFileBufferSize << ")." << nl
<< " Requires buffer large enough to collect all data" << " Requires buffer large enough to collect all data"
" or thread support" << nl " or MPI thread support." << nl
<< " enabled in MPI. If MPI thread support cannot be" << " To avoid MPI threading [slow], set"
" enabled, deactivate" << nl " (maxThreadFileBufferSize = 0) in" << nl
<< " threading by setting maxThreadFileBufferSize"
" to 0 in" << nl
<< " OpenFOAM etc/controlDict" << endl; << " 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) if (withRanks)
{ {
...@@ -455,7 +470,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject ...@@ -455,7 +470,7 @@ bool Foam::fileOperations::collatedFileOperation::writeObject
{ {
// Re-check static maxThreadFileBufferSize variable to see // Re-check static maxThreadFileBufferSize variable to see
// if needs to use threading // if needs to use threading
const bool useThread = (maxThreadFileBufferSize != 0); const bool useThread = (mag(maxThreadFileBufferSize) > 1);
if (debug) if (debug)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment