Changeset 42 for trunk/oarutils/oar-parexec
- Timestamp:
- Dec 5, 2011, 4:30:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r41 r42 108 108 109 109 my $oar_checkpoint = new Coro::Semaphore 0; 110 $SIG{USR2} = sub {$oar_checkpoint->up}; 110 $SIG{USR2} = sub { 111 print "warning: receive checkpoint at " 112 . time 113 . ", no new job, just finishing running job\n" 114 if $verbose; 115 $oar_checkpoint->up(); 116 }; 111 117 112 118 async { … … 147 153 }; 148 154 149 $log_h->printf("start job %5i at %s\n", $job_num, time) if $logfile;150 printf "start job %5i / %5i at %s on node %s\n",151 $job_num, $job_pid, time, $job_ressource152 155 my $msg = sprintf "start job %5i / %5i at %s on node %s\n", 156 $job_num, $job_pid, time, $job_ressource; 157 $log_h->print($msg) if $logfile; 158 print($msg) if $verbose; 153 159 154 160 my ($job_stdout, $job_stderr); … … 180 186 for my $job_pid (keys %scheduled) { 181 187 if (waitpid($job_pid, WNOHANG)) { 182 $log_h->printf("end job %5i at %s\n", 183 $scheduled{$job_pid}->{num}, time) 184 if $logfile; 185 printf "end job %5i / %5i at %s on node %s\n", 188 my $msg = sprintf "end job %5i / %5i at %s on node %s\n", 186 189 $scheduled{$job_pid}->{num}, 187 $job_pid, time, $scheduled{$job_pid}->{ressource} 188 if $verbose; 190 $job_pid, time, $scheduled{$job_pid}->{ressource}; 191 $log_h->print($msg) if $logfile; 192 print($msg) if $verbose; 189 193 close $scheduled{$job_pid}->{fh}; 190 194 $ressources->put($scheduled{$job_pid}->{ressource}); … … 195 199 } 196 200 197 $finished->send if $oar_checkpoint->count > 0 and keys(%scheduled) == 0;198 199 $finished->send if $job_todo->count == 0;201 $finished->send if $oar_checkpoint->count() > 0 and scalar(keys(%scheduled)) == 0; 202 203 $finished->send if $job_todo->count() == 0; 200 204 cede; 201 205 }
Note: See TracChangeset
for help on using the changeset viewer.