Go to the documentation of this file.
39 #ifndef FOAM_RESOURCE_USER_CONFIG_DIRNAME
40 #define FOAM_RESOURCE_USER_CONFIG_DIRNAME ".OpenFOAM"
42 #warning FOAM_RESOURCE_USER_CONFIG_DIRNAME was undefined (now ".OpenFOAM")
65 <<
"WARNING: no JobInfo directory: " << dir <<
nl
66 <<
" disabling JobInfo" <<
nl;
119 void Foam::JobInfo::jobEnding()
121 if (!running_.empty())
135 void Foam::JobInfo::jobEnding(
const word& terminationType)
137 if (writeJobInfo && !finished_.empty())
139 add(
"cpuTime", cpuTime_.elapsedCpuTime());
143 if (!terminationType.empty() && !
found(
"termination"))
145 add(
"termination", terminationType);
149 OFstream
os(finished_);
153 <<
"WARNING: could not write JobInfo file: "
171 <<
"WARNING: JobInfo was already constructed. "
172 "Should be a singleton!!" <<
nl;
184 running_ = jobDir/
"runningJobs"/jobFile;
185 finished_ = jobDir/
"finishedJobs"/jobFile;
216 if (writeJobInfo && !running_.empty())
222 <<
"WARNING: could not write JobInfo file: "
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, acts like global singleton.
const fileName & name() const noexcept
A class for handling file names.
static bool master(const label communicator=worldComm)
bool rm(const fileName &file)
static bool ensureJobDirExists(const fileName &dir)
string getEnv(const std::string &envName)
bool good() const noexcept
static void disable() noexcept
int infoSwitch(const char *name, const int deflt=0)
void writeEntries(Ostream &os, const bool extraNewLine=false) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
OBJstream os(runTime.globalPath()/outputName)
static std::string date()
static bool writeJobDict(Ostream &os, const dictionary &dict)
Output to file stream, using an OSstream.
#define FOAM_RESOURCE_USER_CONFIG_DIRNAME
string hostName(bool full=false)
static std::string clockTime()
word name(const expressions::valueTypeCode typeCode)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool mkDir(const fileName &pathName, mode_t mode=0777)
bool isDir(const fileName &name, const bool followLink=true)