Changeset 939 for trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
- Timestamp:
- 08/23/13 11:38:24 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libIGCM/libIGCM_config/libIGCM_config.ksh
r933 r939 30 30 # Read libIGCM compatibility version in config.card 31 31 IGCM_card_DefineVariableFromOption ${configPath} Compatibility libIGCM 32 eval CompatibilityTag=${config_Compatibility_libIGCM} > /dev/null 2>&132 CompatibilityTag=${config_Compatibility_libIGCM} 33 33 34 34 if [ ! "${CompatibilityTag}" = "${libIGCM_CurrentTag}" ] ; then … … 228 228 echo 229 229 IGCM_debug_Print 2 "Define Script_Output_Prefix and Exe_Output" 230 evalScript_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'}230 Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'} 231 231 IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}" 232 evalExe_Output=out_execution232 Exe_Output=out_execution 233 233 IGCM_debug_Print 3 "Exe_Output = ${Exe_Output}" 234 234 … … 571 571 IGCM_config_DaysInPeriodLength 572 572 573 eval PeriodDateBegin=${DateBegin} > /dev/null 2>&1573 PeriodDateBegin=${DateBegin} 574 574 PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( ${PeriodLengthInDays} - 1 )) ) 575 eval CumulPeriod=1 > /dev/null 2>&1575 CumulPeriod=1 576 576 577 577 #=================================================# … … 616 616 PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} ) 617 617 PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} ) 618 eval CumulPeriod="${run_Configuration_CumulPeriod}" > /dev/null 2>&1618 CumulPeriod=${run_Configuration_CumulPeriod} 619 619 620 620 LastPeriodDateEnd=$( echo ${run_Configuration_OldPrefix} | sed -e "s/${config_UserChoices_JobName}_//" ) … … 756 756 757 757 # Period for save files 758 eval DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd} > /dev/null 2>&1758 DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd} 759 759 760 760 # Prefix for save files of this period 761 eval PREFIX=${config_UserChoices_JobName}_${DatesPeriod} > /dev/null 2>&1761 PREFIX=${config_UserChoices_JobName}_${DatesPeriod} 762 762 763 763 # List of files that will be deleted in RUN_DIR after run … … 782 782 fi 783 783 784 typeset ExeNameIn ExeNameFirst CompNameFirst 785 typeset comp i 786 typeset tempvar tempvarMPI tempvarNOD NbElts j NbExec 787 788 (( PROCESSUS_NUMBER = 0 )) 789 (( i=0 )) 790 (( NbExec=0 )) 784 #================================================================# 785 # Prepare variables available for binary execution # 786 #================================================================# 787 788 typeset ExeNameIn ExeNameFirst CompNameFirst comp i j 789 typeset tempvar tempvarMPI tempvarNOD NbElts NbExec 790 791 PROCESSUS_NUMBER=0 792 NbExec=0 793 i=0 791 794 792 795 OK_PARA_MPI=false … … 814 817 815 818 # Only if we really have an executable for the component : 816 ### if [ X${ExeNameIn} != X\"\" ] ; then817 819 if ( [ "X${ExeNameIn}" != X\"\" ] && [ "X${ExeNameIn}" != "Xinca.dat" ] ) ; then 818 820 … … 833 835 if [ ${NbElts} -ge 2 ] ; then 834 836 (( j = 2 )) 835 836 837 while [ $j -lt ${NbElts} ] ; do 837 838 eval tempvar=\${config_Executable_${comp}[${j}]} 839 IGCM_debug_Print 2 ${tempvar} 838 840 839 841 if [ X${tempvar} = X ] ; then 840 echo"Error reading MPI/OMP parameters !!!"841 echo "Check your config.card."842 exit 1842 IGCM_debug_Print 2 "Error reading MPI/OMP parameters !!!" 843 IGCM_debug_Exit "Check your config.card. Exit now" 844 IGCM_debug_Verif_Exit 843 845 fi 844 845 eval IGCM_debug_Print 2 ${tempvar}846 846 847 847 case ${tempvar} in 848 848 *[mM][pP][iI]*) 849 849 # Read MPI parameter for composante 850 850 eval ${comp}_PROC_MPI=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/MPI//" ) 851 851 OK_PARA_MPI=true;; 852 852 *[oO][mM][pP]*) 853 853 # Read OMP parameter for composante 854 854 eval ${comp}_PROC_OMP=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/OMP//" ) 855 855 OK_PARA_OMP=true;; 856 856 *[nN][oO][dD]*) 857 857 # Read NOD (NumBer of Nodes) parameter for composante 858 858 eval ${comp}_PROC_NOD=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/NOD//" ) 859 859 OK_PARA_NOD=true 860 860 OK_PARA_MPI=true;; 861 861 esac 862 863 862 (( j = j + 1 )) 864 863 done 865 866 864 fi 867 868 865 eval tempvarMPI=\${${comp}_PROC_MPI} 869 866 eval tempvarNOD=\${${comp}_PROC_NOD} … … 871 868 872 869 (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP )) 873 874 fi 875 870 fi 876 871 (( i=i+1 )) 877 872 done … … 891 886 if ( ${OK_PARA_MPMD} ) ; then 892 887 # with MPMD ie CPL/oasis method 893 echo "We will use default number of MPI tasks for this machine : " 894 echo "${DEFAULT_NUM_PROC_OCE} for OCE; " 895 echo "${DEFAULT_NUM_PROC_CPL} for CPL; " 896 echo "${DEFAULT_NUM_PROC_ATM} for ATM; " 897 echo "${DEFAULT_NUM_PROC_TOTAL} for the total number of processors; " 888 IGCM_debug_Print 2 "Use default number of MPI tasks for this machine : " 889 IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_OCE} for OCE" 890 IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_CPL} for CPL" 891 IGCM_debug_Print 2 "${DEFAULT_NUM_PROC_ATM} for ATM" 898 892 OK_PARA_MPI=true 899 893 CPL_PROC_MPI=${DEFAULT_NUM_PROC_CPL} … … 903 897 else 904 898 # with have only one executable 905 echo "We will use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${ExeNameFirst} "899 IGCM_debug_Print 2 "Use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${ExeNameFirst} " 906 900 OK_PARA_MPI=true 907 901 eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT} … … 914 908 # Verification with PBS parameter 915 909 if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then 916 echo "Warning with parallelization parameters !" 917 echo "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} " 918 echo "is the total number of _processors_ reserved." 919 echo "It is not equal to the sum of _processus_ = ${PROCESSUS_NUMBER}." 920 echo "We stop now." 921 exit 1 910 IGCM_debug_Exit "ERROR with parallelization parameters !" 911 IGCM_debug_Print 2 "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} " 912 IGCM_debug_Print 2 "is the total number of _processors_ reserved." 913 IGCM_debug_Print 2 "It is not equal to the sum of _processus_ = ${PROCESSUS_NUMBER}." 914 IGCM_debug_Verif_Exit 922 915 fi 923 916 NUM_PROC_CPL=${CPL_PROC_MPI} # for backward compatibility … … 926 919 else # BATCH_NUM_PROC_TOT="" 927 920 if ( ${OK_PARA_MPI} ) ; then 928 echo "You have not given a value of${BATCH_NUM_PROC_TOT} processors,"929 echo "but you have filled the parallel parameterin config->Executable->list."930 echo "Please add BATCH_NUM_PROC_TOT variable in job header."931 echo "We stopnow."932 exit 1921 IGCM_debug_Exit "ERROR : missing value for ${BATCH_NUM_PROC_TOT} processors," 922 IGCM_debug_Print 2 "You have parallel parameters in config->Executable->list." 923 IGCM_debug_Print 2 "Please add BATCH_NUM_PROC_TOT variable in job header as well." 924 IGCM_debug_Exit "Exit now." 925 IGCM_debug_Verif_Exit 933 926 else 934 927 # sequential case ! 935 928 if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then 936 929 (( PROCESSUS_NUMBER = 1 )) 937 echo"PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)."938 echo"We set it to 1."930 IGCM_debug_Print 2 "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)." 931 IGCM_debug_Print 2 "We set it to 1." 939 932 fi 940 933 fi … … 989 982 IGCM_sys_Put_Out ${Exe_Output} ${R_OUT_KSH}/${PREFIX}_${Exe_Output} 990 983 fi 991 eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}"984 FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output} 992 985 993 986 if [ ${DRYRUN} -le 1 ] ; then … … 1036 1029 (( ExeSize=0 )) 1037 1030 else 1038 evalLS_bin=${R_EXE}/${ExeNameIn}1031 LS_bin=${R_EXE}/${ExeNameIn} 1039 1032 IGCM_sys_FileSize ${LS_bin} ExeSize 1040 1033 … … 1055 1048 NextExeSize=${NextExeSize}", "${ExeSize} 1056 1049 fi 1057 evalLastCompExeSize=${run_Log_LastExeSize[$i]}1050 LastCompExeSize=${run_Log_LastExeSize[$i]} 1058 1051 (( i=i+1 )) 1059 1052 … … 1064 1057 IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 1065 1058 IGCM_debug_Print 1 "Save latest ${ExeNameIn} in ${R_OUT_EXE} !" 1066 evalFileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut}1059 FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 1067 1060 fi 1068 evalIGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw1061 IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 1069 1062 UpdateExe=true 1070 1063 … … 1096 1089 $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/run.card 1097 1090 fi 1098 eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}_tail.txt"1091 FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}_tail.txt 1099 1092 fi 1100 1093 … … 1166 1159 if [ ${ExperienceLengthInDays} -lt 0 ] ; then 1167 1160 IGCM_debug_Print 1 "Problem with dates in libIGCM.card : ${DateEnd} < ${DateBegin} ! You must check that." 1168 IGCM_debug_Exit "IGCM_PeriodEnd " " Wrong Dates."1161 IGCM_debug_Exit "IGCM_PeriodEnd have wrong dates." 1169 1162 IGCM_debug_Verif_Exit 1170 1163 fi … … 1299 1292 1300 1293 # Name of next Ksh Script output : 1301 eval Script_Output="${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${CumulPeriod} )"1294 Script_Output=${Script_Output_Prefix}_${config_UserChoices_JobName}.$( printf "%06d" ${CumulPeriod} ) 1302 1295 1303 1296 IGCM_debug_Print 1 "Submit next job"
Note: See TracChangeset
for help on using the changeset viewer.