This commit is contained in:
2021-11-06 17:28:23 +01:00
parent bd53e2886e
commit 94f7f54f9a

View File

@@ -135,15 +135,12 @@ sub matlabCalc {
#print $ENV{"HOME"} . "\n"; #print $ENV{"HOME"} . "\n";
$ENV{"HOME"} = "/" . $ENV{"HOME"}; $ENV{"HOME"} = "/" . $ENV{"HOME"};
#chdir($matlab_func_dir) chdir($matlab_func_dir)
# or die "cannot change: $!\n"; or die "cannot change: $!\n";
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> current dir: $matlab_func_dir\n"; . " - pid $$ >> current dir: $matlab_func_dir\n";
my @args = ( my $args = "timeout $matlab_timeout $matlab_cmd $matlab_rt $unit $tool";
'cd', $matlab_func_dir, '; timeout', $matlab_timeout, if ( system($args) != 0 ) {
$matlab_cmd, $matlab_rt, $unit, $tool
);
if ( system(@args) != 0 ) {
open( my $fh, '<', $MatlabErrorFilename ) open( my $fh, '<', $MatlabErrorFilename )
or warn print getTimeStamp("log") or warn print getTimeStamp("log")
. " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n"; . " - pid $$ >> Cannot open Matlab output error file: ${MatlabErrorFilename}\n";
@@ -160,13 +157,13 @@ sub matlabCalc {
if ( $exit_value == 124 ) { if ( $exit_value == 124 ) {
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> system @args excessive duration: killed after $matlab_timeout seconds\n"; . " - pid $$ >> system $args excessive duration: killed after $matlab_timeout seconds\n";
$matlab_error = $matlab_error =
"Matlab elab excessive duration: killed after $matlab_timeout seconds"; "Matlab elab excessive duration: killed after $matlab_timeout seconds";
} }
else { else {
print getTimeStamp("log") print getTimeStamp("log")
. " - pid $$ >> system @args failed: return code $exit_value - $?\n"; . " - pid $$ >> system $args failed: return code $exit_value - $?\n";
$matlab_error = "Matlab elab failed: $exit_value - $?"; $matlab_error = "Matlab elab failed: $exit_value - $?";
} }
makeEmailMsg(); makeEmailMsg();