Changeset 26744 for issm/trunk/src/m/classes/clusters/pollux.m
- Timestamp:
- 12/22/21 10:39:44 (3 years ago)
- Location:
- issm/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk
- Property svn:mergeinfo changed
/issm/trunk-jpl merged: 25837-25866,25868-25993,25995-26330,26332-26733,26736-26739,26741
- Property svn:mergeinfo changed
-
issm/trunk/src
- Property svn:mergeinfo changed
-
issm/trunk/src/m/classes/clusters/pollux.m
r21729 r26744 7 7 8 8 classdef pollux 9 properties (SetAccess=public) 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 9 properties (SetAccess=public) 10 % {{{ 11 name='pollux' 12 login='username'; 13 np=128; 14 port=0; 15 queue='shortp'; 16 time=180; 17 codepath='/workc/edw/issm-2.0/bin' 18 executionpath='/workc/edw/Testing/Execution' 19 %}}} 20 end 21 methods 22 function cluster=pollux(varargin) % {{{ 23 cluster=AssignObjectFields(pairoptions(varargin{:}),cluster); 24 end 25 %}}} 26 function disp(cluster) % {{{ 27 % display the object 28 disp(sprintf('class ''%s'' object ''%s'' = ',class(cluster),inputname(1))); 29 disp(sprintf(' name: %s',cluster.name)); 30 disp(sprintf(' login: %s',cluster.login)); 31 disp(sprintf(' port: %i',cluster.port)); 32 disp(sprintf(' np: %i',cluster.np)); 33 disp(sprintf(' queue: %s',cluster.queue)); 34 disp(sprintf(' time: %i',cluster.time)); 35 disp(sprintf(' codepath: %s',cluster.codepath)); 36 disp(sprintf(' executionpath: %s',cluster.executionpath)); 37 end 38 %}}} 39 function md = checkconsistency(cluster,md,solution,analyses) % {{{ 40 40 41 42 43 41 available_queues={'shortp','longp'}; 42 queue_requirements_time=[180 720]; 43 queue_requirements_np=[128 128]; 44 44 45 46 47 48 45 QueueRequirements(available_queues,queue_requirements_time,queue_requirements_np,cluster.queue,cluster.np,cluster.time) 46 end 47 %}}} 48 function BuildQueueScript(cluster,dirname,modelname,solution,io_gather,isvalgrind,isgprof,isdakota,isoceancoupling) % {{{ 49 49 50 51 50 if(isvalgrind), disp('valgrind not supported by cluster, ignoring...'); end 51 if(isgprof), disp('gprof not supported by cluster, ignoring...'); end 52 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 53 %write queuing script 54 fid=fopen([modelname '.queue'],'w'); 55 fprintf(fid,'#!/bin/sh\n'); 56 fprintf(fid,'#PBS -l walltime=%i\n',cluster.time*60); %walltime is in seconds. 57 fprintf(fid,'#PBS -N %s\n',modelname); 58 fprintf(fid,'#PBS -l ncpus=%i\n',cluster.np); 59 if ~isempty(queue), 60 fprintf(fid,'#PBS -q %s\n',cluster.queue); 61 end 62 fprintf(fid,'#PBS -o %s.outlog \n',modelname); 63 fprintf(fid,'#PBS -e %s.errlog \n',modelname); 64 fprintf(fid,'export PBS_O_WORKDIR=%s\n',[cluster.executionpath '/' dirname]); 65 fprintf(fid,'cd $PBS_O_WORKDIR\n'); 66 fprintf(fid,'export OMP_NUM_THREADS=1\n'); 67 fprintf(fid,'dplace -s1 -c0-%i mpiexec -np %i %s/issm.exe %s %s %s',cluster.np-1,cluster.np,cluster.codepath,solution,[cluster.executionpath '/' dirname],modelname); 68 fclose(fid); 69 69 70 71 72 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart)% {{{70 end 71 %}}} 72 function LaunchQueueJob(cluster,modelname,dirname,filelist,restart) % {{{ 73 73 74 75 76 77 78 79 80 81 82 83 function UploadQueueJob(cluster,modelname,dirname,filelist)% {{{74 disp('launching solution sequence on remote cluster'); 75 if ~isempty(restart) 76 launchcommand=['cd ' cluster.executionpath ' && cd ' dirname ' && qsub ' modelname '.queue ']; 77 else 78 launchcommand=['cd ' cluster.executionpath ' && rm -rf ./' dirname ' && mkdir ' dirname ... 79 ' && cd ' dirname ' && mv ../' dirname '.tar.gz ./ && tar -zxf ' dirname '.tar.gz && qsub ' modelname '.queue ']; 80 end 81 issmssh(cluster.name,cluster.login,cluster.port,launchcommand); 82 end %}}} 83 function UploadQueueJob(cluster,modelname,dirname,filelist) % {{{ 84 84 85 86 87 88 89 90 91 92 93 85 %compress the files into one zip. 86 compressstring=['tar -zcf ' dirname '.tar.gz ']; 87 for i=1:numel(filelist), 88 compressstring = [compressstring ' ' filelist{i}]; 89 end 90 if cluster.interactive, 91 compressstring = [compressstring ' ' modelname '.errlog ' modelname '.outlog ']; 92 end 93 system(compressstring); 94 94 95 96 function Download(cluster,dirname,filelist)% {{{95 end %}}} 96 function Download(cluster,dirname,filelist) % {{{ 97 97 98 99 100 98 %copy files from cluster to current directory 99 directory=[cluster.executionpath '/' dirname '/']; 100 issmscpin(cluster.name,cluster.login,cluster.port,directory,filelist); 101 101 102 102 end %}}} 103 103 end 104 104 end
Note:
See TracChangeset
for help on using the changeset viewer.