34 namespace fileOperations
59 Foam::labelList Foam::fileOperations::hostCollatedFileOperation::subRanks
64 DynamicList<label> subRanks(64);
66 string ioRanksString(
getEnv(
"FOAM_IORANKS"));
67 if (!ioRanksString.empty())
69 IStringStream is(ioRanksString);
75 <<
"Rank 0 (master) should be in the IO ranks. Currently "
80 PackedBoolList isIOrank(
n);
92 rank <
n && !isIOrank[rank];
105 const string myHostName(
hostName());
115 if (hosts[proci] == myHostName)
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
void append(const T &)
Append an element at the end of the list.
Inter-processor communications stream.
static void scatterList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Scatter data. Reverse of gatherList.
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Inter-processor communications stream.
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
static bool master(const label communicator=0)
Am I the master process.
static label nProcs(const label communicator=0)
Number of processes in parallel run.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
const label comm_
Communicator to use.
Version of masterUncollatedFileOperation that collates regIOobjects into a container in the processor...
static labelList ioRanks()
Version of collatedFileOperation with multiple read/write ranks.
hostCollatedFileOperation(const bool verbose)
Construct null.
virtual ~hostCollatedFileOperation()
Destructor.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
addToRunTimeSelectionTable(fileOperation, collatedFileOperation, word)
defineTypeNameAndDebug(collatedFileOperation, 0)
addNamedToRunTimeSelectionTable(fileOperationInitialise, collatedFileOperationInitialise, word, collated)
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
string getEnv(const word &)
Return environment variable of given name.
pid_t pid()
Return the PID of this process.
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
List< string > stringList
A List of strings.