Ignore:
Timestamp:
02/21/12 19:25:29 (12 years ago)
Author:
mafoipsl
Message:

First test on mono-executable (sequential, MPI or hybrid MPI/OpenMP) on vargas and first try to use default value adapted to IPSLCM5A in multi-executable mode (OASIS/1 , ATM/26 and OCE/5)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libIGCM_MPI_OpenMP/libIGCM_config/libIGCM_config.ksh

    r493 r556  
    538538    fi 
    539539 
    540     typeset ExeNameIn 
     540    typeset ExeNameIn ExeNameFirst CompNameFirst 
    541541    typeset comp i 
    542     typeset tempvar tempvarMPI tempvarNOD NbElts j 
     542    typeset tempvar tempvarMPI tempvarNOD NbElts j NbExec 
    543543 
    544544    (( PROCESSUS_NUMBER = 0 )) 
    545545    (( i=0 )) 
     546    (( NbExec=0 )) 
    546547 
    547548    OK_PARA_MPI=false 
    548549    OK_PARA_OMP=false 
    549550    OK_PARA_NOD=false 
     551    OK_PARA_MPMD=false 
     552 
    550553    for comp in ${config_ListOfComponents[*]} ; do 
    551554 
     
    568571        # Only if we really have an executable for the component : 
    569572        if [ X${ExeNameIn} != X\"\" ] ; then 
     573 
     574            # Keep the first executable found and the first CompName 
     575            ExeNameFirst=${ExeNameIn} 
     576            CompNameFirst=${comp} 
     577 
     578            # Are we a second executable? 
     579            (( NbExec = NbExec + 1 )) 
     580 
     581            # set 1 MPI task, 1 OpenMP thread and 1 node as default 
     582            eval ${comp}_PROC_MPI=1 
     583            eval ${comp}_PROC_OMP=1 
     584            eval ${comp}_PROC_NOD=1 
     585 
    570586            eval NbElts=\${#config_Executable_${comp}[@]} 
     587 
    571588            if [ ${NbElts} -ge 2 ] ; then 
    572589                (( j = 2 )) 
    573                 eval ${comp}_PROC_MPI=1 
    574                 eval ${comp}_PROC_OMP=1 
    575                 eval ${comp}_PROC_NOD=1 
    576590 
    577591                while [ $j -lt ${NbElts} ] ; do  
     
    591605 
    592606                    case ${tempvar} in 
    593                         *MPI) 
     607                        *[mM][pP][iI]*) 
    594608                            # Read MPI parameter for composante 
    595609                            eval ${comp}_PROC_MPI=$( echo ${tempvar} | sed -e "s/MPI//" ) 
    596610                            OK_PARA_MPI=true;; 
    597                         *OMP) 
     611                        *[oO][mM][pP]*) 
    598612                            # Read OMP parameter for composante 
    599613                            eval ${comp}_PROC_OMP=$( echo ${tempvar} | sed -e "s/OMP//" ) 
    600614                            OK_PARA_OMP=true;; 
    601                         *NOD) 
     615                        *[nN][oO][dD]*) 
    602616                            # Read NOD (NumBer of Nodes) parameter for composante 
    603617                            eval ${comp}_PROC_NOD=$( echo ${tempvar} | sed -e "s/NOD//" ) 
     
    609623                done 
    610624 
    611                 eval tempvarMPI=\${${comp}_PROC_MPI} 
    612                 eval tempvarNOD=\${${comp}_PROC_NOD} 
    613                 eval tempvarOMP=\${${comp}_PROC_OMP} 
    614                 (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP )) 
    615625            fi 
     626 
     627            eval tempvarMPI=\${${comp}_PROC_MPI} 
     628            eval tempvarNOD=\${${comp}_PROC_NOD} 
     629            eval tempvarOMP=\${${comp}_PROC_OMP} 
     630 
     631            (( PROCESSUS_NUMBER = PROCESSUS_NUMBER + tempvarMPI * tempvarNOD * tempvarOMP )) 
     632 
    616633        fi 
    617634 
     
    619636    done 
    620637 
    621     # sequential case ! 
    622     if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then 
    623         (( PROCESSUS_NUMBER = 1 )) 
    624         echo "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)." 
    625         echo "We set it to 1." 
    626     fi 
    627  
    628     IGCM_debug_Print 1 "MPI/OMP treatment PROCESSUS_NUMBER = ${PROCESSUS_NUMBER}" 
    629  
    630     # Verification with PBS parameter 
     638    # set MPMD mode if more than 2 executable names. 
     639    [ ${NbExec} -ge 2 ] && OK_PARA_MPMD=true 
     640 
     641    # Verification of BATCH_NUM_PROC_TOT total number of processors set in job header. 
    631642    if [ X${BATCH_NUM_PROC_TOT} != X ] ; then 
    632         if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then 
    633             echo "Warning with parallelization parameters !" 
    634             echo "PBS variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} " 
    635             echo " is the total number of _processors_ reserved." 
    636             echo "It is not equal to the sum of _processus_ in config.card = ${PROCESSUS_NUMBER}." 
    637         fi 
     643        # BATCH_NUM_PROC_TOT is set 
    638644        if ( ! ${OK_PARA_MPI} ) ; then 
     645            # with previous method. 
    639646            if [ ${BATCH_NUM_PROC_TOT} -gt 1 ] ; then 
    640                 echo "You have given a reservation of ${BATCH_NUM_PROC_TOT} processors," 
    641                 echo "but you havn't filled the parallel parameter in config->Executable->list." 
    642                 echo "This is the old method and it is no more supported." 
    643                 echo "Please read documentation or config specific comments." 
    644                 echo "We stop now." 
    645                 exit 1 
     647                # with more than 1 proc 
     648                if ( ${OK_PARA_MPMD} ) ; then 
     649                     # with MPMD ie CPL/oasis method 
     650                     echo "We will use default number of MPI tasks : 5 for OCE, 1 for CPL and 26 for ATM for coupled configuration" 
     651                     OK_PARA_MPI=true 
     652                     CPL_PROC_MPI=1 
     653                     OCE_PROC_MPI=5 
     654                     ATM_PROC_MPI=26 
     655                     PROCESSUS_NUMBER=32 
     656                else 
     657                     # with have only one executable 
     658                     echo "We will use ${BATCH_NUM_PROC_TOT} MPI tasks for ${CompNameFirst} : ${config_Executable_Name} " 
     659                     OK_PARA_MPI=true 
     660                     eval ${CompNameFirst}_PROC_MPI=${BATCH_NUM_PROC_TOT} 
     661                     PROCESSUS_NUMBER=${BATCH_NUM_PROC_TOT} 
     662                fi 
    646663            else  
    647664                PROCESSUS_NUMBER=1 
    648665            fi 
    649666        fi 
    650     else 
     667        # Verification with PBS parameter 
     668        if [ ${BATCH_NUM_PROC_TOT} -ne ${PROCESSUS_NUMBER} ] ; then 
     669            echo "Warning with parallelization parameters !" 
     670            echo "Job header variable BATCH_NUM_PROC_TOT = ${BATCH_NUM_PROC_TOT} " 
     671            echo "is the total number of _processors_ reserved." 
     672            echo "It is not equal to the sum of _processus_  = ${PROCESSUS_NUMBER}." 
     673            echo "We stop now." 
     674            exit 1 
     675        fi 
     676 
     677    else # BATCH_NUM_PROC_TOT="" 
    651678        if ( ${OK_PARA_MPI} ) ; then 
    652679            echo "You have not given a value of ${BATCH_NUM_PROC_TOT} processors," 
    653680            echo "but you have filled the parallel parameter in config->Executable->list." 
    654             echo "This is the old method and it is no more supported." 
    655             echo "Please read documentation or config specific comments." 
     681            echo "Please add BATCH_NUM_PROC_TOT variable in job header." 
    656682            echo "We stop now." 
    657683            exit 1 
    658         fi 
    659     fi 
     684        else 
     685        # sequential case ! 
     686            if [ ${PROCESSUS_NUMBER} -eq 0 ] ; then 
     687               (( PROCESSUS_NUMBER = 1 )) 
     688               echo "PROCESSUS_NUMBER is all 0 (sequential use of old definition in config->Executable->list)." 
     689               echo "We set it to 1." 
     690            fi 
     691        fi 
     692    fi 
     693 
     694    IGCM_debug_Print 1 "MPI/OMP treatment PROCESSUS_NUMBER = ${PROCESSUS_NUMBER}" 
    660695 
    661696#     if ( ${OK_PARA_MPI} || ${OK_PARA_OMP} || ${OK_PARA_NOD} ) ; then 
Note: See TracChangeset for help on using the changeset viewer.