Changeset 336 for trunk/src


Ignore:
Timestamp:
Dec 16, 2011, 3:17:09 PM (12 years ago)
Author:
gostiaux
Message:

Number of cores can now be chosen

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/civ.m

    r332 r336  
    14811481        case 'oar'
    14821482           
    1483             oar_modes={'oar-dispatch','mpilauncher'};
     1483            oar_modes={'oar-dispatch','mpilauncher','oar-parexec'};
    14841484            text={'Batch processing on servcalcul3 LEGI';...
    14851485                'Please choose one of the followint modes';...
    1486                 '* oar-dispatch : jobs in a container';...
    1487                 '* mpilauncher : one single job using several cores';...
     1486                '* oar-dispatch : jobs in a container of several cores';...
     1487                '* mpilauncher : one single parallel mpi job using several cores';...
     1488                '* oar-parexec (under development) ';...
    14881489                '**********************************'...
    14891490                };
     
    14911492                'SelectionMode','single','ListSize',[400 100],'Name','LEGI job mode');
    14921493            switch oar_modes{S}
    1493                
     1494                case 'oar-parexec' %oar-dispatch.pl
     1495                    ncores=str2double(...
     1496                        inputdlg('Number of cores (max 36)','oarsub parameter',1,{'12'})...
     1497                        );
     1498                    walltime_onejob=600;%seconds
     1499                    filename_joblist=fullfile(Rootbat,'job_list.txt');
     1500                    fid=fopen(filename_joblist,'w');
     1501                    for p=1:length(batch_file_list)
     1502                        fprintf(fid,[batch_file_list{p} '\n']);
     1503                    end
     1504                    fclose(fid)
     1505                    oar_command=['oarsub -n test '...
     1506                         '-l /core=' num2str(ncores) ','...
     1507                        'walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13) ' '...
     1508                        '-E ' regexprep(filename_joblist,'\.txt\>','.errors') ' '...
     1509                        '-O ' regexprep(filename_joblist,'\.txt\>','.log') ' '...
     1510                        '"oar-parexec -f ' filename_joblist ' -l ' filename_joblist '.log"'];
     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])
    14941517                case 'oar-dispatch' %oar-dispatch.pl
     1518                    ncores=str2double(...
     1519                        inputdlg('Number of cores (max 36)','oarsub parameter',1,{'12'})...
     1520                        );
    14951521                    walltime_onejob=600;%seconds
    14961522                    filename_joblist=fullfile(Rootbat,'job_list.txt');
     
    15031529                    end
    15041530                    fclose(fid);
    1505                     ncores=36;
    15061531                    oar_command=['oarsub -t container -n civx-container '...
    15071532                        '-l /core=' num2str(ncores)...
    1508                         ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13)...
    1509                         ' "oar-dispatch -f ' filename_joblist '"'];
     1533                        ',walltime=' datestr(1.05*walltime_onejob/86400*max(length(batch_file_list),ncores)/ncores,13) ' '...
     1534                        '-E ' regexprep(filename_joblist,'\.txt\>','.errors') ' '...
     1535                        '-O ' regexprep(filename_joblist,'\.txt\>','.log') ' '...
     1536                        '"oar-dispatch -f ' filename_joblist '"'];
    15101537                    filename_oarcommand=fullfile(Rootbat,'oar_command');
    15111538                    fid=fopen(filename_oarcommand,'w');
     
    15261553                        '#OAR -n Mylauncher \n'...
    15271554                        '#OAR -l node=4/core=5,walltime=0:15:00 \n'...
    1528                         '#OAR -E stderrfile.log \n'...
    1529                         '#OAR -O stdoutfile.log \n'...
     1555                        '#OAR -E ' fullfile(Rootbat,'stderrfile.log') ' \n'...
     1556                        '#OAR -O ' fullfile(Rootbat,'stdoutfile.log') ' \n'...
    15301557                        '# ========================================================= \n'...
    15311558                        '# This simple program launch a multinode parallel OpenMPI mpilauncher \n'...
Note: See TracChangeset for help on using the changeset viewer.