Go to the documentation of this file.
51 string baseDir =
getEnv(
"FOAM_JOB_DIR");
54 fileName runningDir(baseDir/
"runningJobs");
55 fileName finishedDir(baseDir/
"finishedJobs");
63 <<
"Cannot get JobInfo directory $FOAM_JOB_DIR"
70 <<
"Cannot make JobInfo directory " << runningDir
74 if (!
isDir(finishedDir) && !
mkDir(finishedDir))
77 <<
"Cannot make JobInfo directory " << finishedDir
92 mv(runningJobPath_, finishedJobPath_);
129 <<
"Failed to write to JobInfo file "
141 add(
"cpuTime", cpuTime_.elapsedCpuTime());
145 if (!
found(
"termination"))
147 add(
"termination", terminationType);
180 mv(runningJobPath_, finishedJobPath_);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Helper class for recording information about run/finished jobs.
A class for handling words, derived from string.
A class for handling file names.
const fileName & name() const
Return the dictionary name.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
int infoSwitch(const char *name, const int defaultValue=0)
Lookup info switch or add default value.
static string date()
Return the current wall-clock date as a string.
fileName finishedJobPath_
bool mv(const fileName &src, const fileName &dst)
Rename src to dst.
static string clockTime()
Return the current wall-clock time as a string.
PID_T pid()
Return the PID of this process.
string getEnv(const word &)
Return environment variable of given name.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
bool isDir(const fileName &)
Does the name exist as a DIRECTORY in the file system?
errorManipArg< error, int > exit(error &err, const int errNo=1)
static bool master(const label communicator=0)
Am I the master process.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
string hostName(const bool full=false)
Return the system's host name, as per hostname(1)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool good() const
Return true if next operation might succeed.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
word name(const complex &)
Return a string representation of a complex.
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.