From 34a6a87c8e100183d265083be21dcaf54c78dd39 Mon Sep 17 00:00:00 2001 From: Mark Date: Thu, 20 May 2021 14:24:09 +0300 Subject: [PATCH] Added vntype --- etc/create-tables.mysql | 1 + etc/create-tables.sqlite | 1 + src/python/pbsacct/__init__.py | 12 ++++++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/etc/create-tables.mysql b/etc/create-tables.mysql index 725a716..668dd59 100644 --- a/etc/create-tables.mysql +++ b/etc/create-tables.mysql @@ -7,6 +7,7 @@ CREATE TABLE Jobs ( groupname VARCHAR(32), account VARCHAR(32), submithost VARCHAR(32), + vntype VARCHAR(32), jobname TINYTEXT, nproc INT UNSIGNED DEFAULT 1, mppe INT UNSIGNED, diff --git a/etc/create-tables.sqlite b/etc/create-tables.sqlite index 477898a..d6de9c7 100644 --- a/etc/create-tables.sqlite +++ b/etc/create-tables.sqlite @@ -5,6 +5,7 @@ CREATE TABLE Jobs ( groupname VARCHAR(32), account VARCHAR(32), submithost VARCHAR(32), + vntype VARCHAR(32), jobname TINYTEXT, nproc INT UNSIGNED DEFAULT 1, mppe INT UNSIGNED, diff --git a/src/python/pbsacct/__init__.py b/src/python/pbsacct/__init__.py index aeb5483..230ad90 100644 --- a/src/python/pbsacct/__init__.py +++ b/src/python/pbsacct/__init__.py @@ -5,6 +5,7 @@ # Copyright 2016, 2017, 2018 Ohio Supercomputer Center # Authors: Aaron Maharry # Troy Baer +# Mark Glants # # License: GNU GPL v2, see ../COPYING for details. @@ -107,6 +108,8 @@ def __repr__(self): output += "\tngpus = %d\n" % self.num_gpus() if ( self.feature() is not None ): output += "\tfeature = %s\n" % self.feature() + if ( self.vntype() is not None ): + output += "\tvntype = %s\n" % self.vntype() if ( self.gattr() is not None ): output += "\tgattr = %s\n" % self.gattr() if ( self.gres() is not None ): @@ -415,7 +418,8 @@ def num_gpus(self): def feature(self): return self.get_resource("Resource_List.feature") - + def vntype(self): + return self.get_resource("Resource_List.vntype") def gattr(self): return self.get_resource("Resource_List.gattr") @@ -542,6 +546,7 @@ def __init__(self,methodName='runTest'): 'Resource_List.walltime': '1:00:00', 'Resource_List.mem': '1GB', 'Resource_List.vmem': '1GB', + 'Resource_List.vntype': 'cray_compute', 'resources_used.cput': '00:00:02', 'resources_used.walltime': '00:00:01', 'resources_used.mem': '1024kb', @@ -1227,6 +1232,9 @@ def _job_set_fields(self,job,system=None,oldjob=None,append_to_jobid=None): if ( job.feature() is not None and ( oldjob is None or job.feature()!=oldjob.feature() ) ): fields_to_set["feature"] = "'%s'" % job.feature() + if ( job.vntype() is not None and + ( oldjob is None or job.vntype()!=oldjob.vntype() ) ): + fields_to_set["vntype"] = "'%s'" % job.vntype() if ( job.gattr() is not None and ( oldjob is None or job.gattr()!=oldjob.gattr() ) ): fields_to_set["gattr"] = "'%s'" % job.gattr() @@ -1580,4 +1588,4 @@ def get_job(self,jobid,noop=False,append_to_jobid=None): if __name__ == "__main__": unittest.main() #import glob - #print str(jobs_from_files(glob.glob("/users/sysp/amaharry/acct-data/201603*"))) + #print str(jobs_from_files(glob.glob("/users/sysp/amaharry/acct-data/201603*"))) \ No newline at end of file