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:
parent
e3b7c2e6ee
commit
ff567dbe71
@ -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
|
|||||||
|
|
||||||
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
|
|||||||
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
|
|||||||
{
|
{
|
||||||
// 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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user