Skip to content

Commit 339720d

Browse files
committed
Qstat & QA submission updates.
1 parent adb71d5 commit 339720d

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed

service-scripts/p3x-qstat.pl

+18-3
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ =head1 DESCRIPTION
4646
["compute-node|N=s\@" => "Limit results to the given compute node", { default => [] }],
4747
["slurm" => "Interpret job IDs as Slurm job IDs"],
4848
["count" => "Print a count of matching records only"],
49+
["sort-by-ram" => "Sort by memory used"],
4950
["n-jobs|n=i" => "Limit to the given number of jobs", { default => 50 } ],
51+
["show-inactive-jobs" => "Include inactive cluster jobs"],
5052
["parsable" => "Generate tab-delimited output"],
5153
["no-header" => "Skip printing header"],
5254
["help|h" => "Show this help message."],
@@ -58,7 +60,7 @@ =head1 DESCRIPTION
5860
my $dbh = DBI->connect("dbi:mysql:" . sched_db_name . ";host=" . sched_db_host . ";port=$port",
5961
sched_db_user, sched_db_pass);
6062
$dbh or die "Cannot connect to database: " . $DBI::errstr;
61-
$dbh->do(qq(SET time_zone = "+00:00"));
63+
# $dbh->do(qq(SET time_zone = "+00:00"));
6264

6365

6466
#
@@ -132,6 +134,10 @@ =head1 DESCRIPTION
132134
}
133135

134136
my @sort = ('t.submit_time DESC');
137+
if ($opt->sort_by_ram)
138+
{
139+
unshift(@sort, 'cj.maxrss DESC');
140+
}
135141
my $sort = join(", ", @sort);
136142

137143
my @ids;
@@ -195,7 +201,10 @@ =head1 DESCRIPTION
195201
push(@conds, "$field IN ($vals)");
196202
}
197203

198-
push(@conds, "te.active = 1 or te.active IS NULL");
204+
if (!$opt->show_inactive_jobs)
205+
{
206+
push(@conds, "te.active = 1 or te.active IS NULL");
207+
}
199208

200209
my $cond = join(" AND ", map { "($_)" } @conds);
201210

@@ -231,7 +240,7 @@ =head1 DESCRIPTION
231240
IF(finish_time != DEFAULT(finish_time) AND start_time != DEFAULT(start_time), timediff(finish_time, start_time), '') as elap,
232241
t.output_path, t.output_file, t.params,
233242
t.req_memory, t.req_cpu, t.req_runtime, t.user_metadata,
234-
cj.job_id, cj.job_status, cj.maxrss, cj.cluster_id, cj.nodelist
243+
cj.job_id, cj.job_status, cj.maxrss, cj.cluster_id, cj.nodelist, te.active
235244
$full_condition
236245
ORDER BY $sort
237246
$limit
@@ -283,6 +292,11 @@ =head1 DESCRIPTION
283292
push(@cols, { title => "User metadata" });
284293
}
285294

295+
if ($opt->show_inactive_jobs)
296+
{
297+
push(@cols, { title => "Cjob active" });
298+
}
299+
286300
push(@cols, map { { title => $_ } } @{$opt->show_parameter});
287301
push(@cols, map { { title => $_ } } @{$opt->show_count});
288302

@@ -374,6 +388,7 @@ =head1 DESCRIPTION
374388
push(@row, $task->{output_file}) if $opt->show_output_file;
375389
push(@row, $task->{output_path}) if $opt->show_output_path;
376390
push(@row, $task->{user_metadata}) if $opt->show_user_metadata;
391+
push(@row, $task->{active}) if $opt->show_inactive_jobs;
377392

378393
for my $p (@{$opt->show_parameter})
379394
{

service-scripts/p3x-run-qa.pl

+12-1
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,18 @@ sub submit_job
290290
push(@cmd, '--reservation', $opt->reservation) if $opt->reservation;
291291
push(@cmd, '--constraint', $opt->constraint) if $opt->constraint;
292292
push(@cmd, "--user-metadata", $opt->user_metadata) if $opt->user_metadata;
293-
push(@cmd, "--preflight", $_) foreach @{$opt->preflight};
293+
294+
#
295+
# Hack
296+
#
297+
my @preflight = @{$opt->preflight};
298+
299+
if ($app eq 'MetagenomeBinning')
300+
{
301+
@preflight = ("memory=48000", "runtime=21600");
302+
}
303+
304+
push(@cmd, "--preflight", $_) foreach @preflight;
294305
push(@cmd, $app, $params);
295306

296307
my $out;

0 commit comments

Comments
 (0)