Changeset 47 for trunk/oarutils
- Timestamp:
- Dec 6, 2011, 6:27:18 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oarutils/oar-parexec
r46 r47 16 16 use Cwd qw( getcwd ); 17 17 18 my $file cmd= '';18 my $file = ''; 19 19 my $dir = ''; 20 20 my $cmd = ''; … … 29 29 30 30 Getopt::Long::GetOptions( 31 'file cmd=s' => \$filecmd,31 'file=s' => \$file, 32 32 'dir=s' => \$dir, 33 33 'cmd=s' => \$cmd, … … 43 43 pod2usage(-verbose => 2) if $help; 44 44 pod2usage(-verbose => 2) if not ( 45 (-e "$file cmd")45 (-e "$file") 46 46 or (-d "$dir" and $cmd ne '') 47 47 ); … … 68 68 # job to run 69 69 my @job = (); 70 if (-e "$file cmd") {70 if (-e "$file") { 71 71 my $job_num = 0; 72 open(JOB_LIST, '<', "$file cmd") or die "error: can't open job file $filecmd: $!";72 open(JOB_LIST, '<', "$file") or die "error: can't open job file $file: $!"; 73 73 while (<JOB_LIST>) { 74 74 chomp; … … 266 266 =head1 SYNOPSIS 267 267 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] 275 277 276 278 oar-parexec --help … … 284 286 However, it can be used outside OAR. 285 287 286 Option C<--file cmd> or C<--dir> and C<--cmd> are the only mandatory parameters.288 Option C<--file> or C<--dir> and C<--cmd> are the only mandatory parameters. 287 289 288 290 Small job will be launch in the same folder as the master job. … … 309 311 =over 12 310 312 311 =item B<-f|--file cmdfilecommand>313 =item B<-f|--file filecommand> 312 314 313 315 File name which content job list. … … 315 317 the first valid job in the list will have the number 1 and so on... 316 318 317 =item B<-d|--dir foldertoite mize>319 =item B<-d|--dir foldertoiterate> 318 320 319 321 Command C<--cmd> will be launch in all sub-folder of this master folder. 320 322 Files 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...323 Sub-folder name which begin with F<.> 324 or finish with F<.old>, F<.sav>, F<.bak>, F<.no> will either be ignored... 323 325 324 326 The JOB_NAME is simply the Sub-folder name. … … 394 396 =head2 Simple list of sequential job 395 397 396 Content for the job file command (option C<--file cmd>) could have:398 Content for the job file command (option C<--file>) could have: 397 399 398 400 - empty line … … 415 417 oarsub -n test -l /core=6,walltime=04:00:00 "oar-parexec -f ./subjob.list.txt" 416 418 419 =head2 Folder job 420 421 In a folder F<subjob.d>, create sub-folder with your data inside : F<test1>, <test2>... 422 The same command will be executed in every sub-folder. 423 C<oar-parexec> change the current directory to the sub-folder before launching it. 424 425 A 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 429 The command C<env> will be excuted in all folder F<test1>, F<test2>... after a 10s pause. 430 431 Sometime, it's simpler to use file list command, 432 sometime, jobs by folder with the same command run is more relevant. 433 417 434 =head2 Parallel job 418 435
Note: See TracChangeset
for help on using the changeset viewer.