--- source-trees/gt2-cvs/gram/jobmanager/setup/condor/condor.in Thu Jun 14 00:23:52 2007 +++ source-trees/gt2-cvs/gram/jobmanager/setup/condor/condor.in Thu Jun 14 00:24:57 2007 @@ -32,6 +32,15 @@ my $stderr = $description->stderr(); my $globus_condor_conf = "$ENV{GLOBUS_LOCATION}/etc/globus-condor.conf"; + # We want to have individual Condor log files for each job for + # pre-WS GRAM, but still have a single log file for WS GRAM + # (which uses the SEG to monitor job status). + if ( !defined( $description->factoryendpoint() ) ) { + $self->{individual_condor_log} = 1; + } else { + $self->{individual_condor_log} = 0; + } + if (-r $globus_condor_conf) { local(*FH); @@ -48,7 +57,7 @@ close(FH); } } - if (! exists($self->{condor_logfile})) + if (! exists($self->{condor_logfile}) || $self->{individual_condor_log}) { if(! exists($ENV{GLOBUS_SPOOL_DIR})) { @@ -58,9 +67,14 @@ { $log_dir = $ENV{GLOBUS_SPOOL_DIR}; } - $self->{condor_logfile} = "$log_dir/gram_condor_log"; + if ( $self->{individual_condor_log} ) { + $self->{condor_logfile} = "$log_dir/gram_condor_log." + . $description->uniq_id(); + } else { + $self->{condor_logfile} = "$log_dir/gram_condor_log"; + } } - if(! -e $self->{condor_logfile}) + if ((! -e $self->{condor_logfile}) && ($self->{individual_condor_log} == 0)) { # We make sure that the log file exists with the correct # permissions. If we just let Condor create it, it will @@ -482,11 +496,17 @@ if $description->stdout() ne ''; $self->nfssync( $description->stderr(), 0 ) if $description->stderr() ne ''; + if ( ${self}->{individual_condor_log} ) { + unlink($self->{condor_logfile}); + } return { JOB_STATE => Globus::GRAM::JobState::DONE }; } if($num_abort > 0) { + if ( ${self}->{individual_condor_log} ) { + unlink($self->{condor_logfile}); + } $state = Globus::GRAM::JobState::FAILED; } elsif($num_done == $description->count()) @@ -496,6 +516,9 @@ $self->nfssync( $description->stderr(), 0 ) if $description->stderr() ne ''; + if ( ${self}->{individual_condor_log} ) { + unlink($self->{condor_logfile}); + } $state = Globus::GRAM::JobState::DONE; } elsif($num_run == 0)