(
qx(which sbatch)
)
? (
tests
=> 5)
: (
skip_all
=>
"SLURM not available on this system"
);
$ENV
{PATH} =
"$FindBin::Bin/../bin:$ENV{PATH}"
;
-d
'scratch'
or
mkdir
'scratch'
;
my
$cluster
=
'SLURM'
;
{
my
$group
= HPCI->group(
cluster
=>
$cluster
,
base_dir
=>
'scratch'
,
name
=>
'T_Submission'
);
my
$grpdir
=
$group
->group_dir;
my
$num_jobs
= 3;
foreach
my
$i
( 0 ..
$num_jobs
) {
$group
->stage(
command
=>
"echo 'yo, $i' >$grpdir/testfile$i.txt"
,
name
=>
"otherjob$i"
,
);
}
my
$results
=
$group
->execute();
my
$cnt
= 0;
while
(
my
(
$name
,
$stats
) =
each
%$results
) {
like(
$name
,
qr{^otherjob\d$}
,
"result $name matches"
);
++
$cnt
;
}
is(
$cnt
,
$num_jobs
+ 1,
'Number of finished jobs is correct'
);
}
done_testing();