Changeset 311 for trunk/src


Ignore:
Timestamp:
Dec 1, 2011, 11:38:40 AM (12 years ago)
Author:
gostiaux
Message:

oar menu for different modes added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r310 r311  
    14921492                    '-l "/core=1+{type = ''smalljob''}/licence=1,walltime=00:60:00"   ' batch_file_list{p}];
    14931493                display(oar_command);eval(oar_command);
    1494                 end          
    1495        case 'oar_dispatch' %oar-dispatch.pl
    1496                 filename_joblist=fullfile(Rootbat,'job_list.txt');
    1497                 fid=fopen(filename_joblist,'w');
    1498                 walltime_onejob=600;%seconds
    1499                 for p=1:length(batch_file_list)
    1500                     oar_command=['oarsub -n CIVX '...
    1501                    '-E ' regexprep(batch_file_list{p},'\.bat\>','.errors') ' -O ' regexprep(batch_file_list{p},'\.bat\>','.log ')...
    1502                         '-l "/core=1,walltime=' datestr(walltime_onejob/86400,13) '"   ' batch_file_list{p}];
    1503                     fprintf(fid,[oar_command '\n']);
    1504                 end
    1505                 fclose(fid);
    1506                 ncores=36;
    1507                 oar_command=['oarsub -t container -n civx-container '...
    1508                     '-l /core=' num2str(ncores)...
    1509                     ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)...
    1510                     ' "oar-dispatch -f ' filename_joblist '"'];
    1511                 filename_oarcommand=fullfile(Rootbat,'oar_command');
    1512                 fid=fopen(filename_oarcommand,'w');
    1513                 fprintf(fid,[oar_command '\n']);
    1514                 fclose(fid);
    1515                 display(oar_command);
    1516                 eval(['! . ' filename_oarcommand])
    1517         case 'oar'
    1518                 filename_joblist=fullfile(Rootbat,'job_list.txt');
    1519                 fid=fopen(filename_joblist,'w');
    1520 
    1521                 for p=1:length(batch_file_list)
    1522                     fprintf(fid,[batch_file_list{p} '\n']);
    1523                 end
    1524                 fclose(fid)
    1525                 text_oarscript=[...
    1526                     '#!/bin/bash \n'...
    1527                     '#OAR -n Mylauncher \n'...
    1528                     '#OAR -l node=4/core=5,walltime=0:15:00 \n'...
    1529                     '#OAR -E stderrfile.log \n'...
    1530                     '#OAR -O stdoutfile.log \n'...
    1531                     '# ========================================================= \n'...
    1532                     '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'...
    1533                     '# application for coriolis PIV post-processing. \n'...
    1534                     '# OAR uses oarshmost wrapper to propagate the user environement. \n'...
    1535                     '# This wrapper assert that the user has the same environment on all the \n'...
    1536                     '# allocated nodes (basic behavior needed by most MPI applications).  \n'...
    1537                     '# \n'...
    1538                     '# REQUIREMENT: \n'...
    1539                     '# the oarshmost wrapper should be installed in $HOME/bin directory. \n'...
    1540                     '# If a different location is used, change the line following the comment "Bidouille" \n'...
    1541                     '# ========================================================= \n'...
    1542                     '#   USER should only modify these 2 lines \n'...
    1543                     'WORKDIR=' pwd ' \n'...
    1544                     'COMMANDE="mpilauncher  -f ' filename_joblist '" \n'...
    1545                     '# ========================================================= \n'...
    1546                     '# DO NOT MODIFY the FOLOWING LINES. (or be carefull) \n'...
    1547                     'echo "job starting on: "`hostname` \n'...
    1548                     'MPINODES="-host `tr [\\\\\\n] [,] <$OAR_NODEFILE |sed -e "s/,$/ /"`" \n'...
    1549                     'NCPUS=`cat $OAR_NODEFILE |wc -l` \n'...
    1550                     '#========== Bidouille ============== \n'...
    1551                     'export OMPI_MCA_plm_rsh_agent=oar-envsh \n'...%                     'cd $WORKDIR \n'...
    1552                     'CMD="mpirun -np $NCPUS -wdir $WORKDIR $MPINODES $COMMANDE" \n'...
    1553                     'echo "I run: $CMD" \n'...
    1554                     '$CMD \n'...
    1555                     'echo "job ending" \n'...
    1556                     ];
    1557 %                 oarsub -S ./oar.sub
    1558                 filename_oarscript=fullfile(Rootbat,'oar_command');
    1559                 fid=fopen(filename_oarscript,'w');
    1560                 fprintf(fid,[text_oarscript]);
    1561                 fclose(fid);
    1562                 eval(['!chmod +x  ' filename_oarscript]);
    1563                 eval(['!oarsub -S ' filename_oarscript]);
    1564         case 'oar_new' % to be develloped with Patrick Begou
    1565                 filename_joblist=fullfile(Rootbat,'job_list.txt');
    1566                 fid=fopen(filename_superbat,'w');
    1567                 if fid==-1
    1568                     msgbox_uvmat('ERROR',['cannot create the command file ' filename_superbat])
    1569                     return
    1570                 end
    1571                 for p=1:length(batch_file_list)
    1572                     fprintf(fid,[batch_file_list{p} '\n']);
    1573                 end
    1574                 fclose(fid);
    1575                 walltime=datestr(length(super_cmd)*10/24/60,13);
    1576                 eval(  ['!oarsub -n CIVX -q nicejob -l "/core=1+{type = ''smalljob''}/licence=1,walltime=' walltime '"   ' filename_superbat]);
     1494                end   
     1495       case 'oar' %oar-dispatch.pl
     1496           oar_modes={'oar-dispatch','mpilauncher'};
     1497           text={'Batch processing on servcalcul3 LEGI',...
     1498               '\n',...
     1499               'Please choose one of the followint modes\n',...
     1500               ' * oar-dispatch : jobs in a container\n',...
     1501               ' * mpilauncher : one single job using several cores\n',...
     1502               };
     1503           [S,v]=listdlg('PromptString',text,'ListString',oar_modes,...
     1504               'SelectionMode','single');
     1505           switch oar_modes(S)
     1506               
     1507               case 'oar_dispatch' %oar-dispatch.pl
     1508                   filename_joblist=fullfile(Rootbat,'job_list.txt');
     1509                   fid=fopen(filename_joblist,'w');
     1510                   walltime_onejob=600;%seconds
     1511                   for p=1:length(batch_file_list)
     1512                       oar_command=['oarsub -n CIVX '...
     1513                           '-E ' regexprep(batch_file_list{p},'\.bat\>','.errors') ' -O ' regexprep(batch_file_list{p},'\.bat\>','.log ')...
     1514                           '-l "/core=1,walltime=' datestr(walltime_onejob/86400,13) '"   ' batch_file_list{p}];
     1515                       fprintf(fid,[oar_command '\n']);
     1516                   end
     1517                   fclose(fid);
     1518                   ncores=36;
     1519                   oar_command=['oarsub -t container -n civx-container '...
     1520                       '-l /core=' num2str(ncores)...
     1521                       ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)...
     1522                       ' "oar-dispatch -f ' filename_joblist '"'];
     1523                   filename_oarcommand=fullfile(Rootbat,'oar_command');
     1524                   fid=fopen(filename_oarcommand,'w');
     1525                   fprintf(fid,[oar_command '\n']);
     1526                   fclose(fid);
     1527                   display(oar_command);
     1528                   eval(['! . ' filename_oarcommand])
     1529               case 'mpilauncher'
     1530                   filename_joblist=fullfile(Rootbat,'job_list.txt');
     1531                   fid=fopen(filename_joblist,'w');
     1532                   
     1533                   for p=1:length(batch_file_list)
     1534                       fprintf(fid,[batch_file_list{p} '\n']);
     1535                   end
     1536                   fclose(fid)
     1537                   text_oarscript=[...
     1538                       '#!/bin/bash \n'...
     1539                       '#OAR -n Mylauncher \n'...
     1540                       '#OAR -l node=4/core=5,walltime=0:15:00 \n'...
     1541                       '#OAR -E stderrfile.log \n'...
     1542                       '#OAR -O stdoutfile.log \n'...
     1543                       '# ========================================================= \n'...
     1544                       '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'...
     1545                       '# application for coriolis PIV post-processing. \n'...
     1546                       '# OAR uses oarshmost wrapper to propagate the user environement. \n'...
     1547                       '# This wrapper assert that the user has the same environment on all the \n'...
     1548                       '# allocated nodes (basic behavior needed by most MPI applications). \n'...
     1549                       '# \n'...
     1550                       '# REQUIREMENT: \n'...
     1551                       '# the oarshmost wrapper should be installed in $HOME/bin directory. \n'...
     1552                       '# If a different location is used, change the line following the comment "Bidouille" \n'...
     1553                       '# ========================================================= \n'...
     1554                       '#   USER should only modify these 2 lines \n'...
     1555                       'WORKDIR=' pwd ' \n'...
     1556                       'COMMANDE="mpilauncher  -f ' filename_joblist '" \n'...
     1557                       '# ========================================================= \n'...
     1558                       '# DO NOT MODIFY the FOLOWING LINES. (or be carefull) \n'...
     1559                       'echo "job starting on: "`hostname` \n'...
     1560                       'MPINODES="-host `tr [\\\\\\n] [,] <$OAR_NODEFILE |sed -e "s/,$/ /"`" \n'...
     1561                       'NCPUS=`cat $OAR_NODEFILE |wc -l` \n'...
     1562                       '#========== Bidouille ============== \n'...
     1563                       'export OMPI_MCA_plm_rsh_agent=oar-envsh \n'...%                     'cd $WORKDIR \n'...
     1564                       'CMD="mpirun -np $NCPUS -wdir $WORKDIR $MPINODES $COMMANDE" \n'...
     1565                       'echo "I run: $CMD"  \n'...
     1566                       '$CMD \n'...
     1567                       'echo "job ending" \n'...
     1568                       ];
     1569                   %                 oarsub -S ./oar.sub
     1570                   filename_oarscript=fullfile(Rootbat,'oar_command');
     1571                   fid=fopen(filename_oarscript,'w');
     1572                   fprintf(fid,[text_oarscript]);
     1573                   fclose(fid);
     1574                   eval(['!chmod +x  ' filename_oarscript]);
     1575                   eval(['!oarsub -S ' filename_oarscript]);
     1576           end
    15771577    end
    15781578else
Note: See TracChangeset for help on using the changeset viewer.