Changeset 93 for trunk/oarutils
- Timestamp:
- Jan 24, 2013, 3:50:46 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-dispatch
r92 r93 10 10 use Coro::Signal; 11 11 use Coro::Semaphore; 12 #use Coro::Timer qw(sleep);12 use Coro::Timer qw(sleep); 13 13 14 14 my $task = 0; … … 76 76 } 77 77 cede; 78 79 # asynchrone guard for job end 80 async { 81 my $job_id = shift; 82 GUARD: 83 while () { 84 sleep 15; # async, do not re-launch oarstat to fast 85 my $is_finish = `oarstat -s -j $job_id`; 86 chomp $is_finish; 87 last GUARD if $is_finish =~ m/Terminated/; 88 } 89 delete $scheduled{$job_id}; 90 $job_active->down; 91 $job_todo->down; 92 } $job_id; 78 93 } 79 } 94 }; 80 95 81 96 async { 82 97 while () { 83 for my $job_id (keys %scheduled) {84 my $is_finish = `oarstat -s -j $job_id`;85 chomp $is_finish;86 if ($is_finish =~ m/Terminated/) {87 delete $scheduled{$job_id};88 $job_active->down;89 $job_todo->down;90 }91 cede;92 }98 # for my $job_id (keys %scheduled) { 99 # my $is_finish = `oarstat -s -j $job_id`; 100 # chomp $is_finish; 101 # if ($is_finish =~ m/Terminated/) { 102 # delete $scheduled{$job_id}; 103 # $job_active->down; 104 # $job_todo->down; 105 # } 106 # cede; 107 # } 93 108 94 109 $finished->send if $job_todo->count == 0; 95 110 cede; 96 111 } 97 } 112 }; 98 113 99 114 cede;
Note: See TracChangeset
for help on using the changeset viewer.