Changeset 1238


Ignore:
Timestamp:
10/05/15 15:19:53 (9 years ago)
Author:
sdipsl
Message:
  • ins_job (the one from libIGCM) will edit Job headers according to config.card specs. see #96
  • need more testing
Location:
trunk/libIGCM
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/libIGCM/AA_job

    r1201 r1238  
    88#-Q- curie #MSUB -eo 
    99#-Q- curie #MSUB -n ::JobNumProcTot::  # Number of MPI tasks (SPMD case) or cores (MPMD case) 
     10#-Q- curie #MSUB -c ::openMPthreads::  # Number of openMP threads. To specify only for SMPD 
     11#-Q- curie #MSUB -x                    # exclusive node. To specify only for MPMD together with the one below 
     12#-Q- curie #MSUB -E '--cpu_bind=none' 
    1013#-Q- curie #MSUB -T 86400              # Wall clock limit (seconds) 
    1114#-Q- curie #MSUB -q standard           # thin nodes 
    1215#-Q- curie #MSUB -A ::default_project:: 
    13 #-Q- curie  
    1416#-Q- curie # Below specific options that can be activated  
    1517#-Q- curie ##MSUB -q ivybridge         # Option for Airain 
    16 #-Q- curie ##MSUB -N 8                 # Number of nodes (16 cores per node) 
    17 #-Q- curie ##MSUB -c 8                 # Number of openMP threads. To specify only for SMPD 
    18 #-Q- curie ##MSUB -x                   # exclusive node. To specify only for MPMD together with the one below 
    19 #-Q- curie ##MSUB -E '--cpu_bind=none' 
     18 
    2019#-Q- curie 
    2120#-Q- curie BATCH_NUM_PROC_TOT=$BRIDGE_MSUB_NPROC 
     
    3938#-Q- ada # @ wall_clock_limit = 1:00:00 
    4039#-Q- ada # Specific option for OpenMP parallelization: Number of OpenMP threads per MPI task 
    41 #-Q- ada ### @ parallel_threads = 4 
     40#-Q- ada # @ parallel_threads = ::openMPthreads:: 
    4241#-Q- ada # End of the header options 
    4342#-Q- ada # @ queue 
  • trunk/libIGCM/ins_job

    r1230 r1238  
    226226      echo "ins_job stops here" 
    227227      echo "=> The variable ExpType must be added in config.card in section UserChoices" 
    228       echo "=> ExpType gives the directory for the .card configurtaion files for the wanted experiement. For exemple ExpType=IPSLCM5/historical" 
     228      echo "=> ExpType gives the directory for the .card configuration files for the wanted experiement. For exemple ExpType=IPSLCM5/historical" 
    229229      exit 4 
    230230    else 
     
    257257    \cp ${F_RCI} ${j}; 
    258258   } 
     259   
     260  #================================== 
     261  # Read Executable section: 
     262  IGCM_card_DefineArrayFromSection ${j}'/'${F_CFG} Executable   
     263 
     264  # Define the execution context (MPMD, SPMD, MPI/OMP ...) 
     265  IGCM_config_ConfigureExexution 
     266 
     267  # coreNumber    : TOTAL NUMBER OF CORES 
     268  # mpiTasks      : TOTAL NUMBER OF MPI TASKS 
     269  # openMPthreads : NUMBER OF OpenMP THREADS 
    259270 
    260271  # File name for Job 
     
    270281      ${F_JOB} > ${j}'/'${n_f} 
    271282  chmod u+x ${j}'/'${n_f} 
     283 
     284  # update Headers so that ressources description are accurate (MPMD/SPMD/...) 
     285  IGCM_sys_updateHeaders ${j}'/'${n_f} 
    272286done 
     287 
    273288#- 
    274289# Extract list of AA_* files in libIGCM 
  • trunk/libIGCM/libIGCM_config/libIGCM_config.ksh

    r1235 r1238  
    584584  coreNumber=0 
    585585  mpiTasks=0 
     586  openMPthreads=0 
    586587  NbExec=0 
    587588 
     
    679680      [ ${tempvarOMP} -ge 2 ] && OK_PARA_OMP=true 
    680681 
     682      # Number of OMP threads 
     683      [ ${openMPthreads} -lt ${tempvarOMP} ] && openMPthreads=${tempvarOMP} 
     684 
    681685      # SUM UP NUMBER OF CORES 
    682686      (( coreNumber = coreNumber + tempvarMPI * tempvarNOD * tempvarOMP )) 
     
    692696  # Define the execution type we are running in 
    693697  if [ ${OK_PARA_MPMD} ] ; then 
    694     # MPMD always implies MPI 
    695698    if [ ${OK_PARA_MPI} ] ; then 
     699      # MPMD always implies MPI 
    696700      executionType=1 
    697701    fi 
    698     # MPMD + MPI/OMP 
    699702    if [ ${OK_PARA_OMP} ] ; then 
     703      # MPMD + MPI/OMP 
    700704      executionType=2 
    701705    fi 
    702706  else 
    703     # SPMD + MPI/OMP 
    704707    if ( [ ${OK_PARA_MPI} ] && [ ${OK_PARA_OMP} ] ) ; then 
     708      # SPMD + MPI/OMP 
    705709      executionType=3 
     710    elif ( [ ${OK_PARA_MPI} ] && [ ! ${OK_PARA_OMP} ] ) ; then 
    706711      # SPMD + MPI only 
    707     elif ( [ ${OK_PARA_MPI} ] && [ ! ${OK_PARA_OMP} ] ) ; then 
    708712      executionType=4 
     713    elif ( [ ! ${OK_PARA_MPI} ] && [ ${OK_PARA_OMP} ] ) ; then 
    709714      # SPMD + OMP only 
    710     elif ( [ ! ${OK_PARA_MPI} ] && [ ${OK_PARA_OMP} ] ) ; then 
    711715      executionType=5 
     716    elif ( [ ! ${OK_PARA_MPI} ] && [ ! ${OK_PARA_OMP} ] ) ; then 
    712717      # SEQUENTIAL THEN 
    713     elif ( [ ! ${OK_PARA_MPI} ] && [ ! ${OK_PARA_OMP} ] ) ; then 
    714718      executionType=6 
    715719      coreNumber=1 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_ada.ksh

    r1236 r1238  
    912912 
    913913  IGCM_debug_PopStack "IGCM_sys_desactiv_variables" 
     914} 
     915 
     916############################################################ 
     917# Update job headers to be used by the scheduler 
     918 
     919#D-#================================================== 
     920#D-function IGCM_sys_updateHeaders 
     921#D-* Purpose: Update job headers to be used by the scheduler 
     922#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP 
     923#D- 
     924function IGCM_sys_updateHeaders { 
     925  IGCM_debug_PushStack "IGCM_sys_updateHeaders" 
     926  if ( $DEBUG_sys ) ; then 
     927    echo "IGCM_sys_updateHeaders" 
     928  fi 
     929  typeset file 
     930  file=$1 
     931 
     932  if [ ${executionType} -eq 1 ] ; then 
     933    # MPMD + MPI 
     934    sed -e "/::openMPthreads::/d"                  \ 
     935        -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     936      ${file} > ${file}.tmp 
     937 
     938  elif [ ${executionType} -eq 2 ] ; then 
     939    # MPMD + MPI + OMP 
     940    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     941        -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     942      ${file} > ${file}.tmp 
     943 
     944  elif [ ${executionType} -eq 3 ] ; then 
     945    # SPMD + MPI/OMP 
     946    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     947        -e "s/::JobNumProcTot::/${mpiTasks}/"      \ 
     948      ${file} > ${file}.tmp 
     949 
     950  elif [ ${executionType} -eq 4 ] ; then 
     951    # SPMD + MPI only 
     952    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \ 
     953        -e "/::openMPthreads::/d"                  \ 
     954      ${file} > ${file}.tmp 
     955 
     956  elif [ ${executionType} -eq 5 ] ; then 
     957    # SPMD + OMP only 
     958    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     959        -e "s/@\ job_type\ =\ parallel/@\ job_type\ =\ serial/" \ 
     960        -e "/::JobNumProcTot::/d"                  \ 
     961      ${file} > ${file}.tmp 
     962 
     963  elif [ ${executionType} -eq 6 ] ; then 
     964    # SEQUENTIAL THEN 
     965    sed -e "s/::JobNumProcTot::/1/"                \ 
     966        -e "s/@\ job_type\ =\ parallel/@\ job_type\ =\ serial/" \ 
     967        -e "/::openMPthreads::/d"                  \ 
     968      ${file} > ${file}.tmp 
     969 
     970  fi 
     971 
     972  IGCM_sys_Mv ${file}.tmp ${file} 
     973 
     974  IGCM_debug_PopStack "IGCM_sys_updateHeaders" 
    914975} 
    915976 
  • trunk/libIGCM/libIGCM_sys/libIGCM_sys_curie.ksh

    r1234 r1238  
    10841084 
    10851085############################################################ 
     1086# Update job headers to be used by the scheduler 
     1087 
     1088#D-#================================================== 
     1089#D-function IGCM_sys_updateHeaders 
     1090#D-* Purpose: Update job headers to be used by the scheduler 
     1091#D-* Examples: IGCM_sys_updateHeaders /path/to/Job_MYEXP 
     1092#D- 
     1093function IGCM_sys_updateHeaders { 
     1094  IGCM_debug_PushStack "IGCM_sys_updateHeaders" 
     1095  if ( $DEBUG_sys ) ; then 
     1096    echo "IGCM_sys_updateHeaders" 
     1097  fi 
     1098  typeset file 
     1099  file=$1 
     1100 
     1101  if [ ${executionType} -eq 1 ] ; then 
     1102    # MPMD + MPI 
     1103    sed -e "/::openMPthreads::/d"                  \ 
     1104        -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     1105      ${file} > ${file}.tmp 
     1106 
     1107  elif [ ${executionType} -eq 2 ] ; then 
     1108    # MPMD + MPI + OMP 
     1109    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     1110        -e "s/::JobNumProcTot::/${coreNumber}/"    \ 
     1111      ${file} > ${file}.tmp 
     1112 
     1113  elif [ ${executionType} -eq 3 ] ; then 
     1114    # SPMD + MPI/OMP 
     1115    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     1116        -e "s/::JobNumProcTot::/${mpiTasks}/"      \ 
     1117        -e "/#MSUB\ -x/d"                          \ 
     1118        -e "/--cpu_bind=none/d"                    \ 
     1119      ${file} > ${file}.tmp 
     1120 
     1121  elif [ ${executionType} -eq 4 ] ; then 
     1122    # SPMD + MPI only 
     1123    sed -e "s/::JobNumProcTot::/${mpiTasks}/"      \ 
     1124        -e "/::openMPthreads::/d"                  \ 
     1125        -e "/#MSUB\ -x/d"                          \ 
     1126        -e "/--cpu_bind=none/d"                    \ 
     1127      ${file} > ${file}.tmp 
     1128 
     1129  elif [ ${executionType} -eq 5 ] ; then 
     1130    # SPMD + OMP only 
     1131    sed -e "s/::openMPthreads::/${openMPthreads}/" \ 
     1132        -e "/::JobNumProcTot::/d"                  \ 
     1133        -e "/#MSUB\ -x/d"                          \ 
     1134        -e "/--cpu_bind=none/d"                    \ 
     1135      ${file} > ${file}.tmp 
     1136 
     1137  elif [ ${executionType} -eq 6 ] ; then 
     1138    # SEQUENTIAL THEN 
     1139    sed -e "s/::JobNumProcTot::/1/"                \ 
     1140        -e "/::openMPthreads::/d"                  \ 
     1141        -e "/#MSUB\ -x/d"                          \ 
     1142        -e "/--cpu_bind=none/d"                    \ 
     1143      ${file} > ${file}.tmp 
     1144 
     1145  fi 
     1146 
     1147  IGCM_sys_Mv ${file}.tmp ${file} 
     1148 
     1149  IGCM_debug_PopStack "IGCM_sys_updateHeaders" 
     1150} 
     1151 
     1152############################################################ 
    10861153# Build MPI/OMP scripts run file (dummy function) 
    10871154 
     
    10921159#D- 
    10931160function IGCM_sys_build_run_file { 
    1094  
    10951161  IGCM_debug_Print 3 " dummy function : IGCM_sys_build_run_file " 
    1096  
    10971162} 
    10981163 
Note: See TracChangeset for help on using the changeset viewer.