Changeset 86


Ignore:
Timestamp:
Jun 1, 2012, 11:39:17 PM (12 years ago)
Author:
g7moreau
Message:
  • job with comment -> solution: inside {}
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r85 r86  
    243243         };
    244244
    245       $job_cmd =~ s/(\s+##.*)$//; # suppress comment
     245      #$job_cmd =~ s/(\s+##.*)$//; # suppress comment
    246246
    247247      # set job environment, run it and clean
     
    260260         $fh->print("trap 'kill -$sig_checkpoint \$(jobs -p)' $sig_checkpoint\n");
    261261         $fh->print("echo \$\$ > $job_pidfile\n");
    262          $fh->print("$job_cmd $job_stdout $job_stderr \&\n");
     262         $fh->print("{\n");
     263         $fh->print("$job_cmd\n");
     264         $fh->print("} $job_stdout $job_stderr \&\n");
    263265         $fh->print("while [ \$(jobs -p | wc -l) -gt 0 ]\n");
    264266         $fh->print("do\n");
     
    268270         }
    269271      else {
    270          $fh->print("$job_cmd $job_stdout $job_stderr\n");
     272         $fh->print("{\n");
     273         $fh->print("$job_cmd\n");
     274         $fh->print("} $job_stdout $job_stderr\n");
    271275         }
    272276      $fh->print("rm -f $job_nodefile\n") if $job_np > 1;
     
    481485 - empty line
    482486 - comment line begin with #
    483  - valid shell command with double # for meta comment
     487 - valid shell command (can containt comment)
    484488
    485489Example where F<$HOME/test/subjob1.sh> is a shell script (executable).
    486490
    487  $HOME/test/subjob01.sh  ## name=subjob01
    488  $HOME/test/subjob02.sh  ## name=subjob02
    489  $HOME/test/subjob03.sh  ## name=subjob03
    490  $HOME/test/subjob04.sh  ## name=subjob04
     491 $HOME/test/subjob01.sh  # name=subjob01
     492 $HOME/test/subjob02.sh  # name=subjob02
     493 $HOME/test/subjob03.sh  # name=subjob03
     494 $HOME/test/subjob04.sh  # name=subjob04
    491495 ...
    492  $HOME/test/subjob38.sh  ## name=subjob38
    493  $HOME/test/subjob39.sh  ## name=subjob39
    494  $HOME/test/subjob40.sh  ## name=subjob40
     496 $HOME/test/subjob38.sh  # name=subjob38
     497 $HOME/test/subjob39.sh  # name=subjob39
     498 $HOME/test/subjob40.sh  # name=subjob40
    495499
    496500These jobs could be launch by:
Note: See TracChangeset for help on using the changeset viewer.