Changeset 492
- Timestamp:
- 08/10/11 14:17:48 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libIGCM_MPI_OpenMP/libIGCM_sys/libIGCM_sys_vargas.ksh
r479 r492 63 63 #===================================================== 64 64 # Host and user names 65 # $hostname ou hostname 65 66 # $hostname ou hostname 66 67 typeset HOST=${HOST:=$( hostname )} 67 68 # $username ou whoami … … 1172 1173 IGCM_debug_PopStack "IGCM_sys_build_run_file" 1173 1174 } 1175 1176 1177 ############################################################ 1178 # Build MPI/OMP scripts 1179 function IGCM_sys_build_execution_scripts 1180 { 1181 IGCM_debug_PushStack "IGCM_sys_build_execution_scripts" $@ 1182 if ( $DEBUG_sys ) ; then 1183 echo "IGCM_sys_build_execution_scripts " $@ 1184 fi 1185 1186 typeset NbNodes_Job NbProc_Job comp_proc_mpi_loc comp_proc_omp_loc mpi_count 1187 1188 # Verification with PBS parameter 1189 if [ X${BATCH_NUM_PROC_TOT} != X ] ; then 1190 1191 if ( ${OK_PARA_MPI} ) ; then 1192 EXECUTION=${HOST_MPIRUN_COMMAND} 1193 else 1194 if [ ${BATCH_NUM_PROC_TOT} -eq 1 ] ; then 1195 EXECUTION=${MPIRUN_COMMAND:="time "} 1196 fi 1197 fi 1198 else 1199 if ( ! ${OK_PARA_MPI} ) ; then 1200 EXECUTION=${MPIRUN_COMMAND:="time "} 1201 fi 1202 fi 1203 1204 if [ ${PROCESSUS_NUMBER} -gt 1 ] ; then 1205 1206 EXECUTION="${EXECUTION} -pgmmodel mpmd -cmdfile ./runfile" 1207 1208 IGCM_debug_Print 1 "sys vargas : La commande d execution est " 1209 IGCM_debug_Print 1 $EXECUTION 1210 1211 if ( ${OK_PARA_OMP} ) ; then 1212 # NEW : 2 Noeuds 1213 # @ task_geometry={(0)(1,2,3)} 1214 # Nombre de processus demandes 1215 cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" 1216 cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c 1217 NbNodes_Job=$(( $( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "task_geometry" | sed -e "s/[^(]*([^(]*/(/g" | wc -c ) - 1 )) 1218 1219 if [ ${NbNodes_Job} -eq 0 ] ; then 1220 IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no task_geometry defined with OpenMP run." 1221 exit 1 1222 fi 1223 else 1224 # OLD : 1225 # @ total_tasks = 3 1226 # @ environment = "BATCH_NUM_PROC_TOT=3" 1227 # Pas d OpenMP 1228 # @ resources = ConsumableCpus(1) 1229 cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //" 1230 NbProc_Job=$( cat ${SUBMIT_DIR}/Job_${config_UserChoices_JobName} | grep "total_tasks" | sed -e "s/.*total_tasks = //" ) 1231 NbProc_Job=${NbProc_Job:=0} 1232 if [ ${NbProc_Job} -eq 0 ] ; then 1233 IGCM_debug_Print 2 "Error in Job_${config_UserChoices_JobName} ressources : no total_tasks defined with MPI only run." 1234 exit 1 1235 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." 1238 exit 1 1239 fi 1240 fi 1241 if [ -f runfile ] ; then 1242 IGCM_sys_Rm -f runfile 1243 touch runfile 1244 fi 1245 fi 1246 1247 # Then loop on the components 1248 1249 for comp in ${config_ListOfComponents[*]} ; do 1250 1251 eval ExeNameIn=\${config_Executable_${comp}[0]} 1252 eval ExeNameOut=\${config_Executable_${comp}[1]} 1253 1254 # Only if we really have an executable for the component : 1255 if [ "X${ExeNameOut}" != X\"\" ] ; then 1256 1257 eval comp_proc_mpi_loc=\${${comp}_PROC_MPI} 1258 eval comp_proc_omp_loc=\${${comp}_PROC_OMP} 1259 1260 if ( ${OK_PARA_MPI} ) ; then 1261 1262 (( mpi_count = 1 )) 1263 until [ ${mpi_count} -gt ${comp_proc_mpi_loc} ] ; do 1264 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 1266 else 1267 echo "./${ExeNameOut} > out_${ExeNameOut}.out.${mpi_count} 2>out_${ExeNameOut}.err.${mpi_count}" >> runfile 1268 fi 1269 (( mpi_count = mpi_count + 1 )) 1270 done 1271 else 1272 if ( ${OK_PARA_OMP} ) ; then 1273 echo "env OMP_NUM_THREADS=${comp_proc_omp_loc} ./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> runfile 1274 else 1275 echo "./${ExeNameOut} > out_${ExeNameOut}.out 2>out_${ExeNameOut}.err" >> runfile 1276 fi 1277 fi 1278 fi 1279 done 1280 IGCM_sys_Chmod u+x runfile 1281 1282 IGCM_debug_PopStack "IGCM_sys_build_execution_scripts" 1283 } 1284 1285
Note: See TracChangeset
for help on using the changeset viewer.