ENH: collated: switch off threading by default. See also #659.

This commit is contained in:
mattijs
2017-12-11 13:50:31 +00:00
parent fd4782f754
commit 4408ec20b4
2 changed files with 11 additions and 5 deletions

View File

@ -81,13 +81,13 @@ OptimisationSwitches
//- collated: thread buffer size for queued file writes.
// If set to 0 or not sufficient for the file size threading is not used.
// Default: 2e9
maxThreadFileBufferSize 2e9;
// Default: 1e9
maxThreadFileBufferSize 0;
//- masterUncollated: non-blocking buffer size.
// If the file exceeds this buffer size scheduled transfer is used.
// Default: 2e9
maxMasterFileBufferSize 2e9;
// Default: 1e9
maxMasterFileBufferSize 1e9;
commsType nonBlocking; //scheduled; //blocking;
floatTransfer 0;

View File

@ -30,6 +30,7 @@ License
#include "SubList.H"
#include "allReduce.H"
#include "int.H"
#include "collatedFileOperation.H"
#include <mpi.h>
@ -128,12 +129,17 @@ bool Foam::UPstream::init(int& argc, char**& argv)
//MPI_Init(&argc, &argv);
int wanted_thread_support = MPI_THREAD_SINGLE;
if (fileOperations::collatedFileOperation::maxThreadFileBufferSize > 0)
{
wanted_thread_support = MPI_THREAD_MULTIPLE;
}
int provided_thread_support;
MPI_Init_thread
(
&argc,
&argv,
MPI_THREAD_MULTIPLE,
wanted_thread_support,
&provided_thread_support
);