From 5505e3ac19fe4f129d8c1906e5a1663af24b3351 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Wed, 15 Apr 2020 12:49:10 -0500 Subject: 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. --- utils/submit-grid-jobs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'utils/submit-grid-jobs') 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() -- cgit