aboutsummaryrefslogtreecommitdiff
path: root/utils/submit-grid-jobs
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2020-04-15 12:49:10 -0500
committertlatorre <tlatorre@uchicago.edu>2020-04-15 12:49:10 -0500
commit5505e3ac19fe4f129d8c1906e5a1663af24b3351 (patch)
tree987545ab9642a7eed0fd1304814e03e26fcd5ea2 /utils/submit-grid-jobs
parent1b66f2744b8ebe41ef81ffe8664ea5b37f42c847 (diff)
downloadsddm-5505e3ac19fe4f129d8c1906e5a1663af24b3351.tar.gz
sddm-5505e3ac19fe4f129d8c1906e5a1663af24b3351.tar.bz2
sddm-5505e3ac19fe4f129d8c1906e5a1663af24b3351.zip
update submit-grid-jobs to add a priority column to the database
This commit updates submit-grid-jobs so that jobs are now submitted first in order of priority and then timestamp. So any jobs with a higher priority will be submitted preferentially first, and within each priority level jobs are submitted in the order they are added to the database.
Diffstat (limited to 'utils/submit-grid-jobs')
-rwxr-xr-xutils/submit-grid-jobs5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/submit-grid-jobs b/utils/submit-grid-jobs
index dd44d14..3129532 100755
--- a/utils/submit-grid-jobs
+++ b/utils/submit-grid-jobs
@@ -480,7 +480,7 @@ def get_njobs():
def main(conn, dqxx_dir, max_retries, max_jobs):
c = conn.cursor()
- results = c.execute('SELECT id, filename, run, uuid, gtid, particle_id, max_time, state, nretry, submit_file FROM state')
+ results = c.execute('SELECT id, filename, run, uuid, gtid, particle_id, max_time, state, nretry, submit_file FROM state ORDER BY priority DESC, timestamp ASC')
njobs = get_njobs()
@@ -635,7 +635,8 @@ if __name__ == '__main__':
"nretry INTEGER,"
"submit_file TEXT,"
"max_time REAL NOT NULL,"
- "message TEXT)"
+ "message TEXT,"
+ "priority INTEGER DEFAULT 1)"
)
conn.commit()