Ignore:
Timestamp:
12/22/21 10:39:44 (3 years ago)
Author:
Mathieu Morlighem
Message:

merged trunk-jpl and trunk for revision 26742

Location:
issm/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk

  • issm/trunk/src

  • issm/trunk/src/m/classes/clusters/pfe.m

    r25836 r26744  
    1 %PFE class definition
     1%PFE cluster class definition
    22%
    33%   Usage:
     
    77
    88classdef pfe
    9         properties (SetAccess=public) 
     9        properties (SetAccess=public)
    1010                % {{{
    1111                name           = 'pfe'
    1212                login          = '';
    13                 modules        = {'comp-intel/2016.2.181' 'mpi-sgi/mpt'};
     13                modules        = {'comp-intel/2016.2.181' 'mpt'};
    1414                numnodes       = 20;
    1515                cpuspernode    = 8;
     
    2121                codepath       = '';
    2222                executionpath  = '';
    23                 grouplist     = 's1690';
     23                grouplist      = '';
    2424                interactive    = 0;
    2525                bbftp          = 0;
     
    3939                %}}}
    4040                function disp(cluster) % {{{
    41                         %  display the object
     41                        % display the object
    4242                        disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
    4343                        disp(sprintf('    name: %s',cluster.name));
    4444                        disp(sprintf('    login: %s',cluster.login));
    45                         modules=''; for i=1:length(cluster.modules), modules=[modules cluster.modules{i} ',']; end; modules=modules(1:end-1);
    46                         disp(sprintf('    modules: %s',modules));
     45                        disp(sprintf('    modules: %s',strjoin(cluster.modules,', ')));
     46                        disp(sprintf('    numnodes: %s',cluster.numnodes));
     47                        disp(sprintf('    cpuspernode: %s',cluster.cpuspernode));
     48                        disp(sprintf('    np: %i',cluster.nprocs()));
    4749                        disp(sprintf('    port: %i',cluster.port));
    48                         disp(sprintf('    numnodes: %i',cluster.numnodes));
    49                         disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
    50                         disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
    51                         disp(sprintf('    queue: %s',cluster.queue));
     50                        disp(sprintf('    queue: %i',cluster.queue));
    5251                        disp(sprintf('    time: %i',cluster.time));
    53                         disp(sprintf('    processor: %s',cluster.processor));
    54                         disp(sprintf('    srcpath: %s ($ISSM_DIR on pfe)',cluster.srcpath));
    55                         disp(sprintf('    codepath: %s  ($ISSM_DIR/bin on pfe)',cluster.codepath));
    56                         disp(sprintf('    executionpath: %s  (directory containing issm.exe on pfe)',cluster.executionpath));
     52                        disp(sprintf('    processor: %i',cluster.processor));
     53                        disp(sprintf('    srcpath: %s',cluster.srcpath));
     54                        disp(sprintf('    codepath: %s',cluster.codepath));
     55                        disp(sprintf('    executionpath: %s',cluster.executionpath));
    5756                        disp(sprintf('    grouplist: %s',cluster.grouplist));
    58                         disp(sprintf('    interactive: %i',cluster.interactive));
    59                         disp(sprintf('    hyperthreading: %i',cluster.hyperthreading));
    60                 end
    61                 %}}}
    62                 function numprocs=np(cluster) % {{{
     57                        disp(sprintf('    interactive: %s',cluster.interactive));
     58                        disp(sprintf('    bbftp: %s',cluster.bbftp));
     59                        disp(sprintf('    numstreams: %s',cluster.numstreams));
     60                        disp(sprintf('    hyperthreading: %s',cluster.hyperthreading));
     61                end
     62                %}}}
     63                function numprocs=nprocs(cluster) % {{{
    6364                        %compute number of processors
    6465                        numprocs=cluster.numnodes*cluster.cpuspernode;
     
    7172                        queue_requirements_np=[2048 2048 150 150 2048];
    7273
    73                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     74                        QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.nprocs(),cluster.time)
    7475
    7576                        %now, check cluster.cpuspernode according to processor type
     
    128129                       
    129130                        else
    130                                 md = checkmessage(md,'unknown processor type, should be ''bro'' or ''has'' or ''ivy'' or ''san'' or ''cas_ait''');
     131                                md = checkmessage(md,'unknown processor type, should be ''bro'', ''has'', ''ivy'', ''san'', or ''cas_ait''');
    131132                        end
    132133
     
    161162                        fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
    162163                        fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
    163                         fprintf(fid,'#PBS -q %s \n',cluster.queue);
     164                        fprintf(fid,'#PBS -q %s\n',cluster.queue);
    164165                        fprintf(fid,'#PBS -W group_list=%s\n',cluster.grouplist);
    165166                        fprintf(fid,'#PBS -m e\n');
    166                         fprintf(fid,'#PBS -o %s.outlog \n',[cluster.executionpath '/' dirname '/' modelname]);
    167                         fprintf(fid,'#PBS -e %s.errlog \n\n',[cluster.executionpath '/' dirname '/' modelname]);
     167                        fprintf(fid,'#PBS -o %s/%s/%s.outlog \n',cluster.executionpath,dirname,modelname);
     168                        fprintf(fid,'#PBS -e %s/%s/%s.errlog \n\n',cluster.executionpath,dirname,modelname);
    168169                        fprintf(fid,'. /usr/share/modules/init/bash\n\n');
    169170                        for i=1:numel(cluster.modules), fprintf(fid,['module load ' cluster.modules{i} '\n']); end
     
    176177                        fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,dirname);
    177178                        if ~isvalgrind,
    178                                 fprintf(fid,'/u/scicon/tools/bin/several_tries mpiexec -np %i /u/scicon/tools/bin/mbind.x -cs -n%i %s/%s %s %s %s\n',cluster.np,cluster.cpuspernode,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
    179                         else
    180                                 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
     179                                fprintf(fid,'/u/scicon/tools/bin/toss3/several_tries mpiexec -np %i %s/%s %s %s/%s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,cluster.executionpath,dirname,modelname);
     180                        else
     181                                fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/' dirname],modelname);
    181182                        end
    182183                        if ~io_gather, %concatenate the output files:
     
    190191                                if cluster.interactive==10,
    191192                                                fprintf(fid,'module unload mpi-mvapich2/1.4.1/gcc\n');
    192                                                 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[pwd() '/run'],modelname);
     193                                                fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[pwd() '/run'],modelname);
    193194                                else
    194195                                        if ~isvalgrind,
    195                                                 fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
     196                                                fprintf(fid,'mpiexec -np %i %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
    196197                                        else
    197                                                 fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.np,cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
     198                                                fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/%s %s %s %s\n',cluster.nprocs(),cluster.codepath,executable,solution,[cluster.executionpath '/Interactive' num2str(cluster.interactive)],modelname);
    198199                                        end
    199200                                end
     
    214215
    215216                        %what is the executable being called?
    216                         executable='issm_slr.exe';
    217 
    218                         if ispc(), error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
     217                        executable='issm_slc.exe';
     218
     219                        if ispc & ~ismingw, error('BuildQueueScriptMultipleModels not support yet on windows machines');end;
    219220
    220221                        %write queuing script
     
    318319                        fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
    319320                        fprintf(fid,'cd %s/%s/\n\n',cluster.executionpath,modelname);
    320                         fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname); %FIXME
     321                        fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname); %FIXME
    321322                        if ~io_gather, %concatenate the output files:
    322323                                fprintf(fid,'cat %s.outbin.* > %s.outbin',modelname,modelname);
     
    328329                                fid=fopen([modelname '.run'],'w');
    329330                                if ~isvalgrind,
    330                                         fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
    331                                 else
    332                                         fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe %s %s\n',cluster.np,cluster.codepath,[cluster.executionpath '/' modelname],modelname);
     331                                        fprintf(fid,'mpiexec -np %i %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
     332                                else
     333                                        fprintf(fid,'mpiexec -np %i valgrind --leak-check=full %s/kriging.exe %s %s\n',cluster.nprocs(),cluster.codepath,[cluster.executionpath '/' modelname],modelname);
    333334                                end
    334335                                if ~io_gather, %concatenate the output files:
     
    382383
    383384                end %}}}
    384                 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{
     385                function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{
    385386
    386387                        %compress the files into one zip.
    387                         compressstring=['tar -zcf ' dirname '.tar.gz '];
     388                        compressstring=['tar -zcf ' dirname '.tar.gz'];
    388389                        for i=1:numel(filelist),
    389390                                compressstring = [compressstring ' ' filelist{i}];
     
    403404                        end
    404405
    405                         if ~cluster.bbftp,
     406                        if cluster.bbftp,
     407                                issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
     408                        else
    406409                                issmscpout(cluster.name,directory,cluster.login,cluster.port,{[dirname '.tar.gz']});
    407                         else
    408                                 issmbbftpout(cluster.name,directory,cluster.login,cluster.port,cluster.numstreams,{[dirname '.tar.gz']});
    409                         end
    410 
    411                 end
    412                 %}}}
    413                 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch)% {{{
    414 
    415                         %lauch command, to be executed via ssh
    416                         if ~cluster.interactive,
    417                                 if ~isempty(restart)
    418                                         launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
    419                                 else
    420                                         launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
    421                                                 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz  && qsub ' modelname '.queue '];
    422                                 end
    423                         else
     410                        end
     411
     412                end
     413                %}}}
     414                function LaunchQueueJob(cluster,modelname,dirname,filelist,restart,batch) % {{{
     415
     416                        %launch command, to be executed via ssh
     417                        if cluster.interactive,
    424418                                if ~isempty(restart)
    425419                                        launchcommand=['cd ' cluster.executionpath '/Interactive' num2str(cluster.interactive)];
     
    431425                                        end
    432426                                end
     427                        else
     428                                if ~isempty(restart)
     429                                        launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue '];
     430                                else
     431                                        launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ...
     432                                                ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue '];
     433                                end
    433434                        end
    434435
     
    437438                end
    438439                %}}}
    439                 function Download(cluster,dirname,filelist)% {{{
     440                function Download(cluster,dirname,filelist) % {{{
    440441
    441442                        %copy files from cluster to current directory
     
    448449                        end
    449450
    450                         if ~cluster.bbftp,
     451                        if cluster.bbftp,
     452                                issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
     453                        else
    451454                                issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist);
    452                         else
    453                                 issmbbftpin(cluster.name, cluster.login, cluster.port, cluster.numstreams, directory, filelist);
    454455                        end
    455456
Note: See TracChangeset for help on using the changeset viewer.