collatedFileOperation.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2018 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "collatedFileOperation.H"
30 #include "Pstream.H"
31 #include "Time.H"
33 #include "decomposedBlockData.H"
34 #include "registerSwitch.H"
35 #include "masterOFstream.H"
36 #include "OFstream.H"
37 
38 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
39 
40 namespace Foam
41 {
42 namespace fileOperations
43 {
44  defineTypeNameAndDebug(collatedFileOperation, 0);
46  (
47  fileOperation,
48  collatedFileOperation,
49  word
50  );
51 
53  (
54  debug::floatOptimisationSwitch("maxThreadFileBufferSize", 1e9)
55  );
57  (
58  "maxThreadFileBufferSize",
59  float,
61  );
62 
63  // Mark as needing threaded mpi
65  (
67  collatedFileOperationInitialise,
68  word,
69  collated
70  );
71 }
72 }
73 
74 
75 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
76 
78 {
80 
81  string ioRanksString(getEnv("FOAM_IORANKS"));
82  if (!ioRanksString.empty())
83  {
84  IStringStream is(ioRanksString);
85  is >> ioRanks;
86  }
87 
88  return ioRanks;
89 }
90 
91 
93 (
94  const label proci
95 )
96 const
97 {
98  if (Pstream::parRun())
99  {
100  return Pstream::master(comm_);
101  }
102  else if (ioRanks_.size())
103  {
104  // Found myself in IO rank
105  return ioRanks_.found(proci);
106  }
107  else
108  {
109  // Assume all in single communicator
110  return proci == 0;
111  }
112 }
113 
114 
116 (
117  const regIOobject& io,
118  const fileName& pathName,
122 ) const
123 {
124  // Append to processors/ file
125 
126  label proci = detectProcessorPath(io.objectPath());
127 
128  if (debug)
129  {
130  Pout<< "collatedFileOperation::writeObject :"
131  << " For local object : " << io.name()
132  << " appending processor " << proci
133  << " data to " << pathName << endl;
134  }
135 
136  if (proci == -1)
137  {
139  << "Not a valid processor path " << pathName
140  << exit(FatalError);
141  }
142 
143  const bool isMaster = isMasterRank(proci);
144 
145  // Determine the local rank if the pathName is a per-rank one
146  label localProci = proci;
147  {
148  fileName path, procDir, local;
149  label groupStart, groupSize, nProcs;
150  splitProcessorPath
151  (
152  pathName,
153  path,
154  procDir,
155  local,
156  groupStart,
157  groupSize,
158  nProcs
159  );
160  if (groupSize > 0 && groupStart != -1)
161  {
162  localProci = proci-groupStart;
163  }
164  }
165 
166 
167  // Create string from all data to write
168  string buf;
169  {
170  OStringStream os(fmt, ver);
171  if (isMaster)
172  {
173  if (!io.writeHeader(os))
174  {
175  return false;
176  }
177  }
178 
179  // Write the data to the Ostream
180  if (!io.writeData(os))
181  {
182  return false;
183  }
184 
185  if (isMaster)
186  {
188  }
189 
190  buf = os.str();
191  }
192 
193 
194  // Note: cannot do append + compression. This is a limitation
195  // of ogzstream (or rather most compressed formats)
196 
197  OFstream os
198  (
199  pathName,
201  ver,
202  IOstream::UNCOMPRESSED, // no compression
203  !isMaster
204  );
205 
206  if (!os.good())
207  {
209  << "Cannot open for appending"
210  << exit(FatalIOError);
211  }
212 
213  if (isMaster)
214  {
216  << "FoamFile\n{\n"
217  << " version " << os.version() << ";\n"
218  << " format " << os.format() << ";\n"
219  << " class " << decomposedBlockData::typeName
220  << ";\n"
221  << " location " << pathName << ";\n"
222  << " object " << pathName.name() << ";\n"
223  << "}" << nl;
224  IOobject::writeDivider(os) << nl;
225  }
226 
227  // Write data
228  UList<char> slice
229  (
230  const_cast<char*>(buf.data()),
231  label(buf.size())
232  );
233  os << nl << "// Processor" << localProci << nl << slice << nl;
234 
235  return os.good();
236 }
237 
238 
239 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
240 
242 (
243  bool verbose
244 )
245 :
247  (
248  (
249  ioRanks().size()
251  (
253  subRanks(Pstream::nProcs())
254  )
256  ),
257  false
258  ),
259  myComm_(comm_),
260  writer_(maxThreadFileBufferSize, comm_),
261  nProcs_(Pstream::nProcs()),
262  ioRanks_(ioRanks())
263 {
264  verbose = (verbose && Foam::infoDetailLevel > 0);
265 
266  if (verbose)
267  {
268  Info<< "I/O : " << typeName
269  << " (maxThreadFileBufferSize " << maxThreadFileBufferSize
270  << ')' << endl;
271 
272  if (maxThreadFileBufferSize == 0)
273  {
274  Info<< " Threading not activated "
275  "since maxThreadFileBufferSize = 0." << nl
276  << " Writing may run slowly for large file sizes."
277  << endl;
278  }
279  else
280  {
281  Info<< " Threading activated "
282  "since maxThreadFileBufferSize > 0." << nl
283  << " Requires large enough buffer to collect all data"
284  " or thread support " << nl
285  << " enabled in MPI. If thread support cannot be "
286  "enabled, deactivate" << nl
287  << " threading by setting maxThreadFileBufferSize "
288  "to 0 in" << nl
289  << " $FOAM_ETC/controlDict"
290  << endl;
291  }
292 
293  if (ioRanks_.size())
294  {
295  // Print a bit of information
296  stringList ioRanks(Pstream::nProcs());
297  if (Pstream::master(comm_))
298  {
299  ioRanks[Pstream::myProcNo()] = hostName()+"."+name(pid());
300  }
301  Pstream::gatherList(ioRanks);
302 
303  Info<< " IO nodes:" << nl;
304  for (const string& ranks : ioRanks)
305  {
306  if (!ranks.empty())
307  {
308  Info<< " " << ranks << nl;
309  }
310  }
311  }
312 
313 
314  if
315  (
318  )
319  {
321  << "Resetting fileModificationChecking to inotify" << endl;
322  }
323 
324  if
325  (
328  )
329  {
331  << "Resetting fileModificationChecking to timeStamp" << endl;
332  }
333  }
334 }
335 
336 
338 (
339  const label comm,
340  const labelList& ioRanks,
341  const word& typeName,
342  bool verbose
343 )
344 :
345  masterUncollatedFileOperation(comm, false),
346  myComm_(-1),
347  writer_(maxThreadFileBufferSize, comm),
348  nProcs_(Pstream::nProcs()),
349  ioRanks_(ioRanks)
350 {
351  verbose = (verbose && Foam::infoDetailLevel > 0);
352 
353  if (verbose)
354  {
355  Info<< "I/O : " << typeName
356  << " (maxThreadFileBufferSize " << maxThreadFileBufferSize
357  << ')' << endl;
358 
359  if (maxThreadFileBufferSize == 0)
360  {
361  Info<< " Threading not activated "
362  "since maxThreadFileBufferSize = 0." << nl
363  << " Writing may run slowly for large file sizes."
364  << endl;
365  }
366  else
367  {
368  Info<< " Threading activated "
369  "since maxThreadFileBufferSize > 0." << nl
370  << " Requires large enough buffer to collect all data"
371  " or thread support " << nl
372  << " enabled in MPI. If thread support cannot be "
373  "enabled, deactivate" << nl
374  << " threading by setting maxThreadFileBufferSize "
375  "to 0 in the OpenFOAM etc/controlDict" << nl
376  << endl;
377  }
378 
379  if
380  (
383  )
384  {
386  << "Resetting fileModificationChecking to inotify" << endl;
387  }
388 
389  if
390  (
393  )
394  {
396  << "Resetting fileModificationChecking to timeStamp" << endl;
397  }
398  }
399 }
400 
401 
402 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
403 
405 {
406  if (myComm_ != -1 && myComm_ != UPstream::worldComm)
407  {
409  }
410 }
411 
412 
413 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
414 
416 (
417  const IOobject& io,
418  const word& typeName
419 ) const
420 {
421  // Replacement for objectPath
422  if (io.time().processorCase())
423  {
425  (
426  io,
428  "dummy", // not used for processorsobject
429  io.instance()
430  );
431  }
432  else
433  {
435  (
436  io,
438  word::null,
439  io.instance()
440  );
441  }
442 }
443 
444 
446 (
447  const regIOobject& io,
451  const bool valid
452 ) const
453 {
454  const Time& tm = io.time();
455  const fileName& inst = io.instance();
456 
457  if (inst.isAbsolute() || !tm.processorCase())
458  {
459  mkDir(io.path());
460  fileName pathName(io.objectPath());
461 
462  if (debug)
463  {
464  Pout<< "collatedFileOperation::writeObject :"
465  << " For object : " << io.name()
466  << " falling back to master-only output to " << io.path()
467  << endl;
468  }
469 
470  masterOFstream os
471  (
472  pathName,
473  fmt,
474  ver,
475  cmp,
476  false,
477  valid
478  );
479 
480  // If any of these fail, return (leave error handling to Ostream class)
481  if (!os.good())
482  {
483  return false;
484  }
485  if (!io.writeHeader(os))
486  {
487  return false;
488  }
489  // Write the data to the Ostream
490  if (!io.writeData(os))
491  {
492  return false;
493  }
495 
496  return true;
497  }
498  else
499  {
500  // Construct the equivalent processors/ directory
501  fileName path(processorsPath(io, inst, processorsDir(io)));
502 
503  mkDir(path);
504  fileName pathName(path/io.name());
505 
506  if (io.global())
507  {
508  if (debug)
509  {
510  Pout<< "collatedFileOperation::writeObject :"
511  << " For global object : " << io.name()
512  << " falling back to master-only output to " << pathName
513  << endl;
514  }
515 
516  masterOFstream os
517  (
518  pathName,
519  fmt,
520  ver,
521  cmp,
522  false,
523  valid
524  );
525 
526  // If any of these fail, return (leave error handling to Ostream
527  // class)
528  if (!os.good())
529  {
530  return false;
531  }
532  if (!io.writeHeader(os))
533  {
534  return false;
535  }
536  // Write the data to the Ostream
537  if (!io.writeData(os))
538  {
539  return false;
540  }
542 
543  return true;
544  }
545  else if (!Pstream::parRun())
546  {
547  // Special path for e.g. decomposePar. Append to
548  // processorsDDD/ file
549  if (debug)
550  {
551  Pout<< "collatedFileOperation::writeObject :"
552  << " For object : " << io.name()
553  << " appending to " << pathName << endl;
554  }
555 
556  return appendObject(io, pathName, fmt, ver, cmp);
557  }
558  else
559  {
560  // Re-check static maxThreadFileBufferSize variable to see
561  // if needs to use threading
562  bool useThread = (maxThreadFileBufferSize > 0);
563 
564  if (debug)
565  {
566  Pout<< "collatedFileOperation::writeObject :"
567  << " For object : " << io.name()
568  << " starting collating output to " << pathName
569  << " useThread:" << useThread << endl;
570  }
571 
572  if (!useThread)
573  {
574  writer_.waitAll();
575  }
576 
578  (
579  writer_,
580  pathName,
581  fmt,
582  ver,
583  cmp,
584  useThread
585  );
586 
587  // If any of these fail, return (leave error handling to Ostream
588  // class)
589  if (!os.good())
590  {
591  return false;
592  }
593  if (Pstream::master(comm_) && !io.writeHeader(os))
594  {
595  return false;
596  }
597  // Write the data to the Ostream
598  if (!io.writeData(os))
599  {
600  return false;
601  }
602  if (Pstream::master(comm_))
603  {
605  }
606 
607  return true;
608  }
609  }
610 }
611 
613 {
614  if (debug)
615  {
616  Pout<< "collatedFileOperation::flush : clearing and waiting for thread"
617  << endl;
618  }
620  // Wait for thread to finish (note: also removes thread)
621  writer_.waitAll();
622 }
623 
624 
626 (
627  const fileName& fName
628 ) const
629 {
630  if (Pstream::parRun())
631  {
632  const List<int>& procs(UPstream::procID(comm_));
633 
634  word procDir(processorsBaseDir+Foam::name(Pstream::nProcs()));
635 
636  if (procs.size() != Pstream::nProcs())
637  {
638  procDir +=
639  + "_"
640  + Foam::name(procs[0])
641  + "-"
642  + Foam::name(procs.last());
643  }
644  return procDir;
645  }
646  else
647  {
648  word procDir(processorsBaseDir+Foam::name(nProcs_));
649 
650  if (ioRanks_.size())
651  {
652  // Detect current processor number
653  label proci = detectProcessorPath(fName);
654 
655  if (proci != -1)
656  {
657  // Find lowest io rank
658  label minProc = 0;
659  label maxProc = nProcs_-1;
660  forAll(ioRanks_, i)
661  {
662  if (ioRanks_[i] >= nProcs_)
663  {
664  break;
665  }
666  else if (ioRanks_[i] <= proci)
667  {
668  minProc = ioRanks_[i];
669  }
670  else
671  {
672  maxProc = ioRanks_[i]-1;
673  break;
674  }
675  }
676  procDir +=
677  + "_"
678  + Foam::name(minProc)
679  + "-"
680  + Foam::name(maxProc);
681  }
682  }
683 
684  return procDir;
685  }
686 }
687 
688 
690 (
691  const IOobject& io
692 ) const
693 {
694  return processorsDir(io.objectPath());
695 }
696 
697 
699 {
700  nProcs_ = nProcs;
701 
702  if (debug)
703  {
704  Pout<< "collatedFileOperation::setNProcs :"
705  << " Setting number of processors to " << nProcs_ << endl;
706  }
707 }
708 
709 
710 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::IOstreamOption::UNCOMPRESSED
compression = false
Definition: IOstreamOption.H:73
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
collatedFileOperation.H
Foam::fileOperations::collatedFileOperation::maxThreadFileBufferSize
static float maxThreadFileBufferSize
Max size of thread buffer size. This is the overall size of.
Definition: collatedFileOperation.H:114
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::IOobject::name
const word & name() const
Return name.
Definition: IOobjectI.H:46
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileOperations::collatedFileOperation::~collatedFileOperation
virtual ~collatedFileOperation()
Destructor.
Definition: collatedFileOperation.C:404
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileOperations::collatedFileOperation::ioRanks
static labelList ioRanks()
Definition: collatedFileOperation.C:77
Foam::fileOperations::collatedFileOperation::processorsDir
virtual word processorsDir(const IOobject &) const
Actual name of processors dir.
Definition: collatedFileOperation.C:690
Foam::IOobject::writeBanner
static Ostream & writeBanner(Ostream &os, bool noHint=false)
Write the standard OpenFOAM file/dictionary banner.
Definition: IOobjectWriteHeader.C:45
Foam::IOobject::writeEndDivider
static Ostream & writeEndDivider(Ostream &os)
Write the standard end file divider.
Definition: IOobjectWriteHeader.C:109
Foam::regIOobject::writeData
virtual bool writeData(Ostream &) const =0
Pure virtual writeData function.
masterOFstream.H
Foam::IOobject::instance
const fileName & instance() const
Definition: IOobjectI.H:167
Foam::UPstream::nProcs
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:426
Foam::fileName::name
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Definition: fileNameI.H:209
Foam::IOobject::inotifyMaster
Definition: IOobject.H:139
Foam::UPstream::parRun
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:414
Foam::IOobject::timeStampMaster
Definition: IOobject.H:137
Foam::IOobject::fileModificationChecking
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Definition: IOobject.H:207
Foam::IOstreamOption::format
streamFormat format() const noexcept
Get the current stream format.
Definition: IOstreamOption.H:273
Foam::regIOobject::global
virtual bool global() const
Is object global.
Definition: regIOobject.H:313
Foam::fileOperations::addNamedToRunTimeSelectionTable
addNamedToRunTimeSelectionTable(fileOperationInitialise, collatedFileOperationInitialise, word, collated)
Foam::FatalIOError
IOerror FatalIOError
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::Pout
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
Foam::IOobject::time
const Time & time() const
Return time.
Definition: IOobject.C:438
Foam::getEnv
string getEnv(const std::string &envName)
Get environment value for given envName.
Definition: MSwindows.C:371
Foam::fileOperations::collatedFileOperation::objectPath
virtual fileName objectPath(const IOobject &io, const word &typeName) const
Generate disk file name for object. Opposite of filePath.
Definition: collatedFileOperation.C:416
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:290
OFstream.H
Foam::fileOperations::registerOptSwitch
registerOptSwitch("maxThreadFileBufferSize", float, collatedFileOperation::maxThreadFileBufferSize)
Foam::UPstream::allocateCommunicator
static label allocateCommunicator(const label parent, const labelList &subRanks, const bool doPstream=true)
Allocate a new communicator.
Definition: UPstream.C:100
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::IOstreamOption::versionNumber
Representation of a major/minor version number.
Definition: IOstreamOption.H:79
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::pid
pid_t pid()
Return the PID of this process.
Definition: MSwindows.C:330
Foam::fileOperations::collatedFileOperation::appendObject
bool appendObject(const regIOobject &io, const fileName &pathName, IOstream::streamFormat fmt, IOstream::versionNumber ver, IOstream::compressionType cmp) const
Append to processors/ file.
Definition: collatedFileOperation.C:116
Foam::fileOperations::addToRunTimeSelectionTable
addToRunTimeSelectionTable(fileOperation, collatedFileOperation, word)
Foam::fileOperations::collatedFileOperation::setNProcs
virtual void setNProcs(const label nProcs)
Set number of processor directories/results. Only used in.
Definition: collatedFileOperation.C:698
Foam::UPstream::procID
static List< int > & procID(label communicator)
Process ID of given process index.
Definition: UPstream.H:455
Foam::UPstream::freeCommunicator
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
Definition: UPstream.C:166
Foam::fileOperations::collatedFileOperation::isMasterRank
bool isMasterRank(const label proci) const
Is proci master of communicator (in parallel) or master of.
Definition: collatedFileOperation.C:93
Foam::IOstreamOption::version
versionNumber version() const noexcept
Get the stream version.
Definition: IOstreamOption.H:321
Foam::IOstreamOption::streamFormat
streamFormat
Data format (ascii | binary)
Definition: IOstreamOption.H:64
Foam::threadedCollatedOFstream
Master-only drop-in replacement for OFstream.
Definition: threadedCollatedOFstream.H:52
threadedCollatedOFstream.H
Foam::FatalError
error FatalError
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Pstream.H
Foam::IStringStream
Input from string buffer, using a ISstream.
Definition: StringStream.H:112
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
fileOperationInitialise
Foam::infoDetailLevel
int infoDetailLevel
Global for selective suppression of Info output.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::OFstream
Output to file stream, using an OSstream.
Definition: OFstream.H:99
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:444
Foam::UPstream::master
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:438
Foam::Detail::StringStreamAllocator::str
Foam::string str() const
Get the string - as Foam::string rather than std::string.
Definition: StringStream.H:92
Foam::fileOperations::collatedFileOperation::writeObject
virtual bool writeObject(const regIOobject &, IOstream::streamFormat format=IOstream::ASCII, IOstream::versionNumber version=IOstream::currentVersion, IOstream::compressionType compression=IOstream::UNCOMPRESSED, const bool valid=true) const
Writes a regIOobject (so header, contents and divider).
Definition: collatedFileOperation.C:446
Time.H
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:67
Foam::fileOperations::masterUncollatedFileOperation::flush
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
Definition: masterUncollatedFileOperation.C:2573
Foam::fileOperations::masterUncollatedFileOperation
fileOperations that performs all file operations on the master processor. Requires the calls to be pa...
Definition: masterUncollatedFileOperation.H:85
Foam::IOstreamOption::BINARY
"binary"
Definition: IOstreamOption.H:67
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
Foam::Pstream::gatherList
static void gatherList(const List< commsStruct > &comms, List< T > &Values, const int tag, const label comm)
Gather data but keep individual values separate.
Definition: gatherScatterList.C:52
Foam::debug::floatOptimisationSwitch
float floatOptimisationSwitch(const char *name, const float deflt=0)
Lookup optimisation switch or add default value.
Definition: debug.C:243
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::IOobject::writeDivider
static Ostream & writeDivider(Ostream &os)
Write the standard file section divider.
Definition: IOobjectWriteHeader.C:99
decomposedBlockData.H
Foam::UPstream::worldComm
static label worldComm
Default communicator (all processors)
Definition: UPstream.H:285
Foam::List< label >
Foam::OStringStream
Output to string buffer, using a OSstream.
Definition: StringStream.H:189
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::hostName
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
Definition: MSwindows.C:410
path
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::fileOperation::PROCOBJECT
Definition: fileOperation.H:89
Foam::fileOperations::masterUncollatedFileOperation::localObjectPath
fileName localObjectPath(const IOobject &, const pathType &searchType, const word &processorsDir, const word &instancePath) const
Construct filePath.
Definition: masterUncollatedFileOperation.C:335
Foam::IOstreamOption::compressionType
compressionType
Compression treatment (UNCOMPRESSED | COMPRESSED)
Definition: IOstreamOption.H:71
Foam::IOobject::writeHeader
bool writeHeader(Ostream &os) const
Write header.
Definition: IOobjectWriteHeader.C:156
FatalIOErrorInFunction
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:375
registerSwitch.H
Foam::fileOperations::collatedFileOperation::collatedFileOperation
collatedFileOperation(bool verbose)
Construct null.
Definition: collatedFileOperation.C:242
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:216
Foam::IOobject::objectPath
fileName objectPath() const
The complete path + object name.
Definition: IOobjectI.H:185
Foam::TimePaths::processorCase
bool processorCase() const
Return true if this is a processor case.
Definition: TimePathsI.H:36
Foam::mkDir
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: MSwindows.C:507
Foam::fileOperation::OBJECT
Definition: fileOperation.H:84
Foam::IOobject::path
fileName path() const
The complete path.
Definition: IOobject.C:456
Foam::fileOperations::collatedFileOperation::flush
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
Definition: collatedFileOperation.C:612
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:294
Foam::fileName::isAbsolute
static bool isAbsolute(const std::string &str)
Return true if string starts with a '/'.
Definition: fileNameI.H:136
Foam::masterOFstream
Master-only drop-in replacement for OFstream.
Definition: masterOFstream.H:50
Foam::fileOperations::defineTypeNameAndDebug
defineTypeNameAndDebug(collatedFileOperation, 0)