Skip to content
Snippets Groups Projects
Commit 0ab278b3 authored by David Bigagli's avatar David Bigagli
Browse files

Revert "Fix bjobs and bsub."

This reverts commit 2d13e016.
parent a40f7200
No related branches found
No related tags found
No related merge requests found
......@@ -92,7 +92,7 @@ sub _print_job_brief
_shrink_char(\$job->{'nodes'}, 11);
_shrink_char(\$job->{'name'}, 10);
printf("\n%-7.7s %-7.7s %-5.5s %-10.10s %-11.11s %-11.11s %-10s %-12.12s",
printf("\n%-7.7s %-7.7s %-5.5s %-10.10s %-11.11s %-11.11s %-10s %-12.12s\n",
$job->{'job_id'}, $job->{'user_name'},
$job->{'job_state_str'},
$job->{'partition'}, $job->{'alloc_node'}, $job->{'nodes'},
......@@ -164,9 +164,7 @@ foreach my $job (@{$resp->{job_array}}) {
}
if (!$line) {
print "No unfinished job found\n";
} else {
print "\n";
print "No unfinished job found\n";
}
exit 0;
......
......@@ -143,8 +143,16 @@ if (!$script) {
}
}
if (_check_script($script)) {
$command = $base_command = "$sbatch";
} else {
$command = $base_command = "$srun";
$command = $base_command = "$sbatch";
# We need to find out the jobid we got
$command .= " -v";
$interactive = 1;
}
$command .= " -e $err_path" if $err_path;
$command .= " -o $out_path" if $out_path;
......@@ -278,6 +286,19 @@ sub _parse_procs {
}
}
sub _check_script {
my ($script) = @_;
if (open (my $file, "<$script")) {
my $first_line = <$file>;
close $file;
return ($first_line =~ /\#!/);
}
return "";
}
sub _parse_node_list {
my ($node_string) = @_;
my $hostlist = "";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment