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  Copyright (C) 2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "collatedFileOperation.H"
31 #include "Pstream.H"
32 #include "Time.H"
34 #include "decomposedBlockData.H"
35 #include "registerSwitch.H"
36 #include "masterOFstream.H"
37 #include "OFstream.H"
38 #include "foamVersion.H"
39 
40 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
41 
42 namespace Foam
43 {
44 namespace fileOperations
45 {
46  defineTypeNameAndDebug(collatedFileOperation, 0);
48  (
49  fileOperation,
50  collatedFileOperation,
51  word
52  );
53 
55  (
56  debug::floatOptimisationSwitch("maxThreadFileBufferSize", 1e9)
57  );
59  (
60  "maxThreadFileBufferSize",
61  float,
63  );
64 
65  // Mark as needing threaded mpi
67  (
69  collatedFileOperationInitialise,
70  word,
71  collated
72  );
73 }
74 }
75 
76 
77 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
78 
80 {
82 
83  string ioRanksString(getEnv("FOAM_IORANKS"));
84  if (!ioRanksString.empty())
85  {
86  IStringStream is(ioRanksString);
87  is >> ioRanks;
88  }
89 
90  return ioRanks;
91 }
92 
93 
95 (
96  const label proci
97 )
98 const
99 {
100  if (Pstream::parRun())
101  {
102  return Pstream::master(comm_);
103  }
104  else if (ioRanks_.size())
105  {
106  // Found myself in IO rank
107  return ioRanks_.found(proci);
108  }
109  else
110  {
111  // Assume all in single communicator
112  return proci == 0;
113  }
114 }
115 
116 
118 (
119  const regIOobject& io,
120  const fileName& pathName,
121  IOstreamOption streamOpt
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(streamOpt.format(), streamOpt.version());
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,
200  IOstreamOption(IOstream::BINARY, streamOpt.version()), // UNCOMPRESSED
201  !isMaster // append slaves
202  );
203 
204  if (!os.good())
205  {
207  << "Cannot open for appending"
208  << exit(FatalIOError);
209  }
210 
211  if (isMaster)
212  {
214  << "FoamFile\n{\n"
215  << " version " << os.version() << ";\n"
216  << " format " << os.format() << ";\n"
217  << " class " << decomposedBlockData::typeName
218  << ";\n";
219 
220  // This may be useful to have as well
221  if (os.format() == IOstream::BINARY)
222  {
223  os << " arch " << foamVersion::buildArch << ";\n";
224  }
225 
226  os << " location " << pathName << ";\n"
227  << " object " << pathName.name() << ";\n"
228  << "}" << nl;
229  IOobject::writeDivider(os) << nl;
230  }
231 
232  // Write data
233  UList<char> slice
234  (
235  const_cast<char*>(buf.data()),
236  label(buf.size())
237  );
238  os << nl << "// Processor" << localProci << nl << slice << nl;
239 
240  return os.good();
241 }
242 
243 
244 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
245 
247 (
248  bool verbose
249 )
250 :
252  (
253  (
254  ioRanks().size()
256  (
258  subRanks(Pstream::nProcs())
259  )
261  ),
262  false
263  ),
264  myComm_(comm_),
265  writer_(maxThreadFileBufferSize, comm_),
266  nProcs_(Pstream::nProcs()),
267  ioRanks_(ioRanks())
268 {
269  verbose = (verbose && Foam::infoDetailLevel > 0);
270 
271  if (verbose)
272  {
273  DetailInfo
274  << "I/O : " << typeName
275  << " (maxThreadFileBufferSize " << maxThreadFileBufferSize
276  << ')' << endl;
277 
278  if (maxThreadFileBufferSize == 0)
279  {
280  DetailInfo
281  << " Threading not activated "
282  "since maxThreadFileBufferSize = 0." << nl
283  << " Writing may run slowly for large file sizes."
284  << endl;
285  }
286  else
287  {
288  DetailInfo
289  << " Threading activated "
290  "since maxThreadFileBufferSize > 0." << nl
291  << " Requires large enough buffer to collect all data"
292  " or thread support " << nl
293  << " enabled in MPI. If thread support cannot be "
294  "enabled, deactivate" << nl
295  << " threading by setting maxThreadFileBufferSize "
296  "to 0 in" << nl
297  << " OpenFOAM etc/controlDict"
298  << endl;
299  }
300 
301  if (ioRanks_.size())
302  {
303  // Print a bit of information
304  stringList ioRanks(Pstream::nProcs());
305  if (Pstream::master(comm_))
306  {
307  ioRanks[Pstream::myProcNo()] = hostName()+"."+name(pid());
308  }
309  Pstream::gatherList(ioRanks);
310 
311  DetailInfo
312  << " IO nodes:" << nl;
313 
314  for (const string& ranks : ioRanks)
315  {
316  if (!ranks.empty())
317  {
318  DetailInfo
319  << " " << ranks << nl;
320  }
321  }
322  }
323 
324 
325  if
326  (
329  )
330  {
332  << "Resetting fileModificationChecking to inotify" << endl;
333  }
334 
335  if
336  (
339  )
340  {
342  << "Resetting fileModificationChecking to timeStamp" << endl;
343  }
344  }
345 }
346 
347 
349 (
350  const label comm,
351  const labelList& ioRanks,
352  const word& typeName,
353  bool verbose
354 )
355 :
356  masterUncollatedFileOperation(comm, false),
357  myComm_(-1),
358  writer_(maxThreadFileBufferSize, comm),
359  nProcs_(Pstream::nProcs()),
360  ioRanks_(ioRanks)
361 {
362  verbose = (verbose && Foam::infoDetailLevel > 0);
363 
364  if (verbose)
365  {
366  DetailInfo
367  << "I/O : " << typeName
368  << " (maxThreadFileBufferSize " << maxThreadFileBufferSize
369  << ')' << endl;
370 
371  if (maxThreadFileBufferSize == 0)
372  {
373  DetailInfo
374  << " Threading not activated "
375  "since maxThreadFileBufferSize = 0." << nl
376  << " Writing may run slowly for large file sizes."
377  << endl;
378  }
379  else
380  {
381  DetailInfo
382  << " Threading activated "
383  "since maxThreadFileBufferSize > 0." << nl
384  << " Requires large enough buffer to collect all data"
385  " or thread support " << nl
386  << " enabled in MPI. If thread support cannot be "
387  "enabled, deactivate" << nl
388  << " threading by setting maxThreadFileBufferSize "
389  "to 0 in the OpenFOAM etc/controlDict" << nl
390  << endl;
391  }
392 
393  if
394  (
397  )
398  {
400  << "Resetting fileModificationChecking to inotify" << endl;
401  }
402 
403  if
404  (
407  )
408  {
410  << "Resetting fileModificationChecking to timeStamp" << endl;
411  }
412  }
413 }
414 
415 
416 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
417 
419 {
420  if (myComm_ != -1 && myComm_ != UPstream::worldComm)
421  {
423  }
424 }
425 
426 
427 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
428 
430 (
431  const IOobject& io,
432  const word& typeName
433 ) const
434 {
435  // Replacement for objectPath
436  if (io.time().processorCase())
437  {
439  (
440  io,
442  "dummy", // not used for processorsobject
443  io.instance()
444  );
445  }
446  else
447  {
449  (
450  io,
452  word::null,
453  io.instance()
454  );
455  }
456 }
457 
458 
460 (
461  const regIOobject& io,
462  IOstreamOption streamOpt,
463  const bool valid
464 ) const
465 {
466  const Time& tm = io.time();
467  const fileName& inst = io.instance();
468 
469  if (inst.isAbsolute() || !tm.processorCase())
470  {
471  mkDir(io.path());
472  fileName pathName(io.objectPath());
473 
474  if (debug)
475  {
476  Pout<< "collatedFileOperation::writeObject :"
477  << " For object : " << io.name()
478  << " falling back to master-only output to " << io.path()
479  << endl;
480  }
481 
482  masterOFstream os
483  (
484  pathName,
485  streamOpt,
486  false, // append=false
487  valid
488  );
489 
490  // If any of these fail, return (leave error handling to Ostream class)
491  if (!os.good())
492  {
493  return false;
494  }
495  if (!io.writeHeader(os))
496  {
497  return false;
498  }
499  // Write the data to the Ostream
500  if (!io.writeData(os))
501  {
502  return false;
503  }
505 
506  return true;
507  }
508  else
509  {
510  // Construct the equivalent processors/ directory
511  fileName path(processorsPath(io, inst, processorsDir(io)));
512 
513  mkDir(path);
514  fileName pathName(path/io.name());
515 
516  if (io.global())
517  {
518  if (debug)
519  {
520  Pout<< "collatedFileOperation::writeObject :"
521  << " For global object : " << io.name()
522  << " falling back to master-only output to " << pathName
523  << endl;
524  }
525 
526  masterOFstream os
527  (
528  pathName,
529  streamOpt,
530  false, // append=false
531  valid
532  );
533 
534  // If any of these fail, return (leave error handling to Ostream
535  // class)
536  if (!os.good())
537  {
538  return false;
539  }
540  if (!io.writeHeader(os))
541  {
542  return false;
543  }
544  // Write the data to the Ostream
545  if (!io.writeData(os))
546  {
547  return false;
548  }
550 
551  return true;
552  }
553  else if (!Pstream::parRun())
554  {
555  // Special path for e.g. decomposePar. Append to
556  // processorsDDD/ file
557  if (debug)
558  {
559  Pout<< "collatedFileOperation::writeObject :"
560  << " For object : " << io.name()
561  << " appending to " << pathName << endl;
562  }
563 
564  return appendObject(io, pathName, streamOpt);
565  }
566  else
567  {
568  // Re-check static maxThreadFileBufferSize variable to see
569  // if needs to use threading
570  bool useThread = (maxThreadFileBufferSize > 0);
571 
572  if (debug)
573  {
574  Pout<< "collatedFileOperation::writeObject :"
575  << " For object : " << io.name()
576  << " starting collating output to " << pathName
577  << " useThread:" << useThread << endl;
578  }
579 
580  if (!useThread)
581  {
582  writer_.waitAll();
583  }
584 
586  (
587  writer_,
588  pathName,
589  streamOpt,
590  useThread
591  );
592 
593  // If any of these fail, return (leave error handling to Ostream
594  // class)
595  if (!os.good())
596  {
597  return false;
598  }
599  if (Pstream::master(comm_) && !io.writeHeader(os))
600  {
601  return false;
602  }
603  // Write the data to the Ostream
604  if (!io.writeData(os))
605  {
606  return false;
607  }
608  if (Pstream::master(comm_))
609  {
611  }
612 
613  return true;
614  }
615  }
616 }
617 
619 {
620  if (debug)
621  {
622  Pout<< "collatedFileOperation::flush : clearing and waiting for thread"
623  << endl;
624  }
626  // Wait for thread to finish (note: also removes thread)
627  writer_.waitAll();
628 }
629 
630 
632 (
633  const fileName& fName
634 ) const
635 {
636  if (Pstream::parRun())
637  {
638  const List<int>& procs(UPstream::procID(comm_));
639 
640  word procDir(processorsBaseDir+Foam::name(Pstream::nProcs()));
641 
642  if (procs.size() != Pstream::nProcs())
643  {
644  procDir +=
645  + "_"
646  + Foam::name(procs[0])
647  + "-"
648  + Foam::name(procs.last());
649  }
650  return procDir;
651  }
652  else
653  {
654  word procDir(processorsBaseDir+Foam::name(nProcs_));
655 
656  if (ioRanks_.size())
657  {
658  // Detect current processor number
659  label proci = detectProcessorPath(fName);
660 
661  if (proci != -1)
662  {
663  // Find lowest io rank
664  label minProc = 0;
665  label maxProc = nProcs_-1;
666  forAll(ioRanks_, i)
667  {
668  if (ioRanks_[i] >= nProcs_)
669  {
670  break;
671  }
672  else if (ioRanks_[i] <= proci)
673  {
674  minProc = ioRanks_[i];
675  }
676  else
677  {
678  maxProc = ioRanks_[i]-1;
679  break;
680  }
681  }
682  procDir +=
683  + "_"
684  + Foam::name(minProc)
685  + "-"
686  + Foam::name(maxProc);
687  }
688  }
689 
690  return procDir;
691  }
692 }
693 
694 
696 (
697  const IOobject& io
698 ) const
699 {
700  return processorsDir(io.objectPath());
701 }
702 
703 
705 {
706  nProcs_ = nProcs;
707 
708  if (debug)
709  {
710  Pout<< "collatedFileOperation::setNProcs :"
711  << " Setting number of processors to " << nProcs_ << endl;
712  }
713 }
714 
715 
716 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
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:112
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:70
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:418
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::fileOperations::collatedFileOperation::ioRanks
static labelList ioRanks()
Definition: collatedFileOperation.C:79
Foam::fileOperations::collatedFileOperation::processorsDir
virtual word processorsDir(const IOobject &) const
Actual name of processors dir.
Definition: collatedFileOperation.C:696
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:191
Foam::UPstream::nProcs
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:427
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:415
Foam::IOobject::timeStampMaster
Definition: IOobject.H:137
Foam::IOobject::fileModificationChecking
static fileCheckTypes fileModificationChecking
Type of file modification checking.
Definition: IOobject.H:211
Foam::IOstreamOption::format
streamFormat format() const noexcept
Get the current stream format.
Definition: IOstreamOption.H:289
Foam::regIOobject::global
virtual bool global() const
Is object global.
Definition: regIOobject.H:336
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:350
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:449
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:430
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
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::fileOperations::collatedFileOperation::appendObject
bool appendObject(const regIOobject &io, const fileName &pathName, IOstreamOption streamOpt) const
Append to processors/ file.
Definition: collatedFileOperation.C:118
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::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:704
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::UPstream::procID
static List< int > & procID(label communicator)
Process ID of given process index.
Definition: UPstream.H:456
Foam::UPstream::freeCommunicator
static void freeCommunicator(const label communicator, const bool doPstream=true)
Free a previously allocated communicator.
Definition: UPstream.C:166
DetailInfo
#define DetailInfo
Definition: evalEntry.C:36
Foam::fileOperations::collatedFileOperation::isMasterRank
bool isMasterRank(const label proci) const
Is proci master of communicator (in parallel) or master of.
Definition: collatedFileOperation.C:95
Foam::fileOperations::collatedFileOperation::writeObject
virtual bool writeObject(const regIOobject &, IOstreamOption streamOpt=IOstreamOption(), const bool valid=true) const
Writes a regIOobject (so header, contents and divider).
Definition: collatedFileOperation.C:460
Foam::IOstreamOption::version
versionNumber version() const noexcept
Get the stream version.
Definition: IOstreamOption.H:341
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:111
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:87
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:445
Foam::UPstream::master
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:439
Time.H
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:68
Foam::fileOperations::masterUncollatedFileOperation::flush
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
Definition: masterUncollatedFileOperation.C:2486
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:73
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:372
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:385
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:196
Foam::foamVersion::buildArch
const std::string buildArch
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:91
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::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:392
registerSwitch.H
Foam::fileOperations::collatedFileOperation::collatedFileOperation
collatedFileOperation(bool verbose)
Construct null.
Definition: collatedFileOperation.C:247
Foam::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:224
Foam::IOobject::objectPath
fileName objectPath() const
The complete path + object name.
Definition: IOobjectI.H:209
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:86
Foam::IOobject::path
fileName path() const
The complete path.
Definition: IOobject.C:467
Foam::fileOperations::collatedFileOperation::flush
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
Definition: collatedFileOperation.C:618
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:298
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:51
Foam::fileOperations::defineTypeNameAndDebug
defineTypeNameAndDebug(collatedFileOperation, 0)
foamVersion.H