Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/check.py
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/check.py	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/check.py	(revision 1738)
@@ -2,7 +2,13 @@
 import sys
 import subprocess
-
-
-from user_param import *
+import socket
+import os.path
+from os import path
+
+
+from default_param import *
+from user_param import *     
+# load default_param first, variables defines in user_param will overwrite the default value 
+
 
 
@@ -17,4 +23,96 @@
 	# else:
 		# print(runthis+" OK")
+
+
+def write_jz_job(configName, nbproc=8):
+	red = lambda text: '\033[0;31m' + text + '\033[0m'
+	f=open("jz_job_"+configName+".sh", "w")
+	f.write("#!/bin/bash\n")
+	f.write("#SBATCH --ntasks="+repr(nbproc)+"              # Nombre total de processus MPI\n")
+	f.write("#SBATCH --ntasks-per-node=16\n")
+	f.write("#SBATCH --hint=nomultithread\n")
+	f.write("#SBATCH -t 00:10:00            # Temps elapsed maximum d'execution\n")
+	f.write("#SBATCH -o single_config.out     # Nom du fichier de sortie\n")
+	f.write("#SBATCH -e single_config.err     # Nom du fichier d'erreur\n")
+	f.write("#SBATCH --account=psl@cpu\n")
+	f.write("cd ${SLURM_SUBMIT_DIR}\n")
+	f.write("module purge\n")
+	f.write("module load intel-all/19.0.4\n")
+	f.write("module load netcdf/4.7.0/intel-19.0.4-mpi\n")
+	f.write("module load netcdf-cxx/4.2/intel-19.0.4-mpi\n")
+	f.write("module load netcdf-fortran/4.4.5/intel-19.0.4-mpi\n")
+	f.write("module load gcc/6.5.0/gcc-4.8.5\n")
+	f.write("module load cmake\n")
+	f.write("module load cdo\n")
+	f.write("ulimit -c 0\n")
+	f.write("export machine_name=jeanzay\n")
+	f.write("cp ../setup.py ./\n")
+	f.write("cp ../run_sub_test.sh ./\n")
+	f.write("mv user_params.def user_params.def_bkp\n")
+	f.write("cp "+configName+"/setup/user_param.py user_params.def\n")
+	f.write("python setup.py\n")
+	f.write("cmake .\n")
+	f.write("ctest -V #enable all output\n")
+	f.write("rm -f setup.py run_sub_test.sh\n")
+	f.write("rm -f run_test_*.py\n")
+	f.write("rm -f user_param.py.*\n")
+	f.write("rm -f user_param.def\n")
+	f.write("mv user_params.def_bkp user_params.def\n")
+	f.write("\n")
+	f.close
+
+
+
+def write_irene_job(configName, nbproc=8):
+	red = lambda text: '\033[0;31m' + text + '\033[0m'
+	f=open("irene_job_"+configName+".sh", "w")
+	f.write("#!/bin/bash\n")
+	f.write("#MSUB -r XIOS\n")
+	f.write("#MSUB -o client_output.out    # standard output\n")
+	f.write("#MSUB -e client_error.err    #error output\n")
+	f.write("#MSUB -eo\n")
+	f.write("#MSUB -c 1\n")
+	f.write("#MSUB -n "+ repr(nbproc) + "  # Number of MPI tasks (SPMD case) or cores (MPMD case)\n")
+	f.write("#MSUB -X \n")
+	f.write("#MSUB -x \n")
+	f.write("#MSUB -T 600      # Wall clock limit (seconds)\n")
+	f.write("#MSUB -q skylake           # thin nodes\n")
+	f.write("#MSUB -A devcmip6\n")
+	f.write("#MSUB -Q test\n")
+	f.write("#MSUB -m work\n")
+	f.write("cd $BRIDGE_MSUB_PWD\n")
+	f.write("module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu\n")
+	f.write("module load gnu\n")
+	f.write("module load mpi/intelmpi/2017.0.6.256\n")
+	f.write("module load flavor/buildcompiler/intel/17\n")
+	f.write("module load flavor/hdf5/parallel\n")
+	f.write("module load netcdf-fortran/4.4.4\n")
+	f.write("module load hdf5/1.8.20\n")
+	f.write("module load boost\n")
+	f.write("module load blitz\n")
+	f.write("module load feature/bridge/heterogenous_mpmd\n")
+	f.write("module load nco\n")
+	f.write("module load cdo\n")
+	f.write("export KMP_STACKSIZE=3g\n")
+	f.write("export KMP_LIBRARY=turnaround\n")
+	f.write("export MKL_SERIAL=YES\n")
+	f.write("export OMP_NUM_THREADS=${BRIDGE_MSUB_NCORE}\n")
+	f.write("set -x \n")
+	f.write("export machine_name=irene\n")
+	f.write("cp ../setup.py ./\n")
+	f.write("cp ../run_sub_test.sh ./\n")
+	f.write("mv user_params.def user_params.def_bkp\n")
+	f.write("cp "+configName+"/setup/user_param.py user_params.def\n")
+	f.write("python setup.py\n")
+	f.write("cmake .\n")
+	f.write("ctest -V #enable all output\n")
+	f.write("rm -f setup.py run_sub_test.sh\n")
+	f.write("rm -f run_test_*.py\n")
+	f.write("rm -f user_param.py.*\n")
+	f.write("rm -f user_param.def\n")
+	f.write("mv user_params.def_bkp user_params.def\n")
+	f.write("\n")
+	f.close
+
 
 
@@ -200,4 +298,18 @@
 									print red("\n        **************************************************")
 							g.close()
+
+						# generate job submission script
+						hostname=os.getenv('machine_name')
+
+						if hostname.startswith("jeanzay"):
+							write_jz_job(configName, NumberClients+NumberServers)
+							
+						elif hostname.startswith("irene"):
+							write_irene_job(configName, NumberClients+NumberServers)
+							
+						else :
+							print("machine unknown")
+							print >> sys.stderr, 1
+							sys.exit()
 				break
 
@@ -231,4 +343,20 @@
 							print red("\n        **************************************************")
 					g.close()
+
+				# generate job submission script
+				hostname=os.getenv('machine_name')
+
+				if hostname.startswith("jeanzay"):
+					write_jz_job(configName, NumberClients+NumberServers)
+							
+				elif hostname.startswith("irene"):
+					write_irene_job(configName, NumberClients+NumberServers)
+							
+				else :
+					print("machine unknown")
+					print >> sys.stderr, 1
+					sys.exit()
+
+
 		f.close()
 		h.write("\n")
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -51,7 +50,35 @@
 export machine_name=irene
 
-python user_config.py
+rm -f setup.sh
+touch setup.sh
+>setup.sh
+for i in $(ls -d test_*/)
+do
+  cp setup.py ${i%%/}      
+  cp run_sub_test.sh ${i%%/}      
+  echo "bash -c \"cd " ${i%%/} " && python setup.py\" ">> setup.sh
+  echo "echo \"setup.py called from " ${i%%/} "\"">> setup.sh
+done
+
+export output=$(python user_config.py 2>&1 >/dev/null)
+
+if [ "$output" -ne 0 ]
+then
+	echo "user_config.py failed"
+	exit
+else
+	echo "user_config.py OK"
+fi
+
+
 cmake .
-ctest -V
+ctest -V 
+#ctest --output-on-failure
+make report
 
-make report
+
+rm -f test_*/setup.py
+rm -f test_*/run_sub_test.sh
+rm -f test_*/run_test_*.py
+rm -f test_*/CMakeLists.txt
+
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_jz.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_jz.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/job_jz.sh	(revision 1738)
@@ -58,6 +58,6 @@
 
 cmake .
-# ctest -V 
-ctest --output-on-failure
+ctest -V 
+#ctest --output-on-failure
 make report
 
@@ -73,2 +73,4 @@
 
 
+	# bj98et@eduroam.cnrs.fr
+	# corsez filez doutez isbas
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/setup.py
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/setup.py	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/setup.py	(revision 1738)
@@ -130,5 +130,5 @@
 
 		f.write("set_tests_properties("+foldername+"_config"+repr(x)+" PROPERTIES\n")
-		f.write("                      FAIL_REGULAR_EXPRESSION \"check.py failed;execution failed;failed;setup.sh failed\")\n\n")
+		f.write("                      FAIL_REGULAR_EXPRESSION \"check.py failed;execution failed;failed;setup.sh failed; machine unknown\")\n\n")
 
 		g=open("run_test_"+repr(x)+".py", "w")
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_axis_algo/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -49,6 +48,16 @@
 #ccc_mprun tau_exec -io ../../bin/test_send.exe
 #ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe
+cp ../setup.py ./
+cp ../run_sub_test.sh ./
+
 python setup.py
 
 cmake .
-make test
+
+#ctest --output-on-failure #enable output only when test failed
+
+ctest -V #enable all output
+
+rm -f setup.py run_sub_test.sh
+rm -f run_test_*.py
+rm -f user_param.py.*
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_domain_algo/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_domain_algo/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_domain_algo/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -49,5 +48,16 @@
 #ccc_mprun tau_exec -io ../../bin/test_send.exe
 #ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe
+cp ../setup.py ./
+cp ../run_sub_test.sh ./
+
 python setup.py
+
 cmake .
-make test
+
+#ctest --output-on-failure #enable output only when test failed
+
+ctest -V #enable all output
+
+rm -f setup.py run_sub_test.sh
+rm -f run_test_*.py
+rm -f user_param.py.*
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_function/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -48,5 +47,16 @@
 #ccc_mprun tau_exec -io ../../bin/test_send.exe
 #ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe
+cp ../setup.py ./
+cp ../run_sub_test.sh ./
+
 python setup.py
+
 cmake .
-make test
+
+#ctest --output-on-failure #enable output only when test failed
+
+ctest -V #enable all output
+
+rm -f setup.py run_sub_test.sh
+rm -f run_test_*.py
+rm -f user_param.py.*
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_grid_algo/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_grid_algo/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_grid_algo/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -49,5 +48,16 @@
 #ccc_mprun tau_exec -io ../../bin/test_send.exe
 #ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe
+cp ../setup.py ./
+cp ../run_sub_test.sh ./
+
 python setup.py
+
 cmake .
-make test
+
+#ctest --output-on-failure #enable output only when test failed
+
+ctest -V #enable all output
+
+rm -f setup.py run_sub_test.sh
+rm -f run_test_*.py
+rm -f user_param.py.*
Index: XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job_irene.sh
===================================================================
--- XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job_irene.sh	(revision 1737)
+++ XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/test_scalar_algo/job_irene.sh	(revision 1738)
@@ -22,5 +22,4 @@
 module load mpi/intelmpi/2017.0.6.256
 module load flavor/buildcompiler/intel/17
-#module load flavor/buildmpi/intelmpi/2017
 module load flavor/hdf5/parallel
 module load netcdf-fortran/4.4.4
@@ -49,5 +48,16 @@
 #ccc_mprun tau_exec -io ../../bin/test_send.exe
 #ddt -start -n 8 ../buile_intelmpi/bin/test_omp.exe
+cp ../setup.py ./
+cp ../run_sub_test.sh ./
+
 python setup.py
+
 cmake .
-make test
+
+#ctest --output-on-failure #enable output only when test failed
+
+ctest -V #enable all output
+
+rm -f setup.py run_sub_test.sh
+rm -f run_test_*.py
+rm -f user_param.py.*
