Changeset 939


Ignore:
Timestamp:
08/23/13 11:38:24 (11 years ago)
Author:
sdipsl
Message:

cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r933 r939  
    3030  # Read libIGCM compatibility version in config.card 
    3131  IGCM_card_DefineVariableFromOption ${configPath} Compatibility libIGCM 
    32   eval CompatibilityTag=${config_Compatibility_libIGCM} > /dev/null 2>&1 
     32  CompatibilityTag=${config_Compatibility_libIGCM} 
    3333 
    3434  if [ ! "${CompatibilityTag}" = "${libIGCM_CurrentTag}" ] ; then 
     
    228228  echo 
    229229  IGCM_debug_Print 2 "Define Script_Output_Prefix and Exe_Output" 
    230   eval Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'} 
     230  Script_Output_Prefix=${config_UserChoices_Script_Output_Prefix:='Script_Output'} 
    231231  IGCM_debug_Print 3 "Script_Output_Prefix = ${Script_Output_Prefix}" 
    232   eval Exe_Output=out_execution 
     232  Exe_Output=out_execution 
    233233  IGCM_debug_Print 3 "Exe_Output           = ${Exe_Output}" 
    234234 
     
    571571    IGCM_config_DaysInPeriodLength 
    572572 
    573     eval PeriodDateBegin=${DateBegin} > /dev/null 2>&1 
     573    PeriodDateBegin=${DateBegin} 
    574574    PeriodDateEnd=$( IGCM_date_AddDaysToGregorianDate ${DateBegin} $(( ${PeriodLengthInDays} - 1 )) ) 
    575     eval CumulPeriod=1 > /dev/null 2>&1 
     575    CumulPeriod=1 
    576576 
    577577    #=================================================# 
     
    616616    PeriodDateBegin=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateBegin} ) 
    617617    PeriodDateEnd=$( IGCM_date_ConvertFormatToGregorian ${run_Configuration_PeriodDateEnd} ) 
    618     eval CumulPeriod="${run_Configuration_CumulPeriod}" > /dev/null 2>&1 
     618    CumulPeriod=${run_Configuration_CumulPeriod} 
    619619 
    620620    LastPeriodDateEnd=$( echo ${run_Configuration_OldPrefix} | sed -e "s/${config_UserChoices_JobName}_//" ) 
     
    756756 
    757757  # Period for save files 
    758   eval DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd} > /dev/null 2>&1 
     758  DatesPeriod=${PeriodDateBegin}_${PeriodDateEnd} 
    759759 
    760760  # Prefix for save files of this period 
    761   eval PREFIX=${config_UserChoices_JobName}_${DatesPeriod}  > /dev/null 2>&1 
     761  PREFIX=${config_UserChoices_JobName}_${DatesPeriod} 
    762762 
    763763  # List of files that will be deleted in RUN_DIR after run 
     
    782782  fi 
    783783 
    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 
    791794 
    792795  OK_PARA_MPI=false 
     
    814817 
    815818    # Only if we really have an executable for the component : 
    816 ###    if [ X${ExeNameIn} != X\"\" ] ; then 
    817819    if ( [ "X${ExeNameIn}" != X\"\" ] && [ "X${ExeNameIn}" != "Xinca.dat" ] ) ; then 
    818820 
     
    833835      if [ ${NbElts} -ge 2 ] ; then 
    834836        (( j = 2 )) 
    835  
    836837        while [ $j -lt ${NbElts} ] ; do 
    837838          eval tempvar=\${config_Executable_${comp}[${j}]} 
     839          IGCM_debug_Print 2 ${tempvar} 
    838840 
    839841          if [ X${tempvar} = X ] ; then 
    840             echo "Error reading MPI/OMP parameters !!!" 
    841             echo "Check your config.card." 
    842             exit 1 
     842            IGCM_debug_Print 2 "Error reading MPI/OMP parameters !!!" 
     843            IGCM_debug_Exit "Check your config.card. Exit now" 
     844            IGCM_debug_Verif_Exit 
    843845          fi 
    844  
    845           eval IGCM_debug_Print 2 ${tempvar} 
    846846 
    847847          case ${tempvar} in 
    848848          *[mM][pP][iI]*) 
    849                # Read MPI parameter for composante 
     849            # Read MPI parameter for composante 
    850850            eval ${comp}_PROC_MPI=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/MPI//" ) 
    851851            OK_PARA_MPI=true;; 
    852852          *[oO][mM][pP]*) 
    853                # Read OMP parameter for composante 
     853            # Read OMP parameter for composante 
    854854            eval ${comp}_PROC_OMP=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/OMP//" ) 
    855855            OK_PARA_OMP=true;; 
    856856          *[nN][oO][dD]*) 
    857                # Read NOD (NumBer of Nodes) parameter for composante 
     857            # Read NOD (NumBer of Nodes) parameter for composante 
    858858            eval ${comp}_PROC_NOD=$( echo ${tempvar} | tr '[a-z]' '[A-Z]' | sed -e "s/NOD//" ) 
    859859            OK_PARA_NOD=true 
    860860            OK_PARA_MPI=true;; 
    861861          esac 
    862  
    863862          (( j = j + 1 )) 
    864863        done 
    865  
    866864      fi 
    867  
    868865      eval tempvarMPI=\${${comp}_PROC_MPI} 
    869866      eval tempvarNOD=\${${comp}_PROC_NOD} 
     
    871868 
    872869      (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP )) 
    873  
    874     fi 
    875  
     870    fi 
    876871    (( i=i+1 )) 
    877872  done 
     
    891886        if ( ${OK_PARA_MPMD} ) ; then 
    892887          # 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" 
    898892          OK_PARA_MPI=true 
    899893          CPL_PROC_MPI=${DEFAULT_NUM_PROC_CPL} 
     
    903897        else 
    904898          # 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} " 
    906900          OK_PARA_MPI=true 
    907901          eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT} 
     
    914908    # Verification with PBS parameter 
    915909    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 
    922915    fi 
    923916    NUM_PROC_CPL=${CPL_PROC_MPI} # for backward compatibility 
     
    926919  else # BATCH_NUM_PROC_TOT="" 
    927920    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 parameter in config->Executable->list." 
    930       echo "Please add BATCH_NUM_PROC_TOT variable in job header." 
    931       echo "We stop now." 
    932       exit 1 
     921      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 
    933926    else 
    934927      # sequential case ! 
    935928      if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then 
    936929        (( 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." 
    939932      fi 
    940933    fi 
     
    989982    IGCM_sys_Put_Out ${Exe_Output} ${R_OUT_KSH}/${PREFIX}_${Exe_Output} 
    990983  fi 
    991   eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}" 
     984  FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output} 
    992985 
    993986  if [ ${DRYRUN} -le 1 ] ; then 
     
    10361029        (( ExeSize=0 )) 
    10371030      else 
    1038         eval LS_bin=${R_EXE}/${ExeNameIn} 
     1031        LS_bin=${R_EXE}/${ExeNameIn} 
    10391032        IGCM_sys_FileSize ${LS_bin} ExeSize 
    10401033 
     
    10551048        NextExeSize=${NextExeSize}", "${ExeSize} 
    10561049      fi 
    1057       eval LastCompExeSize=${run_Log_LastExeSize[$i]} 
     1050      LastCompExeSize=${run_Log_LastExeSize[$i]} 
    10581051      (( i=i+1 )) 
    10591052 
     
    10641057          IGCM_debug_Print 1 "${ExeNameIn} has changed in ${R_EXE} !" 
    10651058          IGCM_debug_Print 1 "Save latest ${ExeNameIn} in ${R_OUT_EXE} !" 
    1066           eval FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 
     1059          FileToBeDeleted[${#FileToBeDeleted[@]}]=${ExeNameOut} 
    10671060        fi 
    1068         eval IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 
     1061        IGCM_sys_Put_Out ${ExeNameOut} ${R_OUT_EXE}/${PREFIX}_${ExeNameIn} rw 
    10691062        UpdateExe=true 
    10701063 
     
    10961089            $1,$2,$3,$4,$5,$6,$7,$8,$9)}' >> ${SUBMIT_DIR}/run.card 
    10971090      fi 
    1098       eval FileToBeDeleted[${#FileToBeDeleted[@]}]="${Exe_Output}_tail.txt" 
     1091      FileToBeDeleted[${#FileToBeDeleted[@]}]=${Exe_Output}_tail.txt 
    10991092    fi 
    11001093 
     
    11661159        if [ ${ExperienceLengthInDays} -lt 0 ] ; then 
    11671160          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." 
    11691162          IGCM_debug_Verif_Exit 
    11701163        fi 
     
    12991292 
    13001293    # 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} ) 
    13021295 
    13031296    IGCM_debug_Print 1 "Submit next job" 
Note: See TracChangeset for help on using the changeset viewer.