1 #ifndef NODEFILEPARSER_H
2 #define NODEFILEPARSER_H
27 explicit NodeFileParser(
const QString& nodefile=
"",
const QString& gpufile=
"", QObject *parent = 0);
38 void setPaths(
const QString& nodefile=
"",
const QString& gpufile=
"");
62 void createNode(
const QString &name,
int cores=0, QList<int>
gpus = QList<int>());
83 int numProc(
const QString& name);
88 const QMap<QString,int>&
procs();
99 int numGPUs(
const QString& name);
106 int GPUid(
const QString &name,
int i);
112 const QList<int>&
gpus(
const QString& name);
122 const QStringList&
cpus();
155 bool parse(QString &filename,
bool ignoreCores =
false,
bool ignoreGPUs =
true);
160 #endif // NODEFILEPARSER_H
A class to parse the PBS_NODEFILE and PBS_GPUFILE.
Definition: nodefileparser.h:17
friend QDebug operator<<(QDebug dbg, const NodeFileParser &nfp)
operator overload for QDebug
const QString & hostName()
get the hostname of this cpu
void createNode(const QString &name, int cores=0, QList< int > gpus=QList< int >())
add cpu to records
NodeFileParser(const QString &nodefile="", const QString &gpufile="", QObject *parent=0)
create NodeFileParser
int GPUid(const QString &name, int i)
get the ith gpu id on host
void clear()
clear the records
bool parse(QString &filename, bool ignoreCores=false, bool ignoreGPUs=true)
QMap< QString, QList< int > > m_gpus
list of gpu ids per cpu
Definition: nodefileparser.h:137
int numGPUs(const QString &name)
get the number of gpus on host
void setDefault()
set the default based on QThreadPool and hostname
void setHostName()
set the name of this CPU using boost::asio::ip::hostname()
int numCPUs()
get the number of hosts
void setPaths(const QString &nodefile="", const QString &gpufile="")
aquire the paths of the GPUFILE and the NODEFILE and parse them
QString m_nodefile
path to NODEFILE
Definition: nodefileparser.h:140
QStringList m_names
list of cpu names
Definition: nodefileparser.h:131
QString m_hostName
hostname of this computer
Definition: nodefileparser.h:146
int numProc()
get the number of processes on all hosts
const QStringList & cpus()
get the hostnames
QMap< QString, int > m_cores
list of core counts per cpu
Definition: nodefileparser.h:134
const QList< int > & gpus(const QString &name)
get the number of gpus on host
const QMap< QString, int > & procs()
get the number of processes on all hosts
QString m_gpufile
path to GPUFILE
Definition: nodefileparser.h:143
int numGPUS()
get the number of gpus on all hosts