aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutils/submit-grid-jobs13
1 files changed, 8 insertions, 5 deletions
diff --git a/utils/submit-grid-jobs b/utils/submit-grid-jobs
index 3129532..85cf59a 100755
--- a/utils/submit-grid-jobs
+++ b/utils/submit-grid-jobs
@@ -216,6 +216,8 @@ request_cpus = 1
request_memory = 1 GB
request_disk = 1 GB
+priority = @priority
+
# Queue one job with the above specifications.
queue 1
@@ -246,7 +248,7 @@ def splitext(path):
return full_root, full_ext
-def create_submit_file(filename, uuid, run, gtid, dir, dqxx_dir, particle_combo, max_time):
+def create_submit_file(filename, uuid, run, gtid, dir, dqxx_dir, particle_combo, max_time, priority):
"""
Creates a submit file and submits a job to the grid.
@@ -292,7 +294,8 @@ def create_submit_file(filename, uuid, run, gtid, dir, dqxx_dir, particle_combo,
transfer_output_files=transfer_output_files,
error=condor_error,
output=condor_output,
- log=condor_log)
+ log=condor_log,
+ priority=priority)
new_dir = "%s_%s" % (root,uuid)
@@ -480,7 +483,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 ORDER BY priority DESC, timestamp ASC')
+ results = c.execute('SELECT id, filename, run, uuid, gtid, particle_id, max_time, state, nretry, submit_file, priority FROM state ORDER BY priority DESC, timestamp ASC')
njobs = get_njobs()
@@ -493,7 +496,7 @@ def main(conn, dqxx_dir, max_retries, max_jobs):
else:
data = []
- for id, filename, run, uuid, gtid, particle_id, max_time, state, nretry, submit_file in results.fetchall():
+ for id, filename, run, uuid, gtid, particle_id, max_time, state, nretry, submit_file, priority in results.fetchall():
if state not in stats:
stats[state] = 1
else:
@@ -505,7 +508,7 @@ def main(conn, dqxx_dir, max_retries, max_jobs):
continue
log.verbose("Creating submit file for %s gtid %i particle combo %i" % (filename, gtid, particle_id))
- submit_file = create_submit_file(filename, uuid, run, gtid, dir, dqxx_dir, particle_id, max_time)
+ submit_file = create_submit_file(filename, uuid, run, gtid, dir, dqxx_dir, particle_id, max_time, priority)
if submit_job(submit_file):
log.warn("Failed to submit job %i: %s" % (id,str(e)))