Changeset 35
- Timestamp:
- Dec 1, 2011, 11:47:20 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r34 r35 60 60 61 61 my $ressource_size = scalar(@ressources); 62 die "not enought ressources jobnp $job_np > ressources $ressource_size" if not$job_np > $ressource_size;62 die "not enought ressources jobnp $job_np > ressources $ressource_size" if $job_np > $ressource_size; 63 63 64 64 my $current_dir = getcwd(); … … 78 78 my $ressources = new Coro::Channel; 79 79 for my $slot (1 .. int($ressource_size / $job_np)) { 80 $ressources->put( [ @ressources[(($slot - 1) * $job_np) .. (($slot * $job_np) - 1)] ]);80 $ressources->put( join(',', @ressources[(($slot - 1) * $job_np) .. (($slot * $job_np) - 1)] ) ); 81 81 } 82 82 … … 91 91 $job_num++; 92 92 93 my $node_connect = $nodes->[0];93 my ($node_connect) = split ',', $nodes; 94 94 my $fh = IO::File->new(); 95 95 my $job_pid = $fh->open("| $oarsh $node_connect >/dev/null 2>&1") … … 99 99 $fh = unblock $fh; 100 100 101 $scheduled{$job_pid} = { fh => $fh, node => $node_connect, num => $job_num };101 $scheduled{$job_pid} = { fh => $fh, node_connect => $node_connect, nodes => $nodes, num => $job_num }; 102 102 103 103 printf "start job %5i / %5i on node %s at %s\n", … … 112 112 113 113 if ($job_np > 1) { 114 $fh->print("printf \".join('\n', @{$nodes}).\" > $job_nodefile\n");114 $fh->print("printf \".join('\n',split(',',$nodes)).\" > $job_nodefile\n"); 115 115 $fh->print("OAR_NODE_FILE=$job_nodefile\n"); 116 116 $fh->print("OAR_NP=$job_np\n"); … … 133 133 printf "end job %5i / %5i on node %s at %s\n", 134 134 $scheduled{$job_pid}->{num}, 135 $job_pid, $scheduled{$job_pid}->{node }, time135 $job_pid, $scheduled{$job_pid}->{node_connect}, time 136 136 if $verbose; 137 137 close $scheduled{$job_pid}->{fh}; 138 $ressources->put( $scheduled{$job_pid}->{node } );138 $ressources->put( $scheduled{$job_pid}->{nodes} ); 139 139 $job_todo->down; 140 140 delete $scheduled{$job_pid};
Note: See TracChangeset
for help on using the changeset viewer.