Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion t/01_torque_install.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ok(defined $qstat, 'Client Tools') or

# version - TORQUE version
my $version = `qstat --version 2>&1`;
$version =~ /^version:\s*([\d.]+)\s*$/i;
$version =~ /Version:\s+(\d+\.\d+\.\d+)/;
$version = $1 || undef;
ok(defined $version, 'TORQUE Version') or
BAIL_OUT('Cannot determine TORQUE version');
Expand Down
7 changes: 5 additions & 2 deletions t/05_serial_jobs.t
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ ok($job =~ /^\d+\S*\s*$/, 'Job Submission') or
BAIL_OUT("Unable to submit job to TORQUE as '$testuser' - see TORQUE docs, Section 2.1");

# Job In Queue
$job =~ s/\D//g;
# shouldn't use global match lest hostname should contain figures
$job =~ s/\d+//;
$job = $&;
sleep 1;
my $qstat = `qstat | grep $job` || undef;
ok(defined $qstat, 'Job in Queue') or
Expand Down Expand Up @@ -60,7 +62,8 @@ ok($running, 'Job Running') or
BAIL_OUT("Submitted job has failed to start within $waittime seconds - check scheduler - see TORQUE docs, Section 5.1");

# Check Output Files
my $remaining = $joblength - $timer + 1;
# giving more remaining time so that output files could have been created
my $remaining = $joblength - $timer + 2;
my $outputfile = "STDIN.o$job";
my $errorfile = "STDIN.e$job";
sleep $remaining if ($remaining > 0);
Expand Down
7 changes: 5 additions & 2 deletions t/06_parallel_jobs.t
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ foreach my $line (split /[\r\n]+/, $pbsnodes)
$nodes{$node} += $1 - 1
if ($line =~ /^\s+np = (\d+)/) and defined $node;
}
map { $proccount += $_ } (values %nodes);
# As far as I know, Torque cann't start a job on every processor when proccount are different among nodes
map { $proccount += 1 } (values %nodes);
ok($proccount, 'Processor Count') or
BAIL_OUT('TORQUE reported 0 processors');

Expand Down Expand Up @@ -64,7 +65,9 @@ sub submit_job ($)
BAIL_OUT("Unable to submit job to TORQUE as '$testuser' - see TORQUE docs, Section 2.1");
ok($job =~ /^\d+\S*\s*$/, 'Job Submission') or
BAIL_OUT("Unable to submit job to TORQUE as '$testuser' - see TORQUE docs, Section 2.1");
$job =~ s/\D//g;
# shouldn't use global match lest hostname should contain figures
$job =~ s/\d+//;
$job = $&;
return $job;
}
#
Expand Down
12 changes: 7 additions & 5 deletions t/07_job_arrays.t
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ SKIP:
if ($line =~ /^\s+np = (\d+)/) and defined $node;
}

map { $proccount += $_ } (values %nodes);
# As far as I know, Torque cann't start a job on every processor when proccount are different among nodes
map { $proccount += 1 } (values %nodes);
$Jobcount = 2 * $proccount;
ok($proccount, 'Processor Count') or
BAIL_OUT('TORQUE reported 0 processors');
Expand All @@ -72,12 +73,13 @@ SKIP:
{
my $walltime = 1.1 * $Joblength;
my $baseid = `su $Testuser -c 'echo "sleep $Joblength" | qsub -k oe -l nodes=1,walltime=$walltime -t 0-$Jobcount'` || undef;
$baseid =~ s/\D//g if defined $baseid;
$baseid =~ s/\d+//;
$baseid = $& if defined $baseid;
ok(defined $baseid, "Job Submission") or
BAIL_OUT("Unable to submit job to TORQUE as '$Testuser' - see TORQUE docs, Section 2.1");
ok($baseid =~ /^\d+\S*\s*$/, "Job Submission") or
BAIL_OUT("Unable to submit job to TORQUE as '$Testuser' - see TORQUE docs, Section 2.1");
@Jobs = map { "$baseid-$_" } (0..$Jobcount);
@Jobs = map { "$baseid\[$_\]" } (0..$Jobcount);
}

# Jobs In Queue
Expand Down Expand Up @@ -177,14 +179,14 @@ sub qstat_info
{
my %data;
# Gather Information
my $qstat = `qstat` || undef;
my $qstat = `qstat -t` || undef;
ok(defined $qstat, 'qstat Results') or
BAIL_OUT('Cannot gather information from qstat');
foreach my $line (split /[\r\n]+/, $qstat)
{
next unless $line =~
/^
(\d+-\d+)\S*\s+ # Job ID
(\d+\[\d+\])\S*\s+ # Job ID
\S+\s+ # Name
\S+\s+ # User
\S+\s+ # Time Use
Expand Down