Changeset 1734
- Timestamp:
- 10/04/19 17:36:51 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE
- Files:
-
- 3 added
- 5 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/CMakeLists.txt
r1729 r1734 10 10 enable_testing() 11 11 12 add_subdirectory(test_config)13 12 add_subdirectory(test_domain_algo) 14 13 add_subdirectory(test_scalar_algo) … … 23 22 COMMAND rm -f report.txt 24 23 COMMAND rm -f report.html 25 COMMAND cat test_config/report.txt >> report.txt26 COMMAND cat test_config/report.html >> report.html27 24 COMMAND cat test_domain_algo/report.txt >> report.txt 28 25 COMMAND cat test_domain_algo/report.html >> report.html -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/check.py
r1726 r1734 1 1 import os 2 2 import sys 3 import subprocess 3 4 4 5 5 6 from user_param import * 7 8 9 def OSinfo(runthis): 10 osstdout = subprocess.Popen(runthis, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True) 11 theInfo = osstdout.communicate()[0].strip() 12 # print(theInfo) 13 # print(osstdout.returncode) 14 # return (osstdout.returncode) 15 16 if osstdout.returncode!=0: 17 print >> sys.stderr, osstdout.returncode 18 sys.exit() 19 else: 20 print(runthis+" OK") 21 6 22 7 23 def main(): … … 57 73 configName = "config_default" 58 74 75 check_result=False 76 59 77 60 78 if not os.path.exists(configName): … … 65 83 print blue(" ****************************************************************\n") 66 84 67 os.mkdir(configName+'/setup') 85 # os.mkdir(configName+'/setup') 86 os.system("mkdir "+configName+'/setup') 68 87 os.mkdir(configName+'/tmp_reference') 69 88 os.mkdir(configName+'/xios_output') … … 85 104 h.write("Config : "+configName+"\n") 86 105 l.write("<p>Config : "+configName+"</p>") 106 endloop=False 87 107 for line in f: 88 108 line=line.strip() 89 109 line=line.rstrip() 110 111 if line.startswith("all"): 112 allfiles = os.listdir(os.getcwd()) 113 for thisfile in allfiles: 114 if thisfile.endswith(".nc") and thisfile!="dynamico_grid.nc": 115 cmd = 'mv '+thisfile + ' '+configName+'/tmp_reference/' 116 os.system(cmd) 117 118 h.write("test for "+lpurple("all NC files")+" \t"+yellow('INITIALIZED')+"\n") 119 l.write("<p>test for <font color=\"purple\">"+"all NC files"+"</font> <font color=\"darkorange\">INITIALIZED</font></p>") 120 print yellow("\n ****************************************") 121 print yellow(" ** "+"all NC files"+" is stored as temporal reference !!! **") 122 print yellow("\n ****************************************") 123 124 break 125 90 126 if not line.startswith("#") and len(line) != 0: 91 127 cmd = 'mv '+line + ' '+configName+'/tmp_reference/' … … 107 143 print blue("\n ********************************************************") 108 144 print blue(" * Directory " + repr(configName) + " already exists") 109 print blue(" * Start comparing results with (tmp)references")145 print blue(" * Start comparing results with references") 110 146 print blue(" ********************************************************\n") 111 147 112 148 tmp_ref = os.path.isdir(configName+'/tmp_reference') 113 ref = os.path.isdir(configName+'/reference') 149 ref = os.path.isdir(configName+'/reference') and not tmp_ref 114 150 115 151 if ref: … … 117 153 print blue(" | Comparing results with references |") 118 154 print blue(" =====================================\n") 119 os.system('rm -rf '+configName+'/tmp_reference/')120 tmp_ref = False121 155 path = configName+'/reference/' 122 156 elif tmp_ref: … … 124 158 print blue(" | Comparing results with NON-Validated references |") 125 159 print blue(" ===================================================\n") 126 path = ' '+configName+'/tmp_reference/'160 path = configName+'/tmp_reference/' 127 161 128 162 f=open("checkfile.def", "r") … … 138 172 line=line.rstrip() 139 173 140 if not line.startswith("#") and len(line) != 0: 141 cmd = 'cdo diffn '+ line + path + line + ' | tail -1 > diff.txt' 142 os.system(cmd) 174 if line.startswith("all") : 175 for thisfile in os.listdir(path): 176 if thisfile.endswith(".nc"): 177 cmd = 'cdo -W diffn '+ thisfile +' '+ path + thisfile + ' | tail -1 > diff.txt' 178 179 OSinfo(cmd) 180 181 if os.stat("diff.txt").st_size==0: 182 h.write("test for "+lpurple(thisfile)+" \t"+green('PASSED')+"\n") 183 l.write("<p>test for <font color=\"purple\">"+thisfile+"</font> <font color=\"green\">PASSED</font></p>") 184 print green("\n ****************************************") 185 print green(" ** "+thisfile+" is valid !!! **") 186 print green("\n ****************************************") 187 188 else: 189 g=open("diff.txt", "r") 190 for gline in g: 191 if gline.strip().startswith("0") or ":" in gline : 192 h.write("test for "+lpurple(thisfile)+" \t"+green('PASSED')+"\n") 193 l.write("<p>test for <font color=\"purple\">"+thisfile+"</font> <font color=\"green\">PASSED</font></p>") 194 print green("\n ****************************************") 195 print green(" ** "+thisfile+" is valid !!! **") 196 print green("\n ****************************************") 197 else: 198 h.write("test for "+lpurple(thisfile)+" \t"+red('FAILED')+"\n") 199 l.write("<p>test for <font color=\"purple\">"+thisfile+"</font> <font color=\"red\">FAILED</font></p>") 200 print red("\n **************************************************") 201 print red(" ** "+thisfile+" is NOT valid. Please debugging.. **") 202 print red("\n **************************************************") 203 g.close() 204 break 205 206 207 elif not line.startswith("#") and len(line) != 0: 208 cmd = 'cdo -W diffn '+ line +' '+ path + line + ' | tail -1 > diff.txt' 209 210 OSinfo(cmd) 143 211 144 212 if os.stat("diff.txt").st_size==0: … … 187 255 188 256 257 258 189 259 if __name__== "__main__": 190 260 main() -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/clean_config.sh
r1725 r1734 1 bash -c "cd test_function/test_average && rm -rf config_*" 2 bash -c "cd test_function/test_maximum && rm -rf config_*" 3 bash -c "cd test_function/test_minimum && rm -rf config_*" 4 bash -c "cd test_function/test_sum && rm -rf config_*" 1 bash -c "cd test_function && rm -rf config_*" 5 2 bash -c "cd test_scalar_algo && rm -rf config_*" 6 3 bash -c "cd test_axis_algo && rm -rf config_*" -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/config.py
r1729 r1734 34 34 nb_proc = NumberClients+NumberServers 35 35 36 # os.rename("iodef.xml", "iodef.xml.bkp") 37 38 filein = open("iodef.xml.bkp", "r") 39 fileout = open("iodef.xml.tmp", "w") 36 filein = open("../iodef.xml.template", "r") 37 fileout = open("iodef.xml", "w") #this iodef.xml has defined variables, it is not the template 40 38 for line in filein: 41 39 if 'xios::nbplSrv2' in line: line = line.replace("xios::nbplSrv2", repr(NumberPoolsServer2)) … … 48 46 filein.close() 49 47 fileout.close() 50 os.rename("iodef.xml.tmp", "iodef.xml")51 48 52 49 -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_irene.sh
r1729 r1734 50 50 51 51 export machine_name=irene 52 52 53 python user_config.py 53 54 cmake . 54 make test 55 ctest -V 56 55 57 make report -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_jz.sh
r1729 r1734 33 33 export machine_name=jeanzay 34 34 35 python user_config.py 35 # python user_config.py 36 export output=$(python user_config.py 2>&1 >/dev/null) 37 38 if [ "$output" -ne 0 ] 39 then 40 echo "user_config.py failed" 41 exit 42 else 43 echo "user_config.py OK" 44 fi 45 36 46 cmake . 37 47 ctest -V 38 48 make report 39 #./run_sub_test.sh40 49 41 50 #srun --mpi=pmi2 -K1 --multi-prog -m cyclic ./srun.conf -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/checkfile.def
r1725 r1734 1 1 all 2 2 atm_output_zoom.nc 3 3 #atm_output_inverse.nc -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/context_atm.xml
r1725 r1734 35 35 </axis> 36 36 37 <axis id="domain_Y_inverse" axis_ref="domain_Y"> 38 <inverse_axis /> 39 </axis> 40 37 41 </axis_definition> 38 42 … … 68 72 <grid id="grid_Y"> 69 73 <axis axis_ref="domain_Y" /> 74 </grid> 75 76 <grid id="grid_Y_inverse"> 77 <axis axis_ref="domain_Y_inverse" /> 70 78 </grid> 71 79 … … 391 399 <file id="atm_output_zoom" output_freq="1ts" enabled="true"> 392 400 <field field_ref="field_XY" grid_ref="grid_XY_zoom_Y" operation="instant" enabled="true"/> 401 <!-- <field field_ref="field_Y" grid_ref="grid_Y_inverse" operation="instant" enabled="true"/> --> 393 402 </file> 394 403 -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/run_sub_test.sh
r1729 r1734 11 11 cp ../default_param.py default_param.py 12 12 13 cp ../iodef.xml iodef.xml14 13 15 14 # Black 0;30 Dark Gray 1;30 … … 23 22 24 23 25 mv iodef.xml iodef.xml.bkp26 24 27 25 nb_proc=$(python sub_config.py 2>&1) … … 29 27 machine_name=jeanzay 30 28 31 echo $nb_proc29 # echo $nb_proc 32 30 if [[ ($machine_name == irene) ]] 33 31 then … … 46 44 echo "execution failed" 47 45 rm -f iodef.xml 48 mv iodef.xml.bkp iodef.xml49 46 rm -f user_param.py 50 47 rm -f default_param.py 51 48 rm -f sub_config.py 49 rm -f sub_check.py 52 50 exit 1234 53 51 fi … … 57 55 fi 58 56 59 python sub_check.py 57 check_output=$(python sub_check.py 2>&1 >/dev/null) 58 if [[ "$check_output" -ne 0 ]] 59 then 60 echo "check.py failed" 61 rm -f iodef.xml 62 rm -f user_param.py 63 rm -f default_param.py 64 rm -f sub_config.py 65 rm -f sub_check.py 66 exit 1 67 else 68 echo "check.py OK" 69 fi 70 60 71 61 72 rm -f iodef.xml 62 mv iodef.xml.bkp iodef.xml63 73 rm -f user_param.py 64 74 rm -f default_param.py 65 75 rm -f sub_config.py 76 rm -f sub_check.py -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/setup.py
r1729 r1734 121 121 dirpath = os.getcwd() 122 122 foldername = os.path.basename(os.getcwd()) 123 print(foldername)124 123 125 124 … … 137 136 g.write("import os\n") 138 137 g.write("import sys\n") 138 g.write("import subprocess\n") 139 139 g.write("def main():\n") 140 140 g.write(" os.system(\'rm -f user_param.py\')\n") -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_domain_algo/checkfile.def
r1725 r1734 1 #all 1 2 2 3 atm_output.nc -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_domain_algo/run_sub_test.sh
r1729 r1734 12 12 13 13 14 cp ../iodef.xml iodef.xml15 14 16 15 # Black 0;30 Dark Gray 1;30 … … 24 23 25 24 26 mv iodef.xml iodef.xml.bkp27 25 28 26 nb_proc=$(python sub_config.py 2>&1) … … 30 28 machine_name=jeanzay 31 29 32 echo $nb_proc30 # echo $nb_proc 33 31 if [[ ($machine_name == irene) ]] 34 32 then … … 47 45 echo "execution failed" 48 46 rm -f iodef.xml 49 mv iodef.xml.bkp iodef.xml50 47 rm -f user_param.py 51 48 rm -f default_param.py 52 49 rm -f sub_config.py 50 rm -f sub_check.py 53 51 exit 1234 54 52 fi … … 61 59 62 60 rm -f iodef.xml 63 mv iodef.xml.bkp iodef.xml64 61 rm -f user_param.py 65 62 rm -f default_param.py 66 63 rm -f sub_config.py 64 rm -f sub_check.py -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/run_sub_test.sh
r1729 r1734 11 11 cp ../default_param.py default_param.py 12 12 13 cp ../iodef.xml iodef.xml14 13 15 14 # Black 0;30 Dark Gray 1;30 … … 23 22 24 23 25 mv iodef.xml iodef.xml.bkp26 24 27 25 nb_proc=$(python sub_config.py 2>&1) … … 29 27 machine_name=jeanzay 30 28 31 echo $nb_proc29 # echo $nb_proc 32 30 if [[ ($machine_name == irene) ]] 33 31 then … … 46 44 echo "execution failed" 47 45 rm -f iodef.xml 48 mv iodef.xml.bkp iodef.xml49 46 rm -f user_param.py 50 47 rm -f default_param.py 51 48 rm -f sub_config.py 49 rm -f sub_check.py 52 50 exit 1234 53 51 fi … … 60 58 61 59 rm -f iodef.xml 62 mv iodef.xml.bkp iodef.xml63 60 rm -f user_param.py 64 61 rm -f default_param.py 65 62 rm -f sub_config.py 63 rm -f sub_check.py -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_grid_algo/run_sub_test.sh
r1729 r1734 12 12 13 13 14 cp ../iodef.xml iodef.xml15 14 16 15 # Black 0;30 Dark Gray 1;30 … … 24 23 25 24 26 mv iodef.xml iodef.xml.bkp27 25 28 26 nb_proc=$(python sub_config.py 2>&1) … … 30 28 machine_name=jeanzay 31 29 32 echo $nb_proc30 # echo $nb_proc 33 31 if [[ ($machine_name == irene) ]] 34 32 then … … 47 45 echo "execution failed" 48 46 rm -f iodef.xml 49 mv iodef.xml.bkp iodef.xml50 47 rm -f user_param.py 51 48 rm -f default_param.py 52 49 rm -f sub_config.py 50 rm -f sub_check.py 53 51 exit 1234 54 52 fi … … 61 59 62 60 rm -f iodef.xml 63 mv iodef.xml.bkp iodef.xml64 61 rm -f user_param.py 65 62 rm -f default_param.py 66 63 rm -f sub_config.py 64 rm -f sub_check.py -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/run_sub_test.sh
r1729 r1734 12 12 13 13 14 cp ../iodef.xml iodef.xml15 14 16 15 # Black 0;30 Dark Gray 1;30 … … 24 23 25 24 26 mv iodef.xml iodef.xml.bkp27 25 28 26 nb_proc=$(python sub_config.py 2>&1) … … 30 28 machine_name=jeanzay 31 29 32 echo $nb_proc30 # echo $nb_proc 33 31 if [[ ($machine_name == irene) ]] 34 32 then … … 47 45 echo "execution failed" 48 46 rm -f iodef.xml 49 mv iodef.xml.bkp iodef.xml50 47 rm -f user_param.py 51 48 rm -f default_param.py 52 49 rm -f sub_config.py 50 rm -f sub_check.py 53 51 exit 1234 54 52 fi … … 61 59 62 60 rm -f iodef.xml 63 mv iodef.xml.bkp iodef.xml64 61 rm -f user_param.py 65 62 rm -f default_param.py 66 63 rm -f sub_config.py 64 rm -f sub_check.py -
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/user_config.py
r1729 r1734 1 1 import os 2 2 import sys 3 import subprocess 3 4 4 5 def main(): … … 12 13 if folder.startswith("test_"): 13 14 test_list.append(folder) 14 os.system('cd '+folder+' && python setup.py') 15 # os.system('cd '+folder+' && python setup.py') 16 FNULL = open(os.devnull, 'w') 17 retcode = subprocess.call(['cd', folder, ' && python setup.py'], 18 stdout=FNULL, 19 stderr=subprocess.STDOUT) 20 21 if retcode!=0: 22 print >> sys.stderr, retcode 23 sys.exit() 15 24 16 25 … … 42 51 f.close 43 52 53 print >> sys.stderr, 0 54 sys.exit() 44 55 45 56 if __name__== "__main__":
Note: See TracChangeset
for help on using the changeset viewer.