Changeset 36


Ignore:
Timestamp:
Dec 3, 2011, 8:20:09 AM (9 years ago)
Author:
g7moreau
Message:
  • Small bug correction
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r35 r36  
    8787async {
    8888   for my $job (@job) {
    89       my $nodes = $ressources->get;
     89      my $job_ressource = $ressources->get;
    9090
    9191      $job_num++;
    9292
    93       my ($node_connect) = split ',', $nodes;
     93      my ($node_connect) = split ',', $job_ressource;
    9494      my $fh      = IO::File->new();
    9595      my $job_pid = $fh->open("| $oarsh $node_connect >/dev/null 2>&1")
     
    9999      $fh = unblock $fh;
    100100
    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, time
     101      $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
    105105         if $verbose;
    106106
     
    109109      $job_stderr = "2> $stderr-$job_num.stderr" if $stderr ne '' and $switchio;
    110110
    111       my $job_nodefile = "/tmp/oar-parexec-$ENV{USERNAME}-$job_num";
     111      my $job_nodefile = "/tmp/oar-parexec-$ENV{LOGNAME}-$job_num";
    112112
    113113      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");
    116118         $fh->print("OAR_NP=$job_np\n");
    117          $fh->print("export OAR_NODE_FILE\n");
     119         $fh->print("export OAR_NODEFILE\n");
    118120         $fh->print("export OAR_NP\n");
    119121         $fh->print("unset OAR_MSG_NODEFILE\n");
     
    131133      for my $job_pid ( keys %scheduled ) {
    132134         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",
    134136               $scheduled{$job_pid}->{num},
    135                $job_pid, $scheduled{$job_pid}->{node_connect}, time
     137               $job_pid, time,
     138               $scheduled{$job_pid}->{ressource}
    136139               if $verbose;
    137140            close $scheduled{$job_pid}->{fh};
    138             $ressources->put( $scheduled{$job_pid}->{nodes} );
     141            $ressources->put( $scheduled{$job_pid}->{ressource} );
    139142            $job_todo->down;
    140143            delete $scheduled{$job_pid};
Note: See TracChangeset for help on using the changeset viewer.