Changeset 5980


Ignore:
Timestamp:
09/23/10 09:37:37 (14 years ago)
Author:
Mathieu Morlighem
Message:

more flexible call to cluster

Location:
issm/trunk/src/m/clusters
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/clusters/astrid.m

    r5963 r5980  
    66classdef astrid
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='astrid'
    10         np   =15; %number of processors
    11                 codepath=[issmdir() '/bin'];
    12                 executionpath=[issmdir() '/../execution'];
    13                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
    14                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
    15                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    16                 login='larour';
    17                 port=0;
    18         %}}}
    19     end
    20     methods
    21                 function []=disp(md) % {{{1
    22                 %  display the object
    23                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    24                 disp(sprintf('    name: %s',md.name));
    25                 disp(sprintf('    np: %i',md.np));
    26                 disp(sprintf('    codepath: %s',md.codepath));
    27                 disp(sprintf('    executionpath: %s',md.executionpath));
    28                 disp(sprintf('    valgrind: %s',md.valgrind));
    29                 disp(sprintf('    valgrindlib: %s',md.valgrindlib));
    30                 disp(sprintf('    valgrindsup: %s',md.valgrindsup));
    31                 end
    32                 %}}}
    33                 function IsConsistent(md) % {{{1
    34                         if md.np>16,
    35                                 error('IsConsistent error message: number of processors should be lest than 16!');
    36                         end
    37                         if isnan(md.np),
    38                                 error('IsConsistent error message: number of processors should not be NaN!');
    39                         end
    40                 end
    41                 %}}}
    42                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    43                
    44                 %open file for writing:
    45                 fid=fopen([modelname '.queue'],'w');
     8                 % {{{1
     9                 name='astrid'
     10                 login='larour';
     11                 np=15;
     12                 port=0;
     13                 codepath=[issmdir() '/bin'];
     14                 executionpath=[issmdir() '/../execution'];
     15                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
     16                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
     17                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    4618
    47                 %write instructions for launching a job on the cluster
    48                 fprintf(fid,'#!/bin/sh\n');
    49                 if mem_debug==0,
    50                         fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    51                 else
    52                         %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    53                         fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup, md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    54                 end
     19                 %}}}
     20         end
     21         methods
     22                 function cluster=astrid(varargin) % {{{1
     23                         options=pairoptions(varargin{:});
     24                         for i=1:size(options.list,1),
     25                                 fieldname=options.list{i,1};
     26                                 fieldvalue=options.list{i,2};
     27                                 if ismember(fieldname,properties(astrid)),
     28                                         cluster.(fieldname)=fieldvalue;
     29                                 else
     30                                         disp(['''' fieldname ''' is not a property of cluster astrid']);
     31                                 end
     32                         end
     33                 end
     34                 %}}}
     35                 function disp(cluster) % {{{1
     36                         %  display the object
     37                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     38                         disp(sprintf('    name: %s',cluster.name));
     39                         disp(sprintf('    login: %s',cluster.login));
     40                         disp(sprintf('    np: %i',cluster.np));
     41                         disp(sprintf('    port: %i',cluster.port));
     42                         disp(sprintf('    codepath: %s',cluster.codepath));
     43                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     44                         disp(sprintf('    valgrind: %s',cluster.valgrind));
     45                         disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
     46                         disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
     47                 end
     48                 %}}}
     49                 function IsConsistent(cluster) % {{{1
     50                         if cluster.np>16,
     51                                 error('IsConsistent error message: number of processors should be lest than 16!');
     52                         end
     53                         if isnan(cluster.np),
     54                                 error('IsConsistent error message: number of processors should not be NaN!');
     55                         end
     56                 end
     57                 %}}}
     58                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    5559
    56                 %close file
    57                 fclose(fid);
     60                         %open file for writing:
     61                         fid=fopen([modelname '.queue'],'w');
    5862
    59                 end
    60                 %}}}
    61                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    62                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
    63                 end
    64                 %}}}
     63                         %write instructions for launching a job on the cluster
     64                         fprintf(fid,'#!/bin/sh\n');
     65                         if mem_debug==0,
     66                                 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     67                         else
     68                                 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     69                                 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     70                         end
     71
     72                         %close file
     73                         fclose(fid);
     74
     75                 end
     76                 %}}}
     77                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     78                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
     79                 end
     80                 %}}}
    6581        end
    6682end
  • issm/trunk/src/m/clusters/castor.m

    r5963 r5980  
    66classdef castor
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='castor'
    10                 np   =128; %number of processors
    11                 queue='shortc';
    12                 time=180;
    13                 codepath='/workp/edw/larour/issm-2.0/bin'
    14                 executionpath='/workp/edw/larour/Testing/Execution'
    15                 login='larour';
    16                 port=0;
    17         %}}}
    18     end
    19     methods
    20                 function []=disp(md) % {{{1
    21                 %  display the object
    22                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    23                 disp(sprintf('    name: %s',md.name));
    24                 disp(sprintf('    np: %i',md.np));
    25                 disp(sprintf('    queue: %s',md.queue));
    26                 disp(sprintf('    time: %i',md.time));
    27                 disp(sprintf('    codepath: %s',md.codepath));
    28                 disp(sprintf('    executionpath: %s',md.executionpath));
    29                 end
    30                 %}}}
    31                 function IsConsistent(md) % {{{1
     8                 % {{{1
     9                 name='castor'
     10                 login='larour';
     11                 np   =128; %number of processors
     12                 port=0;
     13                 queue='shortc';
     14                 time=180;
     15                 codepath='/workp/edw/larour/issm-2.0/bin'
     16                 executionpath='/workp/edw/larour/Testing/Execution'
     17                 %}}}
     18         end
     19         methods
     20                 function cluster=castor(varargin) % {{{1
     21                         options=pairoptions(varargin{:});
     22                         for i=1:size(options.list,1),
     23                                 fieldname=options.list{i,1};
     24                                 fieldvalue=options.list{i,2};
     25                                 if ismember(fieldname,properties(castor)),
     26                                         cluster.(fieldname)=fieldvalue;
     27                                 else
     28                                         disp(['''' fieldname ''' is not a property of cluster castor']);
     29                                 end
     30                         end
     31                 end
     32                 %}}}
     33                 function disp(cluster) % {{{1
     34                         %  display the object
     35                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     36                         disp(sprintf('    name: %s',cluster.name));
     37                         disp(sprintf('    login: %s',cluster.login));
     38                         disp(sprintf('    np: %i',cluster.np));
     39                         disp(sprintf('    port: %i',cluster.port));
     40                         disp(sprintf('    queue: %s',cluster.queue));
     41                         disp(sprintf('    time: %i',cluster.time));
     42                         disp(sprintf('    codepath: %s',cluster.codepath));
     43                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     44                 end
     45                 %}}}
     46                 function IsConsistent(cluster) % {{{1
    3247
    33                 available_queues={'shortc','longc'};
    34                 queue_requirements_time=[180 720];
    35                 queue_requirements_np=[128 128];
     48                         available_queues={'shortc','longc'};
     49                         queue_requirements_time=[180 720];
     50                         queue_requirements_np=[128 128];
    3651
    37                 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,md.queue,md.np,md.time)
    38                 end
    39                 %}}}
    40                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    41                
    42                 %open file for writing:
    43                 fid=fopen([modelname '.queue'],'w');
    44                
    45                 fprintf(fid,'#!/bin/sh\n');
    46                 fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds.
    47                 fprintf(fid,'#PBS -N %s\n',modelname);
    48                 fprintf(fid,'#PBS -l ncpus=%i\n',md.np);
    49                 if ~isempty(queue),
    50                         fprintf(fid,'#PBS -q %s\n',md.queue);
    51                 end
    52                 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    53                 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
     52                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     53                 end
     54                 %}}}
     55                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    5456
    55                 fprintf(fid,'export PBS_O_WORKDIR=%s\n',md.executionpath);
    56                 fprintf(fid,'cd $PBS_O_WORKDIR\n');
    57                 fprintf(fid,'export OMP_NUM_THREADS=1\n');
    58                 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',md.np-1,md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname);
     57                         %open file for writing:
     58                         fid=fopen([modelname '.queue'],'w');
    5959
    60                 %close file
    61                 fclose(fid);
     60                         fprintf(fid,'#!/bin/sh\n');
     61                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
     62                         fprintf(fid,'#PBS -N %s\n',modelname);
     63                         fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
     64                         if ~isempty(queue),
     65                                 fprintf(fid,'#PBS -q %s\n',cluster.queue);
     66                         end
     67                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
     68                         fprintf(fid,'#PBS -e %s.errlog \n',modelname);
    6269
    63                 end
    64                 %}}}
    65                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    66                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
    67                 end
    68                 %}}}
     70                         fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
     71                         fprintf(fid,'cd $PBS_O_WORKDIR\n');
     72                         fprintf(fid,'export OMP_NUM_THREADS=1\n');
     73                         fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
     74
     75                         %close file
     76                         fclose(fid);
     77
     78                 end
     79                 %}}}
     80                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     81                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
     82                 end
     83                 %}}}
    6984        end
    7085end
  • issm/trunk/src/m/clusters/cosmos.m

    r5963 r5980  
    66classdef cosmos
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='cosmos'
    10                 np   =128; %number of processors
    11                 queue='shortq';
    12                 time=3*60;
    13                 codepath='/work00/edw/larour/issm-2.0/bin';
    14                 executionpath='/work00/edw/larour/Execution';
    15                 login='larour';
    16                 port=0;
    17         %}}}
    18     end
    19     methods
    20                 function []=disp(md) % {{{1
    21                 %  display the object
    22                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    23                 disp(sprintf('    name: %s',md.name));
    24                 disp(sprintf('    np: %i',md.np));
    25                 disp(sprintf('    queue: %s',md.queue));
    26                 disp(sprintf('    time: %i',md.time));
    27                 disp(sprintf('    codepath: %s',md.codepath));
    28                 disp(sprintf('    executionpath: %s',md.executionpath));
    29                 end
    30                 %}}}
    31                 function IsConsistent(md) % {{{1
     8                 % {{{1
     9                 name='cosmos'
     10                 login='larour';
     11                 np=128;
     12                 port=0;
     13                 queue='shortq';
     14                 time=3*60;
     15                 codepath='/work00/edw/larour/issm-2.0/bin';
     16                 executionpath='/work00/edw/larour/Execution';
     17                 %}}}
     18         end
     19         methods
     20                 function cluster=cosmos(varargin) % {{{1
     21                         options=pairoptions(varargin{:});
     22                         for i=1:size(options.list,1),
     23                                 fieldname=options.list{i,1};
     24                                 fieldvalue=options.list{i,2};
     25                                 if ismember(fieldname,properties(cosmos)),
     26                                         cluster.(fieldname)=fieldvalue;
     27                                 else
     28                                         disp(['''' fieldname ''' is not a property of cluster cosmos']);
     29                                 end
     30                         end
     31                 end
     32                 %}}}
     33                 function disp(cluster) % {{{1
     34                         %  display the object
     35                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     36                         disp(sprintf('    name: %s',cluster.name));
     37                         disp(sprintf('    login: %s',cluster.login));
     38                         disp(sprintf('    np: %i',cluster.np));
     39                         disp(sprintf('    port: %i',cluster.port));
     40                         disp(sprintf('    queue: %s',cluster.queue));
     41                         disp(sprintf('    time: %i',cluster.time));
     42                         disp(sprintf('    codepath: %s',cluster.codepath));
     43                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     44                 end
     45                 %}}}
     46                 function IsConsistent(cluster) % {{{1
    3247
    33                 available_queues={'debug','shortq','longq'};
    34                 queue_requirements_time=[60*1 60*3 60*17];
    35                 queue_requirements_np=[32 128 256];
     48                         available_queues={'debug','shortq','longq'};
     49                         queue_requirements_time=[60*1 60*3 60*17];
     50                         queue_requirements_np=[32 128 256];
    3651
    37                 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,md.queue,md.np,md.time)
    38                 end
    39                 %}}}
    40                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    41                
    42                 %open file for writing:
    43                 fid=fopen([modelname '.queue'],'w');
     52                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     53                 end
     54                 %}}}
     55                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    4456
    45                 fprintf(fid,'#!/bin/bash\n');
    46                 fprintf(fid,'#PBS -l select=%i:ncpus=1\n',md.np);
    47                 fprintf(fid,'#PBS -N %s\n',modelname);
    48                 fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
    49                 fprintf(fid,'#PBS -q %s\n',queue);
    50                 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    51                 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
    52                 fprintf(fid,'export PBS_O_WORKDIR=%s\n',md.executionpath);
    53                 fprintf(fid,'cd $PBS_O_WORKDIR\n');
    54                 fprintf(fid,'export OMP_NUM_THREADS=1\n');
    55                 fprintf(fid,'ulimit -s unlimited\n');
    56                 fprintf(fid,'ulimit -c 0\n');
    57                 fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname);
     57                         %open file for writing:
     58                         fid=fopen([modelname '.queue'],'w');
    5859
    59                 %close file
    60                 fclose(fid);
     60                         fprintf(fid,'#!/bin/bash\n');
     61                         fprintf(fid,'#PBS -l select=%i:ncpus=1\n',cluster.np);
     62                         fprintf(fid,'#PBS -N %s\n',modelname);
     63                         fprintf(fid,'#PBS -l walltime=%i\n',time*60); %walltime is in seconds.
     64                         fprintf(fid,'#PBS -q %s\n',queue);
     65                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
     66                         fprintf(fid,'#PBS -e %s.errlog \n',modelname);
     67                         fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
     68                         fprintf(fid,'cd $PBS_O_WORKDIR\n');
     69                         fprintf(fid,'export OMP_NUM_THREADS=1\n');
     70                         fprintf(fid,'ulimit -s unlimited\n');
     71                         fprintf(fid,'ulimit -c 0\n');
     72                         fprintf(fid,'/opt/mpich/gm/intel10.1/bin/mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
    6173
    62                 end
    63                 %}}}
    64                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    65                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub -S/bin/sh ' modelname '.queue '];
    66                 end
    67                 %}}}
     74                         %close file
     75                         fclose(fid);
     76
     77                 end
     78                 %}}}
     79                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     80                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub -S/bin/sh ' modelname '.queue '];
     81                 end
     82                 %}}}
    6883        end
    6984end
  • issm/trunk/src/m/clusters/eric-mac.m

    r5963 r5980  
    44%          cluster=eric-mac();
    55%
    6 classdef astrid
     6classdef ericmac
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='eric-mac'
    10         np   =3; %number of processors
    11                 codepath=[issmdir() '/bin'];
    12                 executionpath=[issmdir() '/../execution'];
    13                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
    14                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
    15                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    16                 login='larour';
    17                 port=0;
    18         %}}}
     8                 % {{{1
     9                 name='eric-mac'
     10                 login='larour';
     11                 np=3;
     12                 port=0;
     13                 codepath=[issmdir() '/bin'];
     14                 executionpath=[issmdir() '/../execution'];
     15                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
     16                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
     17                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
     18                 %}}}
    1919    end
    2020    methods
    21                 function []=disp(md) % {{{1
    22                 %  display the object
    23                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    24                 disp(sprintf('    name: %s',md.name));
    25                 disp(sprintf('    np: %i',md.np));
    26                 disp(sprintf('    codepath: %s',md.codepath));
    27                 disp(sprintf('    executionpath: %s',md.executionpath));
    28                 disp(sprintf('    valgrind: %s',md.valgrind));
    29                 disp(sprintf('    valgrindlib: %s',md.valgrindlib));
    30                 disp(sprintf('    valgrindsup: %s',md.valgrindsup));
    31                 end
    32                 %}}}
    33                 function IsConsistent(md) % {{{1
    34                         if md.np>4,
    35                                 error('IsConsistent error message: number of processors should be lest than 16!');
    36                         end
    37                         if isnan(md.np),
    38                                 error('IsConsistent error message: number of processors should not be NaN!');
    39                         end
    40                 end
    41                 %}}}
    42                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    43                
    44                 %open file for writing:
    45                 fid=fopen([modelname '.queue'],'w');
     21                 function cluster=ericmac(varargin) % {{{1
     22                         options=pairoptions(varargin{:});
     23                         for i=1:size(options.list,1),
     24                                 fieldname=options.list{i,1};
     25                                 fieldvalue=options.list{i,2};
     26                                 if ismember(fieldname,properties(ericmac)),
     27                                         cluster.(fieldname)=fieldvalue;
     28                                 else
     29                                         disp(['''' fieldname ''' is not a property of cluster ericmac']);
     30                                 end
     31                         end
     32                 end
     33                 %}}}
     34                 function disp(cluster) % {{{1
     35                         %  display the object
     36                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     37                         disp(sprintf('    name: %s',cluster.name));
     38                         disp(sprintf('    login: %s',cluster.login));
     39                         disp(sprintf('    np: %i',cluster.np));
     40                         disp(sprintf('    port: %i',cluster.port));
     41                         disp(sprintf('    codepath: %s',cluster.codepath));
     42                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     43                         disp(sprintf('    valgrind: %s',cluster.valgrind));
     44                         disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
     45                         disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
     46                 end
     47                 %}}}
     48                 function IsConsistent(cluster) % {{{1
     49                         if cluster.np>4,
     50                                 error('IsConsistent error message: number of processors should be lest than 16!');
     51                         end
     52                         if isnan(cluster.np),
     53                                 error('IsConsistent error message: number of processors should not be NaN!');
     54                         end
     55                 end
     56                 %}}}
     57                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    4658
    47                 %write instructions for launching a job on the cluster
    48                 fprintf(fid,'#!/bin/sh\n');
    49                 if mem_debug==0,
    50                         fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    51                 else
    52                         %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    53                         fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup, md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    54                 end
     59                         %open file for writing:
     60                         fid=fopen([modelname '.queue'],'w');
    5561
    56                 %close file
    57                 fclose(fid);
     62                         %write instructions for launching a job on the cluster
     63                         fprintf(fid,'#!/bin/sh\n');
     64                         if mem_debug==0,
     65                                 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     66                         else
     67                                 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     68                                 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     69                         end
    5870
    59                 end
    60                 %}}}
    61                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    62                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
    63                 end
    64                 %}}}
     71                         %close file
     72                         fclose(fid);
     73
     74                 end
     75                 %}}}
     76                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     77                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
     78                 end
     79                 %}}}
    6580        end
    6681end
  • issm/trunk/src/m/clusters/gemini.m

    r5963 r5980  
    88        % {{{1
    99                name='gemini'
    10                 np   =50; %number of processors
     10                login='larour';
     11                np=50;
     12                port=0;
    1113                queue='debug';
    1214                time=60;
    1315                codepath='/workg/edw/larour/issm-2.0/bin'
    1416                executionpath='/workg/edw/larour/Testing/Execution'
    15                 login='larour';
    16                 port=0;
    1717        %}}}
    1818    end
    1919    methods
    20                 function []=disp(md) % {{{1
    21                 %  display the object
    22                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    23                 disp(sprintf('    name: %s',md.name));
    24                 disp(sprintf('    np: %i',md.np));
    25                 disp(sprintf('    queue: %s',md.queue));
    26                 disp(sprintf('    time: %i',md.time));
    27                 disp(sprintf('    codepath: %s',md.codepath));
    28                 disp(sprintf('    executionpath: %s',md.executionpath));
    29                 end
    30                 %}}}
    31                 function IsConsistent(md) % {{{1
     20                 function cluster=gemini(varargin) % {{{1
     21                         options=pairoptions(varargin{:});
     22                         for i=1:size(options.list,1),
     23                                 fieldname=options.list{i,1};
     24                                 fieldvalue=options.list{i,2};
     25                                 if ismember(fieldname,properties(gemini)),
     26                                         cluster.(fieldname)=fieldvalue;
     27                                 else
     28                                         disp(['''' fieldname ''' is not a property of cluster gemini']);
     29                                 end
     30                         end
     31                 end
     32                 %}}}
     33                 function disp(cluster) % {{{1
     34                         %  display the object
     35                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     36                         disp(sprintf('    name: %s',cluster.name));
     37                         disp(sprintf('    login: %s',cluster.login));
     38                         disp(sprintf('    np: %i',cluster.np));
     39                         disp(sprintf('    port: %i',cluster.port));
     40                         disp(sprintf('    queue: %s',cluster.queue));
     41                         disp(sprintf('    time: %i',cluster.time));
     42                         disp(sprintf('    codepath: %s',cluster.codepath));
     43                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     44                 end
     45                 %}}}
     46                 function IsConsistent(cluster) % {{{1
    3247
    33                 available_queues={'debug','shortg','longg'};
    34                 queue_requirements_time=[60 180 720];
    35                 queue_requirements_np=[50 50 50];
     48                         available_queues={'debug','shortg','longg'};
     49                         queue_requirements_time=[60 180 720];
     50                         queue_requirements_np=[50 50 50];
    3651
    37                 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,md.queue,md.np,md.time)
    38                 end
    39                 %}}}
    40                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    41                
    42                 %open file for writing:
    43                 fid=fopen([modelname '.queue'],'w');
    44                
    45                 fprintf(fid,'#!/bin/sh\n');
    46                 fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds.
    47                 fprintf(fid,'#PBS -N %s\n',modelname);
    48                 fprintf(fid,'#PBS -l ncpus=%i\n',md.np);
    49                 if ~isempty(queue),
    50                         fprintf(fid,'#PBS -q %s\n',md.queue);
    51                 end
    52                 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    53                 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
     52                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     53                 end
     54                 %}}}
     55                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    5456
    55                 fprintf(fid,'export PBS_O_WORKDIR=%s\n',md.executionpath);
    56                 fprintf(fid,'cd $PBS_O_WORKDIR\n');
    57                 fprintf(fid,'export OMP_NUM_THREADS=1\n');
    58                 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',md.np-1,md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname);
     57                         %open file for writing:
     58                         fid=fopen([modelname '.queue'],'w');
    5959
    60                 %close file
    61                 fclose(fid);
     60                         fprintf(fid,'#!/bin/sh\n');
     61                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
     62                         fprintf(fid,'#PBS -N %s\n',modelname);
     63                         fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
     64                         if ~isempty(queue),
     65                                 fprintf(fid,'#PBS -q %s\n',cluster.queue);
     66                         end
     67                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
     68                         fprintf(fid,'#PBS -e %s.errlog \n',modelname);
    6269
    63                 end
    64                 %}}}
    65                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    66                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
    67                 end
    68                 %}}}
     70                         fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
     71                         fprintf(fid,'cd $PBS_O_WORKDIR\n');
     72                         fprintf(fid,'export OMP_NUM_THREADS=1\n');
     73                         fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
     74
     75                         %close file
     76                         fclose(fid);
     77
     78                 end
     79                 %}}}
     80                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     81                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
     82                 end
     83                 %}}}
    6984        end
    7085end
  • issm/trunk/src/m/clusters/larsen.m

    r5963 r5980  
    66classdef larsen
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='larsen'
    10                 np=7;
    11                 codepath=[issmdir() '/bin'];
    12                 executionpath=[issmdir() '/../execution'];
    13                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
    14                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
    15                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    16                 login='larour';
    17                 port=0;
    18         %}}}
    19     end
    20     methods
    21                 function []=disp(md) % {{{1
    22                 %  display the object
    23                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    24                 disp(sprintf('    name: %s',md.name));
    25                 disp(sprintf('    np: %i',md.np));
    26                 disp(sprintf('    codepath: %s',md.codepath));
    27                 disp(sprintf('    executionpath: %s',md.executionpath));
    28                 disp(sprintf('    valgrind: %s',md.valgrind));
    29                 disp(sprintf('    valgrindlib: %s',md.valgrindlib));
    30                 disp(sprintf('    valgrindsup: %s',md.valgrindsup));
    31                 end
    32                 %}}}
    33                 function IsConsistent(md) % {{{1
    34                         if md.np>8,
    35                                 error('IsConsistent error message: number of processors should be lest than 16!');
    36                         end
    37                         if isnan(md.np),
    38                                 error('IsConsistent error message: number of processors should not be NaN!');
    39                         end
    40                 end
    41                 %}}}
    42                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    43                
    44                 %open file for writing:
    45                 fid=fopen([modelname '.queue'],'w');
     8                 % {{{1
     9                 name='larsen'
     10                 login='larour';
     11                 np=7;
     12                 port=0;
     13                 codepath=[issmdir() '/bin'];
     14                 executionpath=[issmdir() '/../execution'];
     15                 valgrind=[issmdir() '/externalpackages/valgrind/install/bin/valgrind'];
     16                 valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
     17                 valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
     18                 %}}}
     19         end
     20         methods
     21                 function cluster=larsen(varargin) % {{{1
     22                         options=pairoptions(varargin{:});
     23                         for i=1:size(options.list,1),
     24                                 fieldname=options.list{i,1};
     25                                 fieldvalue=options.list{i,2};
     26                                 if ismember(fieldname,properties(larsen)),
     27                                         cluster.(fieldname)=fieldvalue;
     28                                 else
     29                                         disp(['''' fieldname ''' is not a property of cluster larsen']);
     30                                 end
     31                         end
     32                 end
     33                 %}}}
     34                 function disp(cluster) % {{{1
     35                         %  display the object
     36                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     37                         disp(sprintf('    name: %s',cluster.name));
     38                         disp(sprintf('    login: %s',cluster.login));
     39                         disp(sprintf('    np: %i',cluster.np));
     40                         disp(sprintf('    port: %i',cluster.port));
     41                         disp(sprintf('    codepath: %s',cluster.codepath));
     42                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     43                         disp(sprintf('    valgrind: %s',cluster.valgrind));
     44                         disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
     45                         disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
     46                 end
     47                 %}}}
     48                 function IsConsistent(cluster) % {{{1
     49                         if cluster.np>8,
     50                                 error('IsConsistent error message: number of processors should be lest than 16!');
     51                         end
     52                         if isnan(cluster.np),
     53                                 error('IsConsistent error message: number of processors should not be NaN!');
     54                         end
     55                 end
     56                 %}}}
     57                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    4658
    47                 %write instructions for launching a job on the cluster
    48                 fprintf(fid,'#!/bin/sh\n');
    49                 if mem_debug==0,
    50                         fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    51                 else
    52                         %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    53                         fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup, md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    54                 end
     59                         %open file for writing:
     60                         fid=fopen([modelname '.queue'],'w');
    5561
    56                 %close file
    57                 fclose(fid);
     62                         %write instructions for launching a job on the cluster
     63                         fprintf(fid,'#!/bin/sh\n');
     64                         if mem_debug==0,
     65                                 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     66                         else
     67                                 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     68                                 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     69                         end
    5870
    59                 end
    60                 %}}}
    61                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    62                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
    63                 end
    64                 %}}}
     71                         %close file
     72                         fclose(fid);
     73
     74                 end
     75                 %}}}
     76                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     77                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
     78                 end
     79                 %}}}
    6580        end
    6681end
  • issm/trunk/src/m/clusters/none.m

    r5956 r5980  
    99    end
    1010    methods
    11                 function []=disp(md) % {{{1
    12                 %  display the object
    13                 disp(sprintf('cluster class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    14                 disp(sprintf('    name: %s',md.name));
    15                 end
    16                 %}}}
    17                 function IsConsistent(md) % {{{1
    18                 end
    19                 %}}}
    20                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    21                 error('none.BuildQueueScript error message: serial cluster cannot build queue script');
    22                 end
    23                 %}}}
     11                 function cluster=none(varargin) % {{{1
     12                         options=pairoptions(varargin{:});
     13                         for i=1:size(options.list,1),
     14                                 fieldname=options.list{i,1};
     15                                 fieldvalue=options.list{i,2};
     16                                 if ismember(fieldname,properties(none)),
     17                                         cluster.(fieldname)=fieldvalue;
     18                                 else
     19                                         disp(['''' fieldname ''' is not a property of cluster none']);
     20                                 end
     21                         end
     22                 end
     23                 %}}}
     24                 function disp(cluster) % {{{1
     25                         %  display the object
     26                         disp(sprintf('cluster class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     27                         disp(sprintf('    name: %s',cluster.name));
     28                 end
     29                 %}}}
     30                 function IsConsistent(cluster) % {{{1
     31                 end
     32                 %}}}
     33                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
     34                         error('none.BuildQueueScript error message: serial cluster cannot build queue script');
     35                 end
     36                 %}}}
    2437        end
    2538end
  • issm/trunk/src/m/clusters/pfe.m

    r5963 r5980  
    66classdef pfe
    77    properties (SetAccess=public) 
    8                 % {{{1
    9                 name='pfe'
    10                 numnodes=20;
    11                 cpuspernode=8;
    12                 queue='long';
    13                 time=12*60;
    14                 processor='neh';
    15                 codepath='/staff/elarour/trunk/bin';
    16                 executionpath='/nobackupp10/elarour/Testing';
    17                 login='elarour';
    18                 port=1025;
    19         end
    20     properties (SetAccess=private)
    21                 np=20*8;
    22                 %}}}
    23     end
    24     methods
    25                 function []=disp(md) % {{{1
    26                 %  display the object
    27                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    28                 disp(sprintf('    name: %s',md.name));
    29                 disp(sprintf('    numnodes: %i',md.numnodes));
    30                 disp(sprintf('    cpuspernode: %i',md.cpuspernode));
    31                 disp(sprintf('    np: %i',md.cpuspernode*md.numnodes));
    32                 disp(sprintf('    queue: %s',md.queue));
    33                 disp(sprintf('    time: %i',md.time));
    34                 disp(sprintf('    processor: %s',md.processor));
    35                 disp(sprintf('    codepath: %s',md.codepath));
    36                 disp(sprintf('    executionpath: %s',md.executionpath));
    37                 end
    38                 %}}}
    39                 function IsConsistent(md) % {{{1
     8                 % {{{1
     9                 name='pfe'
     10                 login='elarour';
     11                 numnodes=20;
     12                 cpuspernode=8;
     13                 port=1025;
     14                 queue='long';
     15                 time=12*60;
     16                 processor='neh';
     17                 codepath='/staff/elarour/trunk/bin';
     18                 executionpath='/nobackupp10/elarour/Testing';
     19         end
     20         properties (SetAccess=private)
     21                 np=20*8;
     22                 % }}}
     23         end
     24         methods
     25                 function cluster=pfe(varargin) % {{{1
     26                         options=pairoptions(varargin{:});
     27                         for i=1:size(options.list,1),
     28                                 fieldname=options.list{i,1};
     29                                 fieldvalue=options.list{i,2};
     30                                 if ismember(fieldname,properties(pfe)),
     31                                         cluster.(fieldname)=fieldvalue;
     32                                 else
     33                                         disp(['''' fieldname ''' is not a property of cluster pfe']);
     34                                 end
     35                         end
     36                 end
     37                 %}}}
     38                 function disp(cluster) % {{{1
     39                         %  display the object
     40                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     41                         disp(sprintf('    name: %s',cluster.name));
     42                         disp(sprintf('    login: %s',cluster.login));
     43                         disp(sprintf('    port: %i',cluster.port));
     44                         disp(sprintf('    numnodes: %i',cluster.numnodes));
     45                         disp(sprintf('    cpuspernode: %i',cluster.cpuspernode));
     46                         disp(sprintf('    np: %i',cluster.cpuspernode*cluster.numnodes));
     47                         disp(sprintf('    queue: %s',cluster.queue));
     48                         disp(sprintf('    time: %i',cluster.time));
     49                         disp(sprintf('    processor: %s',cluster.processor));
     50                         disp(sprintf('    codepath: %s',cluster.codepath));
     51                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     52                 end
     53                 %}}}
     54                 function IsConsistent(cluster) % {{{1
    4055
    41                         available_queues={'long'};
    42                         queue_requirements_time=[7200];
    43                         queue_requirements_np=[2048];
     56                         available_queues={'long'};
     57                         queue_requirements_time=[7200];
     58                         queue_requirements_np=[2048];
    4459
    45                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,md.queue,md.np,md.time)
     60                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
    4661
    47                         %now, check md.cpuspernode according to processor type
    48                         if (strcmpi(md.processor,'har') | strcmpi(md.processor,'neh')),
    49                                 if ((md.cpuspernode>8 ) | (md.cpuspernode<1)),
    50                                         error('IsConsistent error message: cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
    51                                 end
    52                         elseif strcmpi(md.processor,'wes'),
    53                                 if ((md.cpuspernode>12 ) | (md.cpuspernode<1)),
    54                                         error('IsConsistent error message: cpuspernode should be between 1 and 12 for ''wes'' processors');
    55                                 end
    56                         else
    57                                 error('IsConsistent error message: unknown processor type, should be ''neh'',''wes'' or ''har''');
    58                         end
     62                         %now, check cluster.cpuspernode according to processor type
     63                         if (strcmpi(cluster.processor,'har') | strcmpi(cluster.processor,'neh')),
     64                                 if ((cluster.cpuspernode>8 ) | (cluster.cpuspernode<1)),
     65                                         error('IsConsistent error message: cpuspernode should be between 1 and 8 for ''neh'' and ''har'' processors');
     66                                 end
     67                         elseif strcmpi(cluster.processor,'wes'),
     68                                 if ((cluster.cpuspernode>12 ) | (cluster.cpuspernode<1)),
     69                                         error('IsConsistent error message: cpuspernode should be between 1 and 12 for ''wes'' processors');
     70                                 end
     71                         else
     72                                 error('IsConsistent error message: unknown processor type, should be ''neh'',''wes'' or ''har''');
     73                         end
    5974
    60                 end
    61                 %}}}
    62                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
     75                 end
     76                 %}}}
     77                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    6378
    64                         %compute number of processors
    65                         md.np=md.numnodes*md.cpuspernode;
    66                        
    67                         %open file for writing:
    68                         fid=fopen([modelname '.queue'],'w');
     79                         %compute number of processors
     80                         cluster.np=cluster.numnodes*cluster.cpuspernode;
    6981
    70                         fprintf(fid,'#PBS -S /bin/bash\n');
    71                         fprintf(fid,'#PBS -N %s\n',modelname);
    72                         fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',md.numnodes,md.cpuspernode,md.processor);
    73                         fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds.
    74                         fprintf(fid,'#PBS -W group_list=s1010\n');
    75                         fprintf(fid,'#PBS -m e\n');
    76                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    77                         fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
     82                         %open file for writing:
     83                         fid=fopen([modelname '.queue'],'w');
    7884
    79                         fprintf(fid,'. /usr/share/modules/init/bash\n\n');
     85                         fprintf(fid,'#PBS -S /bin/bash\n');
     86                         fprintf(fid,'#PBS -N %s\n',modelname);
     87                         fprintf(fid,'#PBS -l select=%i:ncpus=%i:model=%s\n',cluster.numnodes,cluster.cpuspernode,cluster.processor);
     88                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
     89                         fprintf(fid,'#PBS -W group_list=s1010\n');
     90                         fprintf(fid,'#PBS -m e\n');
     91                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
     92                         fprintf(fid,'#PBS -e %s.errlog \n\n',modelname);
    8093
    81                         fprintf(fid,'module load comp-intel/11.1.046\n');
    82                         fprintf(fid,'module load mpi/mpt.1.25\n');
    83                         fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
     94                         fprintf(fid,'. /usr/share/modules/init/bash\n\n');
    8495
    85                         fprintf(fid,'export PATH="$PATH:."\n\n');
    86                         fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
     96                         fprintf(fid,'module load comp-intel/11.1.046\n');
     97                         fprintf(fid,'module load mpi/mpt.1.25\n');
     98                         fprintf(fid,'module load math/intel_mkl_64_10.0.011\n\n');
    8799
    88                         fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
     100                         fprintf(fid,'export PATH="$PATH:."\n\n');
     101                         fprintf(fid,'export MPI_GROUP_MAX=64\n\n');
    89102
    90                         fprintf(fid,'mpiexec -verbose -np %i %s/issm.exe %s $PBS_O_WORKDIR %s.bin %s.petsc %s.outbin %s.lock',md.np,md.codepath,EnumToString(analysis_type),modelname,modelname,modelname,modelname);
     103                         fprintf(fid,'cd $PBS_O_WORKDIR\n\n');
    91104
    92                         %close file
    93                         fclose(fid);
     105                         fprintf(fid,'mpiexec -verbose -np %i %s/issm.exe %s $PBS_O_WORKDIR %s.bin %s.petsc %s.outbin %s.lock',cluster.np,cluster.codepath,EnumToString(analysis_type),modelname,modelname,modelname,modelname);
    94106
    95                 end
    96                 %}}}
    97                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    98                         command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
    99                 end
    100                 %}}}
     107                         %close file
     108                         fclose(fid);
     109
     110                 end
     111                 %}}}
     112                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     113                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
     114                 end
     115                 %}}}
    101116        end
    102117end
  • issm/trunk/src/m/clusters/pollux.m

    r5963 r5980  
    66classdef pollux
    77    properties (SetAccess=public)
    8         % {{{1
    9                 name='pollux'
    10                 np   =128; %number of processors
    11                 queue='shortp';
    12                 time=180;
    13                 codepath='/workc/edw/larour/issm-2.0/bin'
    14                 executionpath='/workc/edw/larour/Testing/Execution'
    15                 login='larour';
    16                 port=0;
    17         %}}}
    18     end
    19     methods
    20                 function []=disp(md) % {{{1
    21                 %  display the object
    22                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    23                 disp(sprintf('    name: %s',md.name));
    24                 disp(sprintf('    np: %i',md.np));
    25                 disp(sprintf('    queue: %s',md.queue));
    26                 disp(sprintf('    time: %i',md.time));
    27                 disp(sprintf('    codepath: %s',md.codepath));
    28                 disp(sprintf('    executionpath: %s',md.executionpath));
    29                 end
    30                 %}}}
    31                 function IsConsistent(md) % {{{1
     8                 % {{{1
     9                 name='pollux'
     10                 login='larour';
     11                 np=128;
     12                 port=0;
     13                 queue='shortp';
     14                 time=180;
     15                 codepath='/workc/edw/larour/issm-2.0/bin'
     16                 executionpath='/workc/edw/larour/Testing/Execution'
     17                 %}}}
     18         end
     19         methods
     20                 function cluster=pollux(varargin) % {{{1
     21                         options=pairoptions(varargin{:});
     22                         for i=1:size(options.list,1),
     23                                 fieldname=options.list{i,1};
     24                                 fieldvalue=options.list{i,2};
     25                                 if ismember(fieldname,properties(pollux)),
     26                                         cluster.(fieldname)=fieldvalue;
     27                                 else
     28                                         disp(['''' fieldname ''' is not a property of cluster pollux']);
     29                                 end
     30                         end
     31                 end
     32                 %}}}
     33                 function disp(cluster) % {{{1
     34                         %  display the object
     35                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     36                         disp(sprintf('    name: %s',cluster.name));
     37                         disp(sprintf('    login: %s',cluster.login));
     38                         disp(sprintf('    port: %i',cluster.port));
     39                         disp(sprintf('    np: %i',cluster.np));
     40                         disp(sprintf('    queue: %s',cluster.queue));
     41                         disp(sprintf('    time: %i',cluster.time));
     42                         disp(sprintf('    codepath: %s',cluster.codepath));
     43                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     44                 end
     45                 %}}}
     46                 function IsConsistent(cluster) % {{{1
    3247
    33                 available_queues={'shortp','longp'};
    34                 queue_requirements_time=[180 720];
    35                 queue_requirements_np=[128 128];
     48                         available_queues={'shortp','longp'};
     49                         queue_requirements_time=[180 720];
     50                         queue_requirements_np=[128 128];
    3651
    37                 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,md.queue,md.np,md.time)
    38                 end
    39                 %}}}
    40                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    41                
    42                 %open file for writing:
    43                 fid=fopen([modelname '.queue'],'w');
    44                
    45                 fprintf(fid,'#!/bin/sh\n');
    46                 fprintf(fid,'#PBS -l walltime=%i\n',md.time*60); %walltime is in seconds.
    47                 fprintf(fid,'#PBS -N %s\n',modelname);
    48                 fprintf(fid,'#PBS -l ncpus=%i\n',md.np);
    49                 if ~isempty(queue),
    50                         fprintf(fid,'#PBS -q %s\n',md.queue);
    51                 end
    52                 fprintf(fid,'#PBS -o %s.outlog \n',modelname);
    53                 fprintf(fid,'#PBS -e %s.errlog \n',modelname);
     52                         QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time)
     53                 end
     54                 %}}}
     55                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    5456
    55                 fprintf(fid,'export PBS_O_WORKDIR=%s\n',md.executionpath);
    56                 fprintf(fid,'cd $PBS_O_WORKDIR\n');
    57                 fprintf(fid,'export OMP_NUM_THREADS=1\n');
    58                 fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',md.np-1,md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname);
     57                         %open file for writing:
     58                         fid=fopen([modelname '.queue'],'w');
    5959
    60                 %close file
    61                 fclose(fid);
     60                         fprintf(fid,'#!/bin/sh\n');
     61                         fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds.
     62                         fprintf(fid,'#PBS -N %s\n',modelname);
     63                         fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np);
     64                         if ~isempty(queue),
     65                                 fprintf(fid,'#PBS -q %s\n',cluster.queue);
     66                         end
     67                         fprintf(fid,'#PBS -o %s.outlog \n',modelname);
     68                         fprintf(fid,'#PBS -e %s.errlog \n',modelname);
    6269
    63                 end
    64                 %}}}
    65                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    66                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
    67                 end
    68                 %}}}
     70                         fprintf(fid,'export PBS_O_WORKDIR=%s\n',cluster.executionpath);
     71                         fprintf(fid,'cd $PBS_O_WORKDIR\n');
     72                         fprintf(fid,'export OMP_NUM_THREADS=1\n');
     73                         fprintf(fid,'dplace -s1 -c0-%i mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock',cluster.np-1,cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname);
     74
     75                         %close file
     76                         fclose(fid);
     77
     78                 end
     79                 %}}}
     80                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     81                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && qsub ' modelname '.queue '];
     82                 end
     83                 %}}}
    6984        end
    7085end
  • issm/trunk/src/m/clusters/wilkes.m

    r5963 r5980  
    88        % {{{1
    99                name='wilkes'
    10         np   =7; %number of processors
     10                login='larour';
     11                np=7;
     12                port=0;
    1113                codepath=[issmdir() '/bin'];
    1214                executionpath=[issmdir() '/../execution'];
     
    1416                valgrindlib=[issmdir() '/externalpackages/valgrind/install/lib/libmpidebug.so'];
    1517                valgrindsup=[issmdir() '/externalpackages/valgrind/issm.supp'];
    16                 login='larour';
    17                 port=0;
    1818        %}}}
    1919    end
    2020    methods
    21                 function []=disp(md) % {{{1
    22                 %  display the object
    23                 disp(sprintf('class ''%s'' object ''%s'' = ',class(md),inputname(1)));
    24                 disp(sprintf('    name: %s',md.name));
    25                 disp(sprintf('    np: %i',md.np));
    26                 disp(sprintf('    codepath: %s',md.codepath));
    27                 disp(sprintf('    executionpath: %s',md.executionpath));
    28                 disp(sprintf('    valgrind: %s',md.valgrind));
    29                 disp(sprintf('    valgrindlib: %s',md.valgrindlib));
    30                 disp(sprintf('    valgrindsup: %s',md.valgrindsup));
    31                 end
    32                 %}}}
    33                 function IsConsistent(md) % {{{1
    34                         if md.np>8,
    35                                 error('IsConsistent error message: number of processors should be lest than 16!');
    36                         end
    37                         if isnan(md.np),
    38                                 error('IsConsistent error message: number of processors should not be NaN!');
    39                         end
    40                 end
    41                 %}}}
    42                 function BuildQueueScript(md,modelname,analysis_type,mem_debug) % {{{1
    43                
    44                 %open file for writing:
    45                 fid=fopen([modelname '.queue'],'w');
     21                 function cluster=wilkes(varargin) % {{{1
     22                         options=pairoptions(varargin{:});
     23                         for i=1:size(options.list,1),
     24                                 fieldname=options.list{i,1};
     25                                 fieldvalue=options.list{i,2};
     26                                 if ismember(fieldname,properties(wilkes)),
     27                                         cluster.(fieldname)=fieldvalue;
     28                                 else
     29                                         disp(['''' fieldname ''' is not a property of cluster wilkes']);
     30                                 end
     31                         end
     32                 end
     33                 %}}}
     34                 function disp(cluster) % {{{1
     35                         %  display the object
     36                         disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1)));
     37                         disp(sprintf('    name: %s',cluster.name));
     38                         disp(sprintf('    login: %s',cluster.login));
     39                         disp(sprintf('    np: %i',cluster.np));
     40                         disp(sprintf('    port: %i',cluster.port));
     41                         disp(sprintf('    codepath: %s',cluster.codepath));
     42                         disp(sprintf('    executionpath: %s',cluster.executionpath));
     43                         disp(sprintf('    valgrind: %s',cluster.valgrind));
     44                         disp(sprintf('    valgrindlib: %s',cluster.valgrindlib));
     45                         disp(sprintf('    valgrindsup: %s',cluster.valgrindsup));
     46                 end
     47                 %}}}
     48                 function IsConsistent(cluster) % {{{1
     49                         if cluster.np>8,
     50                                 error('IsConsistent error message: number of processors should be lest than 16!');
     51                         end
     52                         if isnan(cluster.np),
     53                                 error('IsConsistent error message: number of processors should not be NaN!');
     54                         end
     55                 end
     56                 %}}}
     57                 function BuildQueueScript(cluster,modelname,analysis_type,mem_debug) % {{{1
    4658
    47                 %write instructions for launching a job on the cluster
    48                 fprintf(fid,'#!/bin/sh\n');
    49                 if mem_debug==0,
    50                         fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.np,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    51                 else
    52                         %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup,md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    53                         fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',md.valgrindlib,md.np,md.valgrind,md.valgrindsup, md.codepath,EnumToString(analysis_type),md.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
    54                 end
     59                         %open file for writing:
     60                         fid=fopen([modelname '.queue'],'w');
    5561
    56                 %close file
    57                 fclose(fid);
     62                         %write instructions for launching a job on the cluster
     63                         fprintf(fid,'#!/bin/sh\n');
     64                         if mem_debug==0,
     65                                 fprintf(fid,'mpirun -np %i %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.np,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     66                         else
     67                                 %fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --gen-suppressions=all --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup,cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     68                                 fprintf(fid,'LD_PRELOAD=%s mpirun -np %i %s --leak-check=full --suppressions=%s %s/issm.exe %s %s %s.bin %s.petsc %s.outbin %s.lock  2> %s.errlog >%s.outlog & ',cluster.valgrindlib,cluster.np,cluster.valgrind,cluster.valgrindsup, cluster.codepath,EnumToString(analysis_type),cluster.executionpath,modelname,modelname,modelname,modelname,modelname,modelname);
     69                         end
    5870
    59                 end
    60                 %}}}
    61                 function command=LaunchCommand(md,modelruntimename,modelname)% {{{1
    62                 command=['cd ' md.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
    63                 end
    64                 %}}}
     71                         %close file
     72                         fclose(fid);
     73
     74                 end
     75                 %}}}
     76                 function command=LaunchCommand(cluster,modelruntimename,modelname)% {{{1
     77                         command=['cd ' cluster.executionpath ' && rm -rf ./' modelruntimename ' && mkdir ' modelruntimename ' && cd ' modelruntimename ' && mv ../' modelruntimename '.tar.gz ./ && tar -zxf ' modelruntimename '.tar.gz  && source  ' modelname '.queue '];
     78                 end
     79                 %}}}
    6580        end
    6681end
Note: See TracChangeset for help on using the changeset viewer.