Changeset 47 for trunk


Ignore:
Timestamp:
Dec 6, 2011, 6:27:18 PM (12 years ago)
Author:
g7moreau
Message:
  • Revert --filecmd to --file
  • Doc Folder Job
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oarutils/oar-parexec

    r46 r47  
    1616use Cwd qw( getcwd );
    1717
    18 my $filecmd  = '';
     18my $file  = '';
    1919my $dir      = '';
    2020my $cmd      = '';
     
    2929
    3030Getopt::Long::GetOptions(
    31    'filecmd=s'  => \$filecmd,
     31   'file=s'     => \$file,
    3232   'dir=s'      => \$dir,
    3333   'cmd=s'      => \$cmd,
     
    4343pod2usage(-verbose => 2) if $help;
    4444pod2usage(-verbose => 2) if not (
    45  (-e "$filecmd")
     45 (-e "$file")
    4646 or (-d "$dir" and $cmd ne '')
    4747 );
     
    6868# job to run
    6969my @job = ();
    70 if (-e "$filecmd") {
     70if (-e "$file") {
    7171   my $job_num = 0;
    72    open(JOB_LIST, '<', "$filecmd") or die "error: can't open job file $filecmd: $!";
     72   open(JOB_LIST, '<', "$file") or die "error: can't open job file $file: $!";
    7373   while (<JOB_LIST>) {
    7474      chomp;
     
    266266=head1 SYNOPSIS
    267267
    268  oar-parexec --filecmd filecommand [--logtrace tracefile] [--verbose] \
    269             [--jobnp integer] [--nodefile filenode] [--oarsh sssh] \
    270             [--switchio] [--masterio basefileio]
    271 
    272  oar-parexec --dir foldertoitemize --cmd commandtolaunch [--logtrace tracefile] [--verbose] \
    273             [--jobnp integer] [--nodefile filenode] [--oarsh sssh] \
    274             [--switchio] [--masterio basefileio]
     268 oar-parexec --file filecommand \
     269    [--logtrace tracefile] [--verbose] \
     270    [--jobnp integer] [--nodefile filenode] [--oarsh sssh] \
     271    [--switchio] [--masterio basefileio]
     272
     273 oar-parexec --dir foldertoiterate --cmd commandtolaunch \
     274    [--logtrace tracefile] [--verbose] \
     275    [--jobnp integer] [--nodefile filenode] [--oarsh sssh] \
     276    [--switchio] [--masterio basefileio]
    275277
    276278 oar-parexec --help
     
    284286However, it can be used outside OAR.
    285287
    286 Option C<--filecmd> or C<--dir> and C<--cmd> are the only mandatory parameters.
     288Option C<--file> or C<--dir> and C<--cmd> are the only mandatory parameters.
    287289
    288290Small job will be launch in the same folder as the master job.
     
    309311=over 12
    310312
    311 =item B<-f|--filecmd filecommand>
     313=item B<-f|--file filecommand>
    312314
    313315File name which content job list.
     
    315317the first valid job in the list will have the number 1 and so on...
    316318
    317 =item B<-d|--dir foldertoitemize>
     319=item B<-d|--dir foldertoiterate>
    318320
    319321Command C<--cmd> will be launch in all sub-folder of this master folder.
    320322Files in this folder will be ignored.
    321 Sub-folder name which begin with '.'
    322 or finish with '.old', '.sav', '.bak', '.no' will either be ignored...
     323Sub-folder name which begin with F<.>
     324or finish with F<.old>, F<.sav>, F<.bak>, F<.no> will either be ignored...
    323325
    324326The JOB_NAME is simply the Sub-folder name.
     
    394396=head2 Simple list of sequential job
    395397
    396 Content for the job file command (option C<--filecmd>) could have:
     398Content for the job file command (option C<--file>) could have:
    397399
    398400 - empty line
     
    415417 oarsub -n test -l /core=6,walltime=04:00:00 "oar-parexec -f ./subjob.list.txt"
    416418
     419=head2 Folder job
     420
     421In a folder F<subjob.d>, create sub-folder with your data inside : F<test1>, <test2>...
     422The same command will be executed in every sub-folder.
     423C<oar-parexec> change the current directory to the sub-folder before launching it.
     424
     425A very simple job could be:
     426
     427 oarsub -n test -l /core=6,walltime=04:00:00 "oar-parexec -d ./subjob.d -c 'sleep 10; env'"
     428
     429The command C<env> will be excuted in all folder F<test1>, F<test2>... after a 10s pause.
     430
     431Sometime, it's simpler to use file list command,
     432sometime, jobs by folder with the same command run is more relevant.
     433
    417434=head2 Parallel job
    418435
Note: See TracChangeset for help on using the changeset viewer.