Changeset 35


Ignore:
Timestamp:
Dec 1, 2011, 11:47:20 PM (9 years ago)
Author:
g7moreau
Message:
  • Small bug about array ref -> string
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r34 r35  
    6060
    6161my $ressource_size = scalar(@ressources);
    62 die "not enought ressources jobnp $job_np > ressources $ressource_size" if not $job_np > $ressource_size;
     62die "not enought ressources jobnp $job_np > ressources $ressource_size" if $job_np > $ressource_size;
    6363
    6464my $current_dir = getcwd();
     
    7878my $ressources = new Coro::Channel;
    7979for 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)] ) );
    8181   }
    8282
     
    9191      $job_num++;
    9292
    93       my $node_connect = $nodes->[0];
     93      my ($node_connect) = split ',', $nodes;
    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 => $node_connect, num => $job_num };
     101      $scheduled{$job_pid} = { fh => $fh, node_connect => $node_connect, nodes => $nodes, num => $job_num };
    102102
    103103      printf "start job %5i / %5i on node %s at %s\n",
     
    112112
    113113      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");
    115115         $fh->print("OAR_NODE_FILE=$job_nodefile\n");
    116116         $fh->print("OAR_NP=$job_np\n");
     
    133133            printf "end   job %5i / %5i on node %s at %s\n",
    134134               $scheduled{$job_pid}->{num},
    135                $job_pid, $scheduled{$job_pid}->{node}, time
     135               $job_pid, $scheduled{$job_pid}->{node_connect}, time
    136136               if $verbose;
    137137            close $scheduled{$job_pid}->{fh};
    138             $ressources->put( $scheduled{$job_pid}->{node} );
     138            $ressources->put( $scheduled{$job_pid}->{nodes} );
    139139            $job_todo->down;
    140140            delete $scheduled{$job_pid};
Note: See TracChangeset for help on using the changeset viewer.