has
'+infile'
=> (
required
=> 0,
);
has
'all'
=> (
is
=>
'rw'
,
traits
=> [
'Bool'
],
default
=> 0,
isa
=>
'Bool'
,
);
sub
go {
my
$self
=
shift
;
$self
->get_nodes;
foreach
my
$node
(@{
$self
->nodelist}) {
my
$cmd
=
"srun --partition "
.
$self
->partition.
" --nodelist "
.
$node
.
" /home/guests/jir2004/perlmodule/HPC-Runner-Slurm/script/cpus.pl "
;
print
"\n========================================================\n"
;
print
"$cmd\n"
;
print
"Report Node: "
.
$node
.
"Partition: "
.
$self
->partition.
"\n"
;
print
"========================================================\n\n"
;
my
(
$success
,
$error_code
,
$full_buf
,
$stdout_buf
,
$stderr_buf
) =
run(
command
=>
$cmd
,
verbose
=> 0,
timeout
=> 100 );
if
(
$success
) {
print
"this is what the command printed:\n"
;
print
join
""
,
@$full_buf
;
}
else
{
print
"Command was not successful.\n"
;
print
"Error Code: $error_code\n"
;
print
join
(
" "
,
@$full_buf
).
"\n"
;
}
}
}
1;