source:
issm/oecreview/Archive/25834-26739/ISSM-26349-26350.diff
Last change on this file was 26740, checked in by , 3 years ago | |
---|---|
File size: 6.3 KB |
-
../trunk-jpl/test/NightlyRun/runme.m
1 1 function varargout=runme(varargin) 2 2 %RUNME - test deck for ISSM nightly runs 3 3 % 4 % In a test deck directory (test/Vertification/NightlyRun for example) 5 % The following command will launch all the existing tests: 6 % >> runme 7 % To run the tests 101 and 102: 8 % >> runme('id',[101 102]) 9 % etc... 4 % In a test deck directory (for example, test/NightlyRun) the following 5 % command will launch all existing tests, 10 6 % 7 % >> runme 8 % 9 % To run tests 101 and 102, 10 % 11 % >> runme('id',[101 102]) 12 % 11 13 % Available options: 12 14 % 'id' followed by the list of ids requested 13 15 % 'exclude' ids to be excluded from the test … … 23 25 % 'slc' : validation of slc tests 24 26 % 'thermal' : validation of thermal tests 25 27 % 'tranforcing' : validation of transient forcing tests 26 % ...27 28 % 'procedure' 'check' : run the test (default) 28 29 % 'update': update the archive 29 30 % 'valgrind': check for memory leaks (default value of md.debug.valgrind needs to be changed manually) … … 36 37 % runme; 37 38 % runme('exclude',101); 38 39 % runme('id',102,'procedure','update'); 39 40 40 % runme('procedure','valgrind','stoponerror',1,'exclude','IdFromString('Dak')); 41 % 42 % NOTE: 43 % - Will only run test scripts whose names explicitly follow the convention, 44 % 45 % test<id>.m 46 % 47 % where <id> is any integer. 48 % 41 49 42 50 %Check inputs 43 51 % {{{ … … 81 89 flist=dir;%use dir, as it seems to act OS independent 82 90 list_ids=[]; 83 91 for i=1:numel(flist), 84 if ( strncmp(flist(i).name,'test',4) &... %File name must start with 'test' 85 strncmp(fliplr(flist(i).name),fliplr('.m'),2)&... %File name must end by '.m' 86 ~strcmp(flist(i).name,'test.m')) %File name must be different than 'test.m' 87 id=str2num(flist(i).name(5:end-2)); 88 if isempty(id), 89 disp(['WARNING: ignore file ' flist(i).name ]); 90 else 91 list_ids(end+1)=eval(flist(i).name(5:end-2)); %Keep test id only (skip 'test' and '.m') 92 fname=flist(i).name; 93 if (contains(fname,'.')), %Before split, check that file name contains '.' 94 ftokens=string(split(fname,'.')); %Tokenize file name on '.' 95 if (regexp(ftokens{1},'^test[0-9]+$') &... %Basename must start with 'test' and end with a number 96 strcmp(ftokens{end},'m') ... %Extension (less '.') must be 'm' 97 ), 98 id=sscanf(ftokens{1},'test%d'); 99 if isempty(id), 100 disp(['WARNING: ignore file ' flist(i).name]); 101 else 102 list_ids(end+1)=id;%Keep test id only (strip 'test' and '.m') 103 end 92 104 end 93 105 end 94 106 end 95 [i1,i2]=parallelrange(rank,numprocs,length(list_ids)); 107 [i1,i2]=parallelrange(rank,numprocs,length(list_ids)); %Get tests for this cpu only 96 108 list_ids=list_ids(i1:i2); 97 109 98 110 test_ids=getfieldvalue(options,'id',list_ids); -
../trunk-jpl/test/NightlyRun/runme.py
2 2 import argparse 3 3 from glob import glob 4 4 import os 5 import re 5 6 from sys import float_info 6 7 from traceback import format_exc 7 8 … … 21 22 def runme(id=None, exclude=None, benchmark='nightly', procedure='check', output='none', rank=1, numprocs=1): 22 23 """RUNME - test deck for ISSM nightly runs 23 24 24 In a test deck directory ( test/NightlyRun for example),the following25 command will launch all theexisting tests,25 In a test deck directory (for example, test/NightlyRun) the following 26 command will launch all existing tests, 26 27 27 28 ./runme.py 28 29 29 To run tests 101 and 102 :30 To run tests 101 and 102, 30 31 31 32 ./runme.py -i [101, 102] 32 33 … … 33 34 Options: 34 35 -i/--id followed by the list of ids or (parts of) test names requested 35 36 NOTE: runs all tests by default 36 37 37 -e/--exclude ids or (parts of) test names to be excluded (same format as id) 38 38 NOTE: exclude does nothing if 'id' is specified with different values 39 40 39 -b/--benchmark 'all' : (all of the tests) 41 40 'nightly' : (nightly run/daily run) 42 41 'validation' : (validation) … … 49 48 'slc' : validation of slc tests 50 49 'thermal' : validation of thermal tests 51 50 'tranforcing' : validation of transient forcing tests 52 53 51 -p/--procedure 'check' : run the test (default) 54 52 'update' : update the archive 55 53 … … 64 62 ./runme.py -e 'Dakota' --benchmark 'all' 65 63 ./runme.py -i [[101, 102], ['Dakota', 'Slc']] 66 64 65 NOTE: 66 - Will only run test scripts whose names explicitly follow the convention, 67 68 test<id>.py 69 70 where <id> is any integer. 71 67 72 TODO: 68 73 - At '#disp test result', make sure precision of output matches that of 69 MATLAB. 70 - Check for failures that do not raise exceptions (for example, 'Standard exception'; see also jenkins/jenkins.sh). These should be counted as failures. 74 MATLAB. 75 - Check for failures that do not raise exceptions (for example, 'Standard 76 exception'; see also jenkins/jenkins.sh). These should be counted as 77 failures. 71 78 """ 72 79 73 80 #Get ISSM_DIR variable … … 95 102 # }}} 96 103 #GET ids {{{ 97 104 flist = glob('test*.py') #File name must start with 'test' and must end by '.py' and must be different than 'test.py' 98 list_ids = [int( file[4:-3]) for file in flist if not file == 'test.py']#Keep test id only (skip 'test' and '.py')105 list_ids = [int(re.search(r'\d+',file.split('.')[0]).group()) for file in flist if not file == 'test.py'] #Keep test id only (skip 'test' and '.py') 99 106 100 107 i1, i2 = parallelrange(rank, numprocs, len(list_ids)) #Get tests for this cpu only 101 108 list_ids = list_ids[i1:i2 + 1]
Note:
See TracBrowser
for help on using the repository browser.