From 288c0fb6e7c3e84dcd7fb322835e891da448aef4 Mon Sep 17 00:00:00 2001 From: Juan Escobar <juan.escobar@aero.obs-mip.fr> Date: Tue, 2 Dec 2014 15:26:29 +0000 Subject: [PATCH] Juan 2/12/2014: add management of ARCH=LXcray/LXifort on --- src/Rules.LXcray.mk | 135 +++++++++++++++++++++++++++++++++ src/Rules.LXifort.mk | 5 ++ src/configure | 25 ++++++ src/job_make_examples_CRAY_cca | 75 ++++++++++++++++++ src/job_make_mesonh_CRAY_cca | 30 ++++++++ 5 files changed, 270 insertions(+) create mode 100644 src/Rules.LXcray.mk create mode 100755 src/job_make_examples_CRAY_cca create mode 100755 src/job_make_mesonh_CRAY_cca diff --git a/src/Rules.LXcray.mk b/src/Rules.LXcray.mk new file mode 100644 index 000000000..e8663a71f --- /dev/null +++ b/src/Rules.LXcray.mk @@ -0,0 +1,135 @@ +#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier +#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence +#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +#MNH_LIC for details. version 1. +########################################################## +# # +# Compiler Options # +# # +########################################################## +#OBJDIR_PATH=/home/escj/azertyuiopqsdfghjklm/wxcvbn/azertyuiopqsdfghjklmwxcvbn +# +#OPT_BASE = -r8 -g -w -assume nosource_include -assume byterecl -fpe0 -ftz -fpic -traceback -fp-model precise -switch fe_inline_all_arg_copy_inout +OPT_BASE = -sreal64 -hpic -em -ef +OPT_PERF0 = -O0 -g +OPT_PERF2 = -O2 -hflex_mp=intolerant -Ofp0 -hnoomp +OPT_PERF1 = -O1 -hflex_mp=intolerant -Ofp0 -hnoomp -hcpu=istanbul -hfp0 -K trap=fp +# –hcpu=Istanbul –hfp0 +#OPT_CHECK = -CB -ftrapuv +OPT_CHECK = -Rbc +OPT_I8 = -sdefault64 +# +# Integer 4/8 option +# +MNH_INT ?=I4 +LFI_RECL ?=512 +# +ifeq "$(MNH_INT)" "I8" +#OPT_BASE += $(OPT_I8) +OPT_BASE = -sdefault64 -hpic -em -ef +LFI_INT ?=8 +MNH_MPI_RANK_KIND ?=8 +else +MNH_MPI_RANK_KIND ?=4 +LFI_INT ?=4 +endif +# +OPT = $(OPT_BASE) $(OPT_PERF2) +OPT0 = $(OPT_BASE) $(OPT_PERF0) +OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) +# +ifeq "$(OPTLEVEL)" "DEBUG" +OPT = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK) +OPT0 = $(OPT_BASE) $(OPT_PERF0) $(OPT_CHECK) +OPT_NOCB = $(OPT_BASE) $(OPT_PERF0) +CFLAGS += -g +endif +ifeq "$(OPTLEVEL)" "O2PAR" +PAR= -homp +OPT = $(OPT_BASE) $(OPT_PERF2) $(PAR) +OPT0 = $(OPT_BASE) $(OPT_PERF0) $(PAR) +OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) $(PAR) +endif +ifeq "$(OPTLEVEL)" "O2NOVEC" +OPT = $(OPT_BASE) $(OPT_PERF2) -O vector0 +OPT0 = $(OPT_BASE) $(OPT_PERF0) -O vector0 +OPT_NOCB = $(OPT_BASE) $(OPT_PERF2) -O vector0 +endif +ifeq "$(OPTLEVEL)" "O1" +OPT = $(OPT_BASE) $(OPT_PERF1) +OPT0 = $(OPT_BASE) $(OPT_PERF0) +OPT_NOCB = $(OPT_BASE) $(OPT_PERF1) +endif +# +# +FC = ftn +FCFLAGS = -em -ef +CC=gcc +export FC CC FCFLAGS +F90 = ftn +F90FLAGS = $(OPT) +F77 = $(F90) +F77FLAGS = $(OPT) +# -132 +FX90 = $(F90) +FX90FLAGS = $(OPT) +# -132 +# +#LDFLAGS = -Wl,-noinhibit-exec -Wl,-warn-once $(PAR) +LDFLAGS = -Wl,-warn-once $(PAR) $(OPT_BASE) +# +# preprocessing flags +# +CPP = cpp -P -traditional -Wcomment +# +CPPFLAGS_SURFEX = +CPPFLAGS_SURCOUCHE = -DMNH_MPI_DOUBLE_PRECISION -DMNH_LINUX -DDEV_NULL -DMNH_MPI_RANK_KIND=$(MNH_MPI_RANK_KIND) +CPPFLAGS_RAD = +CPPFLAGS_NEWLFI = -DSWAPIO -DLINUX -DLFI_INT=${LFI_INT} -DLFI_RECL=${LFI_RECL} +CPPFLAGS_MNH = -DMNH +ifdef VER_GA +CPPFLAGS_SURCOUCHE += -DMNH_GA +INC += -I${GA_ROOT}/include +LIBS += -L${GA_ROOT}/lib -larmci -lga -lgfortran +endif +# +# Gribex flags +# +TARGET_GRIBEX=linux +CNAME_GRIBEX=_gfortran +########################################################## +# # +# Source of MESONH PACKAGE Distribution # +# # +########################################################## +#DIR_SURCOUCHE += ARCH_SRC/bug_surcouche +#DIR_MNH += ARCH_SRC/bug_mnh +#DIR_RAD += ARCH_SRC/bug_rad +#DIR_SURFEX += ARCH_SRC/surfex +# +include Makefile.MESONH.mk +# +########################################################## +# # +# extra VPATH, Compilation flag modification # +# systeme module , etc ... # +# external precompiled module librairie # +# etc ... # +# # +########################################################## +# Juan & Maud 20/03/2008 --> Ifort 10.1.008 Bug O2 optimization +#OPT_PERF1 = -O1 +OBJS_O1= spll_schu.o spll_ps2str.o spll_p_abs.o spll_ini_one_way_n.o spll_urban_solar_abs.o +$(OBJS_O1) : OPT = $(OPT_BASE) $(OPT_PERF1) +OBJS_O0= spll_mode_gridproj.o spll_ini_dynamics.o spll_sunpos_n.o spll_ground_param_n.o + +$(OBJS_O0) : OPT = $(OPT_BASE) $(OPT_PERF0) + +ifneq "$(findstring 8,$(LFI_INT))" "" +OBJS_I8=spll_NEWLFI_ALL.o +$(OBJS_I8) : OPT = $(OPT_BASE) $(OPT_PERF2) $(OPT_I8) +endif + +#mpi.mod : +# ln -sf /opt/cray/mpt/5.6.3/gni/mpich2-cray/74/include/MPI.mod $(OBJDIR_MASTER)/mpi.mod + diff --git a/src/Rules.LXifort.mk b/src/Rules.LXifort.mk index 18e420ccc..ef172c419 100644 --- a/src/Rules.LXifort.mk +++ b/src/Rules.LXifort.mk @@ -81,9 +81,14 @@ ifeq "$(MNH_INT)" "I8" OPT_BASE += -ilp64 endif else +ifeq "$(VER_MPI)" "MPICRAY" +F90 = ftn +else F90 = ifort endif endif +endif + F90FLAGS = $(OPT) F77 = $(F90) F77FLAGS = $(OPT) diff --git a/src/configure b/src/configure index bddd13801..1170a7b96 100755 --- a/src/configure +++ b/src/configure @@ -191,6 +191,31 @@ export LIB_GRIBAPI='${GRIB_API_LIB}' ;; esac ;; +'Linux cc'*) # ECMWF Cray plateforme + export MNH_ARCH=`echo $ARCH | grep LX` + export ARCH=${MNH_ARCH:-LXcray} + export VER_MPI=${VER_MPI:-MPICRAY} + export OPTLEVEL=${OPTLEVEL:-O2} + export MVWORK=${MVWORK:-NO} + export VER_CDF=${VER_CDF:-CDFAUTO} + if [ "${ARCH}" == "LXcray" ] + then + export MNHENV=${MNHENV:-" +. /opt/modules/default/init/bash +module rm grib_api +"} + else + if [ "${ARCH}" == "LXifort" ] + then + export MNHENV=${MNHENV:-" +. /opt/modules/default/init/bash +module rm grib_api +module rm PrgEnv-cray +module load PrgEnv-intel +"} + fi + fi +;; 'Linux sxmnh1') #CNRM ifort sur sxmnh1 (diff mandriva) export OMPI_FC=ifort export ARCH=${ARCH:-LXifort} diff --git a/src/job_make_examples_CRAY_cca b/src/job_make_examples_CRAY_cca new file mode 100755 index 000000000..c45a573cc --- /dev/null +++ b/src/job_make_examples_CRAY_cca @@ -0,0 +1,75 @@ +#!/bin/bash +#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier +#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence +#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +#MNH_LIC for details. version 1. +#PBS -N Sortie_cray +#PBS -q np +# CPUs number (on all nodes) +#PBS -l EC_total_tasks=4 +# CPUs number by node +#PBS -l EC_tasks_per_node=4 +#PBS -l EC_threads_per_task=1 +#PBS -j oe +# time limit +#PBS -l walltime=7200 + +# Echo des commandes +ulimit -a +#ulimit -c 0 +#ulimit -s unlimited +# Arrete du job des la premiere erreur +set -e +# Nom de la machine +hostname + +cd ${PBS_O_WORKDIR} + +#ARCH=LXifort +ARCH=LXcray +. ../conf/profile_mesonh-${ARCH}I4-MNH-V5-1-3-MPICRAY-O2 + + +export MONORUN="aprun -n 1 " +export MPIRUN="aprun -n 4 " +export POSTRUN="echo " +# +# nedeed to allow compute node to retrieve PGD/ECMWF file with wget on internet +# +export http_proxy=http://proxy.ecmwf.int:3333/ + +cd $SRC_MESONH/MY_RUN/KTEST/003_KW78 +make -k +# +echo "#################################################################################" +echo "##CAS SUIVANT####################################################################" +echo "#################################################################################" +cd $SRC_MESONH/MY_RUN/KTEST/001_2Drelief +make -k +# +echo "#################################################################################" +echo "##CAS SUIVANT####################################################################" +echo "#################################################################################" +cd $SRC_MESONH/MY_RUN/KTEST/002_3Drelief +make -k +# +echo "#################################################################################" +echo "##CAS SUIVANT####################################################################" +echo "#################################################################################" + +cd $SRC_MESONH/MY_RUN/KTEST/004_Reunion +make -k << EOF + + +EOF +# +echo "#################################################################################" +echo "##CAS SUIVANT####################################################################" +echo "#################################################################################" +cd $SRC_MESONH/MY_RUN/KTEST/007_16janvier +make -k << EOF + + +EOF +# + diff --git a/src/job_make_mesonh_CRAY_cca b/src/job_make_mesonh_CRAY_cca new file mode 100755 index 000000000..cf6072705 --- /dev/null +++ b/src/job_make_mesonh_CRAY_cca @@ -0,0 +1,30 @@ +#!/bin/bash +#MNH_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier +#MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence +#MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt +#MNH_LIC for details. version 1. +#PBS -N Sortie_cray +#PBS -q nf +# CPUs number (on all nodes) +#PBS -l EC_total_tasks=1 +# CPUs number by node +#PBS -l EC_tasks_per_node=1 +#PBS -l EC_threads_per_task=4 +#PBS -j oe +# time limit +#PBS -l walltime=7200 + +set -x +# On va lancer la compilation dans le répertoire de lancement du job +cd ${PBS_O_WORKDIR} +pwd + +#ARCH=LXifort +ARCH=LXcray +. ../conf/profile_mesonh-${ARCH}I4-MNH-V5-1-3-MPICRAY-O2 + + +time gmake -j 4 2>&1 | tee sortie_compile_cray.$$ +time gmake -j 4 2>>&1 | tee sortie_compile_cray.$$ +time gmake -j 1 installmaster 2>&1 | tee sortie_install_cray.$$ + -- GitLab