From 1fae8f51a199bc1414fb025b0c4fcbbd048aecd6 Mon Sep 17 00:00:00 2001
From: Moe Jette <jette1@llnl.gov>
Date: Mon, 29 Nov 2010 16:21:35 +0000
Subject: [PATCH] torque/qstat: fix display of walltime

This fixes the display of Resources_List.walltime in full (-f) mode: despite
non-zero values, it is printed as "00:00:00", because the hash key 'aWDuration'
is not defined there. Use 'time_limit' and convert from minutes to seconds.
Patch from Gerrit.
---
 contribs/torque/qstat.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contribs/torque/qstat.pl b/contribs/torque/qstat.pl
index 55ad9715e75..2a62d86f023 100755
--- a/contribs/torque/qstat.pl
+++ b/contribs/torque/qstat.pl
@@ -527,7 +527,7 @@ sub print_job_full
 	my $user_group = getgrgid($job->{'group_id'});
 	printf("\tegroup = %s(%d)\n", $user_group, $job->{'group_id'});
 
-	printf("\tResource_List.walltime = %s\n", hhmmss($job->{'aWDuration'}));
+	printf("\tResource_List.walltime = %s\n", hhmmss($job->{'time_limit'} * 60));
 	printf("\tResource_List.nodect = %d\n", $job->{'num_nodes'})
 		if $job->{'num_nodes'};
 	printf("\tResource_List.ncpus = %s\n", $job->{'num_procs'})
-- 
GitLab