Changeset 575 for branches/libIGCM_MPI_OpenMP
- Timestamp:
- 03/08/12 17:28:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libIGCM_MPI_OpenMP/libIGCM_sys/libIGCM_sys_titane.ksh
r571 r575 1864 1864 else 1865 1865 1866 # Then first loop on the components for the coupler ie oasis 1867 1868 ### the coupler ie oasis must be the first one 1866 # Then first loop on the components for the coupler ie oasis 1867 1868 ## the coupler ie oasis must be the first one 1869 for comp in ${config_ListOfComponents[*]} ; do 1870 1871 eval ExeNameOut=\${config_Executable_${comp}[1]} 1872 1873 # for CPL component only 1874 if [ "X${comp}" = "XCPL" ] ; then 1875 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1876 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1877 fi 1878 done 1879 1880 # Then second loop on the components 1881 1882 for comp in ${config_ListOfComponents[*]} ; do 1883 1884 eval ExeNameOut=\${config_Executable_${comp}[1]} 1885 1886 # Only if we really have an executable for the component and not the coupler ie oasis: 1887 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then 1888 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1889 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1890 fi 1891 done 1892 IGCM_sys_Chmod u+x run_file 1893 1894 EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file" 1895 1896 fi 1897 1898 else # Only one executable. launch it. 1899 1869 1900 for comp in ${config_ListOfComponents[*]} ; do 1901 1902 # Only if we really have an executable for the component : 1903 eval ExeNameOut=\${config_Executable_${comp}[1]} 1904 if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then 1870 1905 1871 eval ExeNameOut=\${config_Executable_${comp}[1]} 1872 1873 # for CPL component only 1874 if [ "X${comp}" = "XCPL" ] ; then 1875 1876 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1877 1878 if ( ${OK_PARA_MPI} ) ; then 1879 (( mpi_count = 1 )) 1880 until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do 1881 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file 1882 (( mpi_count = mpi_count + 1 )) 1883 done 1884 else 1885 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1886 fi 1887 fi 1906 echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 1907 echo "" >> script_${ExeNameOut}.ksh 1908 if ( ${OK_PARA_OMP} ) ; then 1909 echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh 1910 fi 1911 if ( ${OK_PARA_MPI} ) ; then 1912 # Default : mpirun used if nb_proc gt 1 1913 # pour sortie out/err par process 1914 # echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}" >> script_${ExeNameOut}.ksh 1915 echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 1916 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1917 EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh" 1918 else 1919 # Default : mpirun is NOT used if nb_proc eq 1 1920 # pour sortie out/err par process 1921 # echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> script_${ExeNameOut}.ksh 1922 echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 1923 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1924 EXECUTION="time ./script_${ExeNameOut}.ksh" 1925 fi 1926 fi 1888 1927 done 1889 1890 # Then second loop on the components 1891 1892 for comp in ${config_ListOfComponents[*]} ; do 1893 1894 eval ExeNameOut=\${config_Executable_${comp}[1]} 1895 1896 # Only if we really have an executable for the component and not the coupler ie oasis: 1897 if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${comp}" != "XCPL" ] ) ; then 1898 1899 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1900 1901 if ( ${OK_PARA_MPI} ) ; then 1902 1903 (( mpi_count = 1 )) 1904 until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do 1905 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut}" >> run_file 1906 (( mpi_count = mpi_count + 1 )) 1907 done 1908 else 1909 echo "-np ${comp_proc_mpi_loc} ./${ExeNameOut} " >> run_file 1910 fi 1911 fi 1912 done 1913 IGCM_sys_Chmod u+x run_file 1914 1915 EXECUTION="${HOST_MPIRUN_COMMAND} --app ./run_file" 1916 1917 fi 1918 1919 else # Only one executable. launch it. 1920 1921 for comp in ${config_ListOfComponents[*]} ; do 1922 1923 # Only if we really have an executable for the component : 1924 eval ExeNameOut=\${config_Executable_${comp}[1]} 1925 if ( [ "X${ExeNameOut}" != X\"\" ] ) ; then 1926 1927 echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 1928 echo "" >> script_${ExeNameOut}.ksh 1929 if ( ${OK_PARA_OMP} ) ; then 1930 echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh 1931 fi 1932 if ( ${OK_PARA_MPI} ) ; then 1933 # Attention : a voir si sur 1 proc mais non // 1934 echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${OMPI_COMM_WORLD_RANK} 2>out_${ExeNameOut}.err.\${OMPI_COMM_WORLD_RANK}" >> script_${ExeNameOut}.ksh 1935 IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 1936 EXECUTION="${HOST_MPIRUN_COMMAND} ./script_${ExeNameOut}.ksh" 1937 else 1938 EXECUTION="time ./${ExeNameOut}" 1939 fi 1940 fi 1941 done 1942 1928 1943 1929 fi 1944 1930
Note: See TracChangeset
for help on using the changeset viewer.