Changeset 493 for branches


Ignore:
Timestamp:
08/12/11 10:19:22 (13 years ago)
Author:
mafoipsl
Message:

Adaptation and test on vargas for MPI only coupled run. No test with only one component. No test with OpenMP/MPI mixture.

Location:
branches/libIGCM_MPI_OpenMP
Files:
2 edited

Legend:

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

    r490 r493  
    569569        if [ X${ExeNameIn} != X\"\" ] ; then 
    570570            eval NbElts=\${#config_Executable_${comp}[@]} 
    571             if [ ${NbElts} -gt 2 ] ; then 
     571            if [ ${NbElts} -ge 2 ] ; then 
    572572                (( j = 2 )) 
    573573                eval ${comp}_PROC_MPI=1 
     
    583583                        echo "Error reading MPI/OMP parameters !!!"  
    584584                        echo "Check your config.card."  
    585                     # MM : à enlever : 
     585                    # MM : A  enlever : 
    586586                        exit 1 
    587587                        #break 
    588588                    fi 
    589  
    590 # pb                eval ${comp}_PROC_MPI=1 
    591 # pb                eval ${comp}_PROC_OMP=1 
    592 # pb                eval ${comp}_PROC_NOD=1 
    593589 
    594590                    eval IGCM_debug_Print 2 ${tempvar} 
  • branches/libIGCM_MPI_OpenMP/libIGCM_sys/libIGCM_sys_vargas.ksh

    r492 r493  
    137137#==================================================== 
    138138#- Max number of arguments passed to nco operator or demigration command 
    139 UNIX_MAX_LIMIT=360 
     139UNIX_MAX_LIMIT=120 
    140140 
    141141#D-#================================================== 
     
    675675            cat out_rsync 
    676676        fi 
     677        IGCM_sys_Rm out_rsync 
    677678    else 
    678679        echo "No POST-TREATMENT avaible because ulam is down." 
     
    11271128 
    11281129############################################################ 
    1129 # Build run file 
    1130  
    1131 function IGCM_sys_build_run_file { 
    1132     IGCM_debug_PushStack "IGCM_sys_build_run_file" $@ 
    1133 set -x 
    1134     if ( $DEBUG_sys ) ; then 
    1135         echo "IGCM_sys_build_run_file " $@ 
    1136     fi 
    1137  
    1138     NUM_PROC_OASIS=1 
    1139  
    1140     # Set the number of processors for OCE here 
    1141     NUM_PROC_OCE=5 
    1142  
    1143     (( NUM_PROC_ATM = BATCH_NUM_PROC_TOT - NUM_PROC_OASIS - NUM_PROC_OCE )) 
    1144      
    1145     if [ $1 = MPI2 ]; then 
    1146        echo "IGCM_sys_build_run_file : error - MPI2 not available on vargas. " 
    1147        IGCM_debug_Exit "IGCM_sys_build_run_file" 
    1148     elif [ $1 = MPI1 ]; then 
    1149         cat <<EOF > run_file 
    1150 ./oasis 
    1151 EOF 
    1152  
    1153         typeset i 
    1154         (( i = 0 )) 
    1155         while [ ${i} -lt ${NUM_PROC_ATM} ] ; do 
    1156             (( i = i + 1 )) 
    1157             cat <<EOF >> run_file 
    1158 ./lmdz.x 
    1159 EOF 
    1160         done 
    1161  
    1162         (( i = 0 )) 
    1163         while [ ${i} -lt ${NUM_PROC_OCE} ] ; do 
    1164             (( i = i + 1 )) 
    1165             cat <<EOF >> run_file 
    1166 ./opa.xx 
    1167 EOF 
    1168         done 
    1169  
    1170         wc -l run_file 
    1171     fi 
    1172 set +x 
    1173     IGCM_debug_PopStack "IGCM_sys_build_run_file" 
    1174 } 
    1175  
    1176  
    1177 ############################################################ 
    11781130# Build MPI/OMP scripts 
    11791131function IGCM_sys_build_execution_scripts  
     
    12061158        EXECUTION="${EXECUTION} -pgmmodel mpmd -cmdfile ./runfile"  
    12071159 
    1208         IGCM_debug_Print 1 "sys vargas : La commande d execution est " 
    1209         IGCM_debug_Print 1 $EXECUTION 
     1160        IGCM_debug_Print 1 "sys vargas : execution command is " 
     1161        IGCM_debug_Print 1 "$EXECUTION" 
    12101162 
    12111163        if ( ${OK_PARA_OMP} ) ; then 
     
    12131165# @ task_geometry={(0)(1,2,3)} 
    12141166# Nombre de processus demandes 
     1167            echo "Job_${config_UserChoices_JobName} includes task_geometry = \c" 
    12151168            cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g"  
     1169            echo "Job_${config_UserChoices_JobName} includes task_geometry  with NbNodes = \c" 
    12161170            cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c  
    12171171            NbNodes_Job=$(( $( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c ) - 1 )) 
     
    12271181# Pas d OpenMP 
    12281182# @ resources = ConsumableCpus(1) 
     1183            echo "Job_${config_UserChoices_JobName} includes total_tasks = \c" 
    12291184            cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //"  
    12301185            NbProc_Job=$( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //" ) 
     
    12341189                exit 1 
    12351190            fi 
    1236             if ( $( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "resources = ConsumableCpus(1)" ) ) ; then 
    1237                 IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no ressource defined with MPI only run." 
     1191            if ( $( egrep '^# *@ *resources *= *ConsumableCpus\(1\)' ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} >/dev/null 2>&1 ) ) ; then 
     1192                IGCM_debug_Print 2 "ressources =  ConsumableCpus(1) line found into Job_${config_UserChoices_JobName}" 
     1193            else 
     1194                IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources = line not found. Job should include resources = ConsumableCpus(1) " 
    12381195                exit 1 
    12391196            fi             
     
    12471204# Then loop on the components  
    12481205 
     1206### oasis must be the first one 
    12491207    for comp in ${config_ListOfComponents[*]} ; do 
    12501208         
     
    12531211             
    12541212        # Only if we really have an executable for the component : 
    1255         if [ "X${ExeNameOut}" != X\"\" ] ; then 
     1213        if [ "X${ExeNameOut}" = Xoasis ] ; then 
    12561214 
    12571215            eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 
     
    12631221                until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do 
    12641222                    if ( ${OK_PARA_OMP} ) ; then  
    1265                         echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} > out_${ExeNameOut}.out.${mpi_count} 2>out_${ExeNameOut}.err.${mpi_count}" >> runfile 
     1223                        echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> runfile 
    12661224                    else 
    1267                         echo "./${ExeNameOut} > out_${ExeNameOut}.out.${mpi_count} 2>out_${ExeNameOut}.err.${mpi_count}" >> runfile  
     1225                        echo "./${ExeNameOut}" >> runfile  
    12681226                    fi 
    12691227                    (( mpi_count = mpi_count + 1 )) 
     
    12711229            else 
    12721230                if ( ${OK_PARA_OMP} ) ; then  
    1273                     echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> runfile 
     1231                    echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> runfile 
    12741232                else 
    1275                     echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> runfile  
     1233                    echo "./${ExeNameOut} " >> runfile  
    12761234                fi 
    12771235            fi 
    12781236        fi 
    12791237    done 
     1238 
     1239    for comp in ${config_ListOfComponents[*]} ; do 
     1240         
     1241        eval ExeNameIn=\${config_Executable_${comp}[0]} 
     1242        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     1243             
     1244        # Only if we really have an executable for the component : 
     1245        if [ "X${ExeNameOut}" != X\"\" -and "X${ExeNameOut}" != Xoasis ] ; then 
     1246 
     1247            eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 
     1248            eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 
     1249             
     1250            if ( ${OK_PARA_MPI} ) ; then  
     1251 
     1252                (( mpi_count = 1 )) 
     1253                until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do 
     1254                    if ( ${OK_PARA_OMP} ) ; then  
     1255                        echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> runfile 
     1256                    else 
     1257                        echo "./${ExeNameOut}" >> runfile  
     1258                    fi 
     1259                    (( mpi_count = mpi_count + 1 )) 
     1260                done 
     1261            else 
     1262                if ( ${OK_PARA_OMP} ) ; then  
     1263                    echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} " >> runfile 
     1264                else 
     1265                    echo "./${ExeNameOut} " >> runfile  
     1266                fi 
     1267            fi 
     1268        fi 
     1269    done 
    12801270    IGCM_sys_Chmod u+x runfile  
    12811271 
     1272    if ( $DEBUG_sys ) ; then 
     1273        echo "runfile contains : " 
     1274        cat runfile 
     1275    fi 
     1276 
     1277 
    12821278    IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" 
    12831279} 
Note: See TracChangeset for help on using the changeset viewer.