Changeset 36 for trunk/oarutils/oar-parexec
- Timestamp:
- Dec 3, 2011, 8:20:09 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r35 r36 87 87 async { 88 88 for my $job (@job) { 89 my $ nodes= $ressources->get;89 my $job_ressource = $ressources->get; 90 90 91 91 $job_num++; 92 92 93 my ($node_connect) = split ',', $ nodes;93 my ($node_connect) = split ',', $job_ressource; 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_connect => $node_connect, nodes => $nodes, num => $job_num };102 103 printf "start job %5i / %5i on node %s at%s\n",104 $job_num, $job_pid, $node_connect, time101 $scheduled{$job_pid} = { fh => $fh, node_connect => $node_connect, ressource => $job_ressource, num => $job_num }; 102 103 printf "start job %5i / %5i at %s on node %s\n", 104 $job_num, $job_pid, time, $job_ressource 105 105 if $verbose; 106 106 … … 109 109 $job_stderr = "2> $stderr-$job_num.stderr" if $stderr ne '' and $switchio; 110 110 111 my $job_nodefile = "/tmp/oar-parexec-$ENV{ USERNAME}-$job_num";111 my $job_nodefile = "/tmp/oar-parexec-$ENV{LOGNAME}-$job_num"; 112 112 113 113 if ($job_np > 1) { 114 $fh->print("printf \".join('\n',split(',',$nodes)).\" > $job_nodefile\n"); 115 $fh->print("OAR_NODE_FILE=$job_nodefile\n"); 114 $fh->print("printf \"" 115 . join('\n',split(',',$job_ressource,)) 116 . "\" > $job_nodefile\n"); 117 $fh->print("OAR_NODEFILE=$job_nodefile\n"); 116 118 $fh->print("OAR_NP=$job_np\n"); 117 $fh->print("export OAR_NODE _FILE\n");119 $fh->print("export OAR_NODEFILE\n"); 118 120 $fh->print("export OAR_NP\n"); 119 121 $fh->print("unset OAR_MSG_NODEFILE\n"); … … 131 133 for my $job_pid ( keys %scheduled ) { 132 134 if ( waitpid( $job_pid, WNOHANG ) ) { 133 printf "end job %5i / %5i on node %s at%s\n",135 printf "end job %5i / %5i at %s on node %s\n", 134 136 $scheduled{$job_pid}->{num}, 135 $job_pid, $scheduled{$job_pid}->{node_connect}, time 137 $job_pid, time, 138 $scheduled{$job_pid}->{ressource} 136 139 if $verbose; 137 140 close $scheduled{$job_pid}->{fh}; 138 $ressources->put( $scheduled{$job_pid}->{ nodes} );141 $ressources->put( $scheduled{$job_pid}->{ressource} ); 139 142 $job_todo->down; 140 143 delete $scheduled{$job_pid};
Note: See TracChangeset
for help on using the changeset viewer.