Changeset 1893 for XIOS/trunk/xios_test_suite/TEST_SUITE/step1.py
- Timestamp:
- 06/11/20 16:58:59 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/xios_test_suite/TEST_SUITE/step1.py
r1891 r1893 12 12 mode=os.getenv("mode") 13 13 arch=os.getenv("arch") 14 machine=os.getenv("xios_machine_name") 15 my_counter=1 16 portion=0 17 18 nb_proc_irene=20 # this must be >= NumberClients+NumberServers for all configs for all test folders 19 nb_proc_jz=36 # this must be >= sum(NumberClients+NumberServers) for each test folder 14 20 15 21 def OSinfo(runthis): … … 34 40 return default_param[0] 35 41 36 def generate_job_irene(fn, n): 37 with open(fn, "w") as fh: 38 fh.write("#!/bin/bash\n") 39 fh.write("#MSUB -r XIOS\n") 40 fh.write("#MSUB -eo\n") 41 fh.write("#MSUB -o client_output.out\n") 42 fh.write("#MSUB -e client_error.out\n") 43 fh.write("#MSUB -c 1\n") 44 fh.write("#MSUB -n 24\n") 45 fh.write("#MSUB -X\n") 46 fh.write("#MSUB -x\n") 47 fh.write("#MSUB -T 1800\n") 48 fh.write("#MSUB -q skylake\n") 49 fh.write("#MSUB -A gen0826\n") 50 fh.write("#MSUB -Q test\n") 51 fh.write("#MSUB -m work,scratch\n") 52 fh.write("source ../../../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 53 fh.write("ccc_mprun -n "+str(n)+" generic_testcase.exe\n") 42 def generate_job(fn, n): 43 if machine=="irene": 44 with open(fn, "w") as fh: 45 fh.write("#!/bin/bash\n") 46 fh.write("#MSUB -r XIOS\n") 47 fh.write("#MSUB -eo\n") 48 fh.write("#MSUB -o client_output.out\n") 49 fh.write("#MSUB -e client_error.out\n") 50 fh.write("#MSUB -c 1\n") 51 fh.write("#MSUB -n "+str(n)+"\n") 52 fh.write("#MSUB -X\n") 53 fh.write("#MSUB -x\n") 54 fh.write("#MSUB -T 1800\n") 55 fh.write("#MSUB -q skylake\n") 56 fh.write("#MSUB -A gen0826\n") 57 fh.write("#MSUB -Q test\n") 58 fh.write("#MSUB -m work,scratch\n") 59 fh.write("source ../../../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 60 fh.write("ccc_mprun -n "+str(n)+" generic_testcase.exe\n") 61 62 if machine=="jeanzay": 63 with open(fn, "w") as fh: 64 fh.write("#!/bin/bash\n") 65 fh.write("#SBATCH --ntasks="+str(n)+"\n") 66 fh.write("#SBATCH --hint=nomultithread\n") 67 fh.write("#SBATCH -o output.out\n") 68 fh.write("#SBATCH -e error.out\n") 69 fh.write("#SBATCH -t 00:10:00\n") 70 fh.write("#SBATCH --account=psl@cpu\n") 71 fh.write("ulimit -c 0\n") 72 fh.write("cd ${SLURM_SUBMIT_DIR}\n") 73 fh.write("source ../../../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 74 fh.write("source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt") 75 fh.write("srun generic_testcase.exe") 54 76 55 77 56 78 def update_full_job(location, n): 57 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 79 global my_counter 80 if machine=="irene": 81 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 58 82 fh.write("\ncd ${location}/"+location+"; ccc_mprun -E \'--exclusive\' -n "+str(n)+" generic_testcase.exe > output.out 2> error.out &\n") 59 83 fh.write("PIDS+=($!)\n") 60 84 fh.write("CONFIGS+=("+location+")\n") 61 85 if machine=="jeanzay": 86 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 87 fh.write("\ncd ${location}/"+location+"; srun --exclusive -n "+str(n)+" generic_testcase.exe > output.out 2> error.out &\n") 88 #fh.write("echo \"test progress "+str(my_counter*portion)+"% \"\n") 89 #my_counter = my_counter+1 62 90 63 91 def main(): 64 with open("full_job_"+arch+"_"+mode+".sh", "w") as fh: 65 fh.write("#!/bin/bash\n") 66 fh.write("#MSUB -r XIOS\n") 67 fh.write("#MSUB -eo\n") 68 fh.write("#MSUB -o client_output.out\n") 69 fh.write("#MSUB -e client_error.err\n") 70 fh.write("#MSUB -c 1\n") 71 fh.write("#MSUB -n 24\n") 72 fh.write("#MSUB -X\n") 73 fh.write("#MSUB -x\n") 74 fh.write("#MSUB -T 1800\n") 75 fh.write("#MSUB -q skylake\n") 76 fh.write("#MSUB -A gen0826\n") 77 fh.write("#MSUB -Q test\n") 78 fh.write("#MSUB -m work,scratch\n") 79 fh.write("export location="+os.getcwd()+"\n") 80 fh.write("export log_location="+os.getcwd()+"\n") 81 fh.write("source ../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 82 fh.write("echo \"parallel launch arch="+arch+" mode="+mode+"\" >> ${log_location}/Log.txt\n") 83 fh.write("date >> ${log_location}/Log.txt\n") 84 92 global portion 93 tmp_list=glob.glob("test_*/CONFIG_*") 94 nb_configs = len(tmp_list) 95 portion = 100.0/nb_configs 96 97 if machine=="irene": 98 with open("full_job_"+arch+"_"+mode+".sh", "w") as fh: 99 fh.write("#!/bin/bash\n") 100 fh.write("#MSUB -r XIOS\n") 101 fh.write("#MSUB -eo\n") 102 fh.write("#MSUB -o client_output.out\n") 103 fh.write("#MSUB -e client_error.err\n") 104 fh.write("#MSUB -c 1\n") 105 fh.write("#MSUB -n "+str(nb_proc_irene)+"\n") 106 fh.write("#MSUB -X\n") 107 fh.write("#MSUB -x\n") 108 fh.write("#MSUB -T 1800\n") 109 fh.write("#MSUB -q skylake\n") 110 fh.write("#MSUB -A gen0826\n") 111 fh.write("#MSUB -Q test\n") 112 fh.write("#MSUB -m work,scratch\n") 113 fh.write("export location="+os.getcwd()+"\n") 114 fh.write("export log_location="+os.getcwd()+"\n") 115 fh.write("source ../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 116 fh.write("echo \"parallel launch arch="+arch+" mode="+mode+"\" >> ${log_location}/Log.txt\n") 117 fh.write("date >> ${log_location}/Log.txt\n") 118 119 if machine=="jeanzay": 120 with open("full_job_"+arch+"_"+mode+".sh", "w") as fh: 121 fh.write("#!/bin/bash\n") 122 fh.write("#SBATCH --ntasks="+str(nb_proc_jz)+"\n") 123 fh.write("#SBATCH --hint=nomultithread\n") 124 fh.write("#SBATCH -t 00:10:00\n") 125 fh.write("#SBATCH --account=psl@cpu\n") 126 fh.write("ulimit -c 0\n") 127 fh.write("cd ${SLURM_SUBMIT_DIR}\n") 128 fh.write("source ../BUILD/build_"+arch+"_"+mode+"/arch.env\n") 129 fh.write("source $I_MPI_ROOT/intel64/bin/mpivars.sh release_mt\n") 130 fh.write("export location="+os.getcwd()+"\n") 131 fh.write("export log_location="+os.getcwd()+"\n") 132 fh.write("echo \"parallel launch arch="+arch+" mode="+mode+"\" >> ${log_location}/Log.txt\n") 133 fh.write("date >> ${log_location}/Log.txt\n") 134 135 136 85 137 test_folder_list = glob.glob('test_*') 86 138 all_config=dict() … … 153 205 fh.write("/\n") 154 206 155 generate_job _irene(test_folder+"/CONFIG_"+mystr+"/job.sh", full_config['NumberClients']+full_config['NumberServers'])207 generate_job(test_folder+"/CONFIG_"+mystr+"/job.sh", full_config['NumberClients']+full_config['NumberServers']) 156 208 update_full_job(test_folder+"/CONFIG_"+mystr, full_config['NumberClients']+full_config['NumberServers']) 157 209 158 210 #print(config_name) 211 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 212 fh.write("wait\nwait\n") 213 fh.write("echo \"tests in "+test_folder+" finished\"\n") 159 214 all_config[test_folder] = config_name 160 161 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 162 fh.write("\nfor pid in ${PIDS[@]}; do\n") 163 fh.write("wait ${pid}\n") 164 fh.write("STATUS+=($?)\ndone\n") 165 fh.write("\ni=0\n") 166 fh.write("#for st in ${STATUS[@]}; do\n") 167 fh.write("#if [[ ${st} -ne 0 ]]; then\n") 168 fh.write("#echo \"${CONFIGS[${i}]} -1\" >> ${location}/plain_report.txt\n") 169 fh.write("#else\n") 170 fh.write("#echo \"${CONFIGS[${i}]} 1\" >> ${location}/plain_report.txt\n") 171 fh.write("#fi\n") 172 fh.write("#((i+=1))\n") 173 fh.write("#done\n\n") 174 fh.write("#wait\n") 175 fh.write("date >> ${log_location}/Log.txt\n") 176 215 216 217 if machine=="irene": 218 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 219 fh.write("\nfor pid in ${PIDS[@]}; do\n") 220 fh.write("wait ${pid}\n") 221 fh.write("STATUS+=($?)\ndone\n") 222 fh.write("\ni=0\n") 223 fh.write("#for st in ${STATUS[@]}; do\n") 224 fh.write("#if [[ ${st} -ne 0 ]]; then\n") 225 fh.write("#echo \"${CONFIGS[${i}]} -1\" >> ${location}/plain_report.txt\n") 226 fh.write("#else\n") 227 fh.write("#echo \"${CONFIGS[${i}]} 1\" >> ${location}/plain_report.txt\n") 228 fh.write("#fi\n") 229 fh.write("#((i+=1))\n") 230 fh.write("#done\n\n") 231 fh.write("#wait\n") 232 fh.write("date >> ${log_location}/Log.txt\n") 233 if machine=="jeanzay": 234 with open("full_job_"+arch+"_"+mode+".sh", "a") as fh: 235 fh.write("date >> ${log_location}/Log.txt\n") 236 237 177 238 #print(all_config) 178 239
Note: See TracChangeset
for help on using the changeset viewer.