To get the status of individual tasks, parallel will need to write information somewhere. I donβt know if it works or not. If this is not the case, you can do it yourself.
my %jobs = ( "date" => "date", "ls" => "ls", "pwd" => "pwd", "factor" => "factor 17", ); open(my $parallel, "|parallel"); for my $id (keys(%jobs)) { print $parallel $jobs{$id} ." 1> '/tmp/$id.out'" ." 2> '/tmp/$id.err' ; " ."echo \$?" ." > '/tmp/$id.exit'\n"; } close($parallel); my $exit_status = $? >> 8; if ($exit_status >= 255) { print("Failed\n"); } else { printf("%d failed jobs\n", $exit_status); } for my $id (keys(%jobs)) { ...grab output and exit code from files... }
Update : I went and installed parallel .
It has an option --joblog {file} , which creates a report with exit codes. It accepts - for the file name, if you want it to be displayed on STDOUT.
Please note that parallel does not recognize abnormal death by signal, so this is not included in the --joblog report. Using the solution posted above, the missing .exit file indicates an abnormal death. (You must make sure that this does not exist in the first place.)
source share