Ignore:
Timestamp:
07/05/17 20:18:51 (7 years ago)
Author:
sdipsl
Message:

CMIP6 workflow. Merging trunk into branch 'branch' r:1375:1398

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/libIGCM_v3.0_beta1/libIGCM_sys/libIGCM_sys_curie.ksh

    r1364 r1399  
    178178#==================================================== 
    179179#- HOST_MPIRUN_COMMAND 
    180 typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="/usr/bin/time ccc_mprun -E-K1"} 
     180typeset -r HOST_MPIRUN_COMMAND=${HOST_MPIRUN_COMMAND:="/usr/bin/time ccc_mprun -E-K1 "} 
    181181 
    182182#==================================================== 
     
    922922#    fi 
    923923 
    924     /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1 
    925     status=$? 
     924    if [ "$#" -eq 1 ]; then 
     925      /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS}/${1} # > out_dods_rm 2>&1 
     926      status=$? 
     927    else 
     928      /ccc/cont003/home/dsm/p86ipsl/bin/dods_rm public/${LOGIN}/${R_DODS} # > out_dods_rm 2>&1 
     929      status=$? 
     930    fi 
    926931 
    927932#    if [ ${status} -gt 0 ] ; then 
     
    11111116 
    11121117  elif [ ${executionType} -eq 2 ] ; then 
    1113     # MPMD + MPI + OMP 
    1114     sed -e "/::openMPthreads::/d"                  \ 
    1115         -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
    1116       ${file} > ${file}.tmp 
    1117  
     1118    # MPMD + MPI + OMP : mpirun/ccc_mprun/error 
     1119    if ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "X" ] || [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xmpirun" ] ) ; then 
     1120      sed -e "/::openMPthreads::/d"                  \ 
     1121          -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     1122        ${file} > ${file}.tmp 
     1123    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xccc_mprun" ] ) ; then 
     1124      sed -e "/::openMPthreads::/d"                  \ 
     1125          -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     1126          -e "/--cpu_bind=none/d"                    \ 
     1127        ${file} > ${file}.tmp 
     1128    else 
     1129     IGCM_debug_Print 1 "You have to set ExecutionModeOnCurie=ccc_mprun or mpirun in config.card" 
     1130     IGCM_debug_Exit "IGCM_sys_updateHeaders" 
     1131    fi 
    11181132  elif [ ${executionType} -eq 3 ] ; then 
    11191133    # SPMD + MPI/OMP 
     
    11841198  EXECUTION=${HOST_MPIRUN_COMMAND} 
    11851199 
    1186   # MPMD mode 
    11871200  if ( ${OK_PARA_MPMD} ) ; then 
    11881201 
    1189     # Only MPI (MPMD) 
     1202    # MPMD mode 
     1203    # 1 MPI only 
     1204    # 2 MPI/OpenMP mpirun method 
     1205    # 3 MPI/OpenMP ccc_mprun method 
     1206 
     1207    if [ -f run_file ] ; then 
     1208      IGCM_sys_Rm -f run_file 
     1209    fi 
     1210    touch run_file 
     1211 
     1212    # case 1 : Only MPI (MPMD) 
    11901213    if  ( ! ${OK_PARA_OMP} ) ; then 
    1191  
    1192       if [ -f run_file ] ; then 
    1193         IGCM_sys_Rm -f run_file 
    1194       fi 
    1195       touch run_file 
    11961214 
    11971215      # Build run_file 
     
    12361254      fi 
    12371255 
    1238     # MPI-OpenMP (MPMD) 
    1239     else 
     1256    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "X" ] || [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xmpirun" ] ) ; then 
     1257 
     1258    # 2 MPI/OpenMP mpirun method 
    12401259 
    12411260      # Use of mpirun instead of ccc_mprun 
     
    13091328 
    13101329          #echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 
    1311           echo "(( MYMPIRANK = OMPI_COMM_WORLD_RANK )) " >> script_${ExeNameOut}.ksh 
    1312           echo "MYMPIRANK=\$(printf '%3.3d\n' \${MYMPIRANK})" >> script_${ExeNameOut}.ksh 
    1313           echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}" >> script_${ExeNameOut}.ksh 
    1314           IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 
     1330          echo "(( MYMPIRANK = OMPI_COMM_WORLD_RANK )) " >> script_${ExeNameOut}.ksh 
     1331          echo "MYMPIRANK=\$(printf '%3.3d\n' \${MYMPIRANK})" >> script_${ExeNameOut}.ksh 
     1332          echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${MYMPIRANK} 2>out_${ExeNameOut}.err.\${MYMPIRANK}" >> script_${ExeNameOut}.ksh 
     1333          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 
    13151334 
    13161335          if [ ${init_exec} = y ] ; then 
     
    13521371        fi 
    13531372      done 
    1354     fi 
    1355  
     1373 
     1374    elif ( [ "X${config_UserChoices_ExecutionModeOnCurie}" = "Xccc_mprun" ] ) ; then 
     1375 
     1376    # 3 MPI/OpenMP ccc_mprun method 
     1377 
     1378    # MPI-OpenMP (MPMD) 
     1379    # example of run_file 
     1380    # 71-8 env OMP_NUM_THREADS=8 ./script_lmdz.x.ksh 
     1381    # 480-1 env OMP_NUM_THREADS=1 ./script_opa.xx.ksh 
     1382    # 1-1 env OMP_NUM_THREADS=1 ./script_xios.x.ksh 
     1383 
     1384      # Loop on the components 
     1385      for comp in ${config_ListOfComponents[*]} ; do 
     1386 
     1387        eval ExeNameIn=\${config_Executable_${comp}[0]} 
     1388        eval ExeNameOut=\${config_Executable_${comp}[1]} 
     1389 
     1390        # Not possible if oasis has an executable (i.e old version of oasis3) 
     1391        if ( [ "X${ExeNameOut}" != X\"\" ] &&  [ "X${comp}" = "XCPL" ] ) ; then 
     1392          IGCM_debug_Exit "ERROR MPMD with hybrid MPI-OpenMP is not available with oasis3 version" 
     1393          IGCM_debug_Print 2 "Only available with oasis3-MCT version coupler" 
     1394          IGCM_debug_Verif_Exit 
     1395        fi 
     1396 
     1397        # Only if we really have an executable for the component : 
     1398        if [ "X${ExeNameOut}" != X\"\" ] ; then 
     1399 
     1400          eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 
     1401          eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 
     1402 
     1403          # Build script files 
     1404 
     1405          echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 
     1406          echo ""  >> script_${ExeNameOut}.ksh 
     1407          if [ ${comp_proc_omp_loc} -gt 1 ] ; then 
     1408 
     1409            # Check if the number of threads is correct 
     1410            case ${comp_proc_omp_loc} in 
     1411            2|4|8|16) 
     1412              IGCM_debug_Print 1 "You run ${ExeNameOut} on ${comp_proc_omp_loc} OMP threads" 
     1413              ;; 
     1414            *) 
     1415              IGCM_debug_Exit "ERROR with OMP parameters !" 
     1416              IGCM_debug_Print 2 "${comp_proc_omp_loc} is not possible as number of OMP threads" 
     1417              IGCM_debug_Print 2 "Only 2,4,8,16 as number of OMP threads are possible " 
     1418              IGCM_debug_Verif_Exit 
     1419              ;; 
     1420            esac 
     1421            ### only for LMDZ? 
     1422            echo "export KMP_STACKSIZE=3g"  >> script_${ExeNameOut}.ksh 
     1423            echo "export KMP_LIBRARY=turnaround"  >> script_${ExeNameOut}.ksh 
     1424            echo "export MKL_SERIAL=YES"  >> script_${ExeNameOut}.ksh 
     1425            echo "OMP_NUM_THREADS=${comp_proc_omp_loc}" >> script_${ExeNameOut}.ksh 
     1426 
     1427          fi 
     1428 
     1429          # to have out/err per process on different files 
     1430          echo "./${ExeNameOut} > out_${ExeNameOut}.out.\${SLURM_PROCID} 2>out_${ExeNameOut}.err.\${SLURM_PROCID}" >> script_${ExeNameOut}.ksh 
     1431          #echo "./${ExeNameOut}" >> script_${ExeNameOut}.ksh 
     1432 
     1433          IGCM_sys_Chmod u+x script_${ExeNameOut}.ksh 
     1434 
     1435          # Complete run_file 
     1436 
     1437          echo "${comp_proc_mpi_loc}-${comp_proc_omp_loc} env OMP_NUM_THREADS=${comp_proc_omp_loc} ./script_${ExeNameOut}.ksh " >>run_file 
     1438 
     1439        fi 
     1440      done 
     1441 
     1442      ## variable added to stop after 60s instead of 600s by default.  
     1443      ## This is used when no error comes from executables and when something stopped an executable without notice.  
     1444      export SLURM_WAIT=60 
     1445 
     1446      ## module advised by TGCC (instead of 2 variables) 
     1447      module load feature/bridge/heterogenous_mpmd 
     1448 
     1449      # set EXECUTION for ccc_mprun case (similar to #1 : MPI only MPMD method)  
     1450 
     1451      EXECUTION="${HOST_MPIRUN_COMMAND} -f ./run_file" 
     1452 
     1453      IGCM_sys_Chmod u+x run_file 
     1454      if ( $DEBUG_sys ) ; then 
     1455        echo "run_file contains : " 
     1456        cat run_file 
     1457      fi 
     1458 
     1459    else 
     1460 
     1461      IGCM_debug_Print 1 "sys Curie :  choose mpirun or ccc_mprun in config.card for ExecutionModeOnCurie" 
     1462 
     1463    fi # 1 2 or 3 if ${OK_PARA_MPMD} 
     1464 
     1465  else 
    13561466  # Only one executable (SPMD mode). 
    1357   else 
    13581467 
    13591468    for comp in ${config_ListOfComponents[*]} ; do 
     
    13621471      eval ExeNameOut=\${config_Executable_${comp}[1]} 
    13631472      if ( [ "X${ExeNameOut}" != X\"\" ] && [ "X${ExeNameOut}" != "Xinca.dat" ] ) ; then 
     1473 
     1474        # Build script files 
    13641475 
    13651476        echo "#!/bin/ksh" > script_${ExeNameOut}.ksh 
     
    13981509    done 
    13991510 
    1400   fi 
     1511  fi # ${OK_PARA_MPMD} 
    14011512 
    14021513  IGCM_debug_Print 1 "sys Curie : execution command is " 
     
    16891800} 
    16901801 
     1802#D-#================================================== 
     1803#D-function IGCM_sys_rebuild_nemo 
     1804#D-* Purpose: rebuild nemo parallel files with nemo specific rebuild on curie 
     1805#D-* Examples: 
     1806#D- 
     1807 
     1808function IGCM_sys_rebuild_nemo { 
     1809  IGCM_debug_PushStack "IGCM_sys_rebuild_nemo" $@ 
     1810  if ( $DEBUG_sys ) ; then 
     1811    echo "IGCM_sys_rebuild_nemo :" $@ 
     1812  fi 
     1813 
     1814  $( ccc_home -u p86ipsl )/REBUILD_NEMO/rebuild_nemo ${1} ${2} 
     1815 
     1816  IGCM_debug_PopStack "IGCM_sys_rebuild_nemo" 
     1817} 
     1818 
Note: See TracChangeset for help on using the changeset viewer.