--- globus_2_4_3_adv2003_fix892_fix956_more/gram/jobmanager/setup/lsf/lsf.in Wed Jun 18 20:25:16 2003 +++ globus_2_4_3_adv2003_fix892_fix956_plus/gram/jobmanager/setup/lsf/lsf.in Sun Jan 4 03:59:25 2004 @@ -11,7 +11,7 @@ @ISA = qw(Globus::GRAM::JobManager); -my ($lsf_profile, $mpirun, $bsub, $bjobs, $bkill); +my ($lsf_profile, $mpirun, $bsub, $bjobs, $bkill, $bacct); BEGIN { @@ -20,6 +20,7 @@ $bsub = ". $lsf_profile && @BSUB@"; $bjobs = ". $lsf_profile && @BJOBS@"; $bkill = ". $lsf_profile && @BKILL@"; + $bacct = ". $lsf_profile && @BACCT@"; } sub submit @@ -304,7 +305,7 @@ # PSUSP Suspended while pending SUSPENDED # SSUSP Suspended by system SUSPENDED # DONE Completed sucessfully DONE - # EXIT Completed unsuccessfully FAILED + # EXIT Completed unsuccessfully DONE (But command return non-zero exit code) # UNKWN Unknown state *ignore* # ZOMBI Unknown state FAILED @@ -355,7 +356,8 @@ } elsif(/EXIT/) { - return Globus::GRAM::Error::JOB_EXIT_CODE_NON_ZERO(); + $state = Globus::GRAM::JobState::DONE; +# return Globus::GRAM::Error::JOB_EXIT_CODE_NON_ZERO(); } elsif(/UNKWN/) { @@ -380,7 +382,27 @@ } } - return {JOB_STATE => $state}; + my @acct_info; + if ($state == Globus::GRAM::JobState::DONE || + $state == Globus::GRAM::JobState::FAILED) + { + if (defined open(BACCT,$bacct." -l ".$job_id." 2>&1 |")) + { + while() + { + chomp(my $line=$_); + $line =~ s|\\|\\\\|g; + push(@acct_info,$line); + } + close(BACCT); + } + } + +# NB Accounting information uses literal '\n' to indicate newlines + + return { JOB_ACCT_INFO => join('\n',@acct_info), + JOB_STATE => $state + }; } sub cancel