From 7e30bf47181e83546b9a0e08f62d3be13b343fcd Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Fri, 1 Mar 2024 11:40:25 +0800 Subject: [PATCH 1/5] wrf - singularity --- .../4.2.1/bisheng/data.wrf.arm.cpu.config.def | 29 +++++++ .../data.wrf.arm.cpu.singularity.config | 87 +++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def create mode 100644 templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config diff --git a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def new file mode 100644 index 0000000..63ba0da --- /dev/null +++ b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def @@ -0,0 +1,29 @@ +BootStrap: library +From: helloxusuo/repo/base:oe2203sp2 + +%environment + source /etc/profile || true + source /etc/profile.d/modules.sh + cd /hpcrunner + source ./env.sh + +%post + source /etc/profile || true + cd /hpcrunner + git init + git pull https://gitee.com/openeuler/hpcrunner.git +# git clone https://gitee.com/yyu497/hpcrunner.git +# mkdir -p templates/wrf/4.2.1/bisheng +# /bin/cp hpcrunner/templates/wrf/4.2.1/bisheng/* templates/wrf/4.2.1/bisheng +# rm -rf hpcrunner + source ./init.sh + ./jarvis -use templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config + ./jarvis -d + ./jarvis -dp + ./jarvis -b + rm -rf downloads/* + rm -rf tmp/* + rm -rf software/utils/* + +%labels + Author HUAWEI \ No newline at end of file diff --git a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config new file mode 100644 index 0000000..ba48023 --- /dev/null +++ b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config @@ -0,0 +1,87 @@ +[SERVER] +11.11.11.11 + +[DOWNLOAD] +wrf/4.2.1 ${JARVIS_PROXY}/wrf-model/WRF/archive/refs/tags/v4.2.1.tar.gz wrf-4.2.1.tar.gz + +[DEPENDENCY] +set -e +set -x +# basic system components +yum install -y time zlib zlib-devel libtirpc libtirpc-devel patch +module purge +module use ./software/modulefiles +./jarvis -install bisheng/3.2.0-mini com +module load bisheng/3.2.0-mini +export CC=clang CXX=clang++ FC=flang +./jarvis -install jasper/1.900.2 bisheng +module use ./software/moduledeps/bisheng3.2.0 +module load jasper/1.900.2 +./jarvis -install hmpi/2.3.0 bisheng +module load hmpi/2.3.0 +export CC=mpicc CXX=mpicxx FC=mpifort +./jarvis -install hdf5/1.12.0/clang bisheng+mpi +module load hdf5-clang/1.12.0 +./jarvis -install pnetcdf/1.12.1 bisheng+mpi +module load pnetcdf/1.12.1 +./jarvis -install netcdf/4.8.1/clang bisheng+mpi +module load netcdf-clang/4.8.1 +./jarvis -install kml/2.2.0/bisheng bisheng + +[ENV] +#!/bin/bash +module purge +module use /hpcrunner/software/modulefiles +module load bisheng/3.2.0-mini +module use /hpcrunner/software/moduledeps/bisheng3.2.0 +module load jasper/1.900.2 +module load hmpi/2.3.0 +module load hdf5-clang/1.12.0 pnetcdf/1.12.1 netcdf-clang/4.8.1 +module load kml-bisheng/2.2.0 +export WRFIO_NCD_LARGE_FILE_SUPPORT=1 +export NETCDF=${NETCDF_CLANG_PATH} +export HDF5=${HDF5_CLANG_PATH} +export PHDF5=${HDF5} +export PNETCDF=${PNETCDF_PATH} +export JASPER=${JASPER_PATH} +export JASPERLIB=${JASPER_PATH}/lib +export JASPREINC=${JASPER_PATH}/include +export CPPFLAGS="-I${HDF5}/include -I${PNETCDF}/include -I${NETCDF}/include" +export LDFLAGS="-L${HDF5}/lib -L${PNETCDF}/lib -L${NETCDF}/lib -lnetcdf -lnetcdff -lpnetcdf -lhdf5_hl -lhdf5 -lz" +export CC=mpicc CXX=mpicxx FC=mpif90 F77=mpif90 F90=mpif90 +export WRF_DIR=/hpcrunner/workloads/WRF-4.2.1 +export MPI_LIB="-L${HMPI_PATH}/lib -lmpi -lomp" +export INCLUDE=${WRF_DIR}/include:$INCLUDE +export KML_LIB=${KML_BISHENG_PATH}/lib +export CASE_DIR=${WRF_DIR}/case/conus12km +export PATH=/hpcrunner/workloads/WRF-4.2.1/main:/hpcrunner/workloads/WRF-4.2.1/external/io_netcdf:$PATH + +[APP] +app_name = WRF +build_dir = ${WRF_DIR} +binary_dir = ${WRF_DIR}/run +case_dir = ${CASE_DIR} + +[BUILD] +cd ${JARVIS_ROOT} +./jarvis -e +source ./env.sh +cd ${JARVIS_ROOT}/workloads +if [ -d "./WRF-4.2.1" ]; then + rm -rf ./WRF-4.2.1 +fi +tar -zxvf ${JARVIS_DOWNLOAD}/wrf-4.2.1.tar.gz +cd WRF-4.2.1 +patch -p1 < ${JARVIS_ROOT}/templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch +echo 4 | ./configure +./compile em_real 2>&1 | tee compile.log + +[CLEAN] +./clean -a + +[RUN] +run = +binary = +nodes = + +[JOB] -- Gitee From 8c8b4b1bbb18023376e70edb0d2bec974e7e7e62 Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Fri, 1 Mar 2024 11:42:38 +0800 Subject: [PATCH 2/5] wrf - singularity --- templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def index 63ba0da..2e12dbd 100644 --- a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def +++ b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.config.def @@ -12,7 +12,6 @@ From: helloxusuo/repo/base:oe2203sp2 cd /hpcrunner git init git pull https://gitee.com/openeuler/hpcrunner.git -# git clone https://gitee.com/yyu497/hpcrunner.git # mkdir -p templates/wrf/4.2.1/bisheng # /bin/cp hpcrunner/templates/wrf/4.2.1/bisheng/* templates/wrf/4.2.1/bisheng # rm -rf hpcrunner -- Gitee From 7ce48ca7bcf2df214fec2c2d582438d496617cfc Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Tue, 5 Mar 2024 10:20:42 +0800 Subject: [PATCH 3/5] wrf - singularity - patch --- .../wrf/4.2.1/bisheng/wrf-4.2.1-sve.patch | 85 +++++++++++++++++++ templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch | 6 +- 2 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 templates/wrf/4.2.1/bisheng/wrf-4.2.1-sve.patch diff --git a/templates/wrf/4.2.1/bisheng/wrf-4.2.1-sve.patch b/templates/wrf/4.2.1/bisheng/wrf-4.2.1-sve.patch new file mode 100644 index 0000000..d2a988c --- /dev/null +++ b/templates/wrf/4.2.1/bisheng/wrf-4.2.1-sve.patch @@ -0,0 +1,85 @@ +diff -Nru WRF-4.2.1/arch/configure.defaults WRF-4.2.1-ok/arch/configure.defaults +--- WRF-4.2.1/arch/configure.defaults 2020-07-23 04:34:26.000000000 +0800 ++++ WRF-4.2.1-ok/arch/configure.defaults 2024-02-22 20:43:20.842876000 +0800 +@@ -1,3 +1,45 @@ ++############################################################ ++#ARCH Linux aarch64,BiSheng HYPERMPI#serial smpar dmpar dm+sm ++DESCRIPTION = BISHENG ($SFC/$SCC) ++DMPARALLEL = 1 ++OMPCPP = -D_OPENMP ++OMP = -fopenmp ++OMPCC = -fopenmp ++SFC = flang ++SCC = clang ++CCOMP = clang ++DM_FC = mpif90 -f90=$(SFC) ++DM_CC = mpicc -cc=$(SCC) -DMPI2_SUPPORT ++FC = CONFIGURE_FC ++CC = CONFIGURE_CC ++LD = $(FC) ++RWORDSIZE = CONFIGURE_RWORDSIZE ++PROMOTION = #-fdefault-real-8 ++ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM ++CFLAGS_LOCAL = -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -w -O3 -c -fvectorize -funroll-loops -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 ++LDFLAGS_LOCAL = -L${KML_LIB} -lkm -ltirpc -ljemalloc ++CPLUSPLUSLIB = ++ESMF_LDFLAG = $(CPLUSPLUSLIB) ++FCOPTIM = -O3 -funroll-loops -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -fvectorize -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 ++FCREDUCEDOPT = $(FCOPTIM) ++FCNOOPT = -O0 ++FCDEBUG = -g # -fbacktrace -ggdb-fcheck=bounds,do,mem,pointer -ffpe-trap=invalid,zero,overflow ++FORMAT_FIXED = -ffixed-form ++FORMAT_FREE = -ffree-form -ffree-line-length-0 ++FCSUFFIX = ++BYTESWAPIO = -fconvert=big-endian ++FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) ++FCBASEOPTS = -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true $(OMP) $(FCBASEOPTS_NO_G) ++MODULE_SRCH_FLAG = ++TRADFLAG = -traditional ++CPP = /lib/cpp -P ++AR = ar ++ARFLAGS = ru ++M4 = m4 -G ++RANLIB = ranlib ++RLFLAGS = ++CC_TOOLS = $(SCC) ++ + ########################################################### + #ARCH Linux i486 i586 i686, NEC SX sxf90 sxcc #serial smpar dmpar dm+sm + # +diff -Nru WRF-4.2.1/dyn_em/module_advect_em.F WRF-4.2.1-ok/dyn_em/module_advect_em.F +--- WRF-4.2.1/dyn_em/module_advect_em.F 2020-07-23 04:34:26.000000000 +0800 ++++ WRF-4.2.1-ok/dyn_em/module_advect_em.F 2024-02-22 20:49:38.844098000 +0800 +@@ -6271,7 +6271,9 @@ + ENDIF + + ! compute fluxes, 6th order +- ++!$OMP PARALLEL DO & ++!$OMP DEFAULT(SHARED) & ++!$OMP PRIVATE(i, j, k, dy, mu, cr, vel) + j_loop_y_flux_6 : DO j = j_start, j_end+1 + + IF( (j >= j_start_f ) .and. (j <= j_end_f) ) THEN ! use full stencil +@@ -6402,7 +6404,9 @@ + ENDIF + + ! compute fluxes +- ++!$OMP PARALLEL DO & ++!$OMP DEFAULT(SHARED) & ++!$OMP PRIVATE(i, j, k, dx, mu, cr, vel) + DO j = j_start, j_end + + ! 5th order flux +@@ -6821,7 +6825,9 @@ + ENDIF + + ! compute fluxes, 4th order +- ++!$OMP PARALLEL DO & ++!$OMP DEFAULT(SHARED)& ++!$OMP PRIVATE(i, j, k, dy, mu, cr, vel) + j_loop_y_flux_4 : DO j = j_start, j_end+1 + + IF( (j >= j_start_f ) .and. (j <= j_end_f) ) THEN ! use full stencil diff --git a/templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch b/templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch index d2a988c..7e146d0 100644 --- a/templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch +++ b/templates/wrf/4.2.1/bisheng/wrf-4.2.1.patch @@ -20,11 +20,11 @@ diff -Nru WRF-4.2.1/arch/configure.defaults WRF-4.2.1-ok/arch/configure.defaults +RWORDSIZE = CONFIGURE_RWORDSIZE +PROMOTION = #-fdefault-real-8 +ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM -+CFLAGS_LOCAL = -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -w -O3 -c -fvectorize -funroll-loops -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 ++CFLAGS_LOCAL = -mcpu=tsv110 -w -O3 -c -fvectorize -funroll-loops -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 +LDFLAGS_LOCAL = -L${KML_LIB} -lkm -ltirpc -ljemalloc +CPLUSPLUSLIB = +ESMF_LDFLAG = $(CPLUSPLUSLIB) -+FCOPTIM = -O3 -funroll-loops -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true -fvectorize -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 ++FCOPTIM = -O3 -funroll-loops -mcpu=tsv110 -fvectorize -mllvm -unroll-indirect-loads=true -ljemalloc -mllvm -prefetch-loop-depth=3 -mllvm -min-prefetch-stride=16 -mllvm -prefetch-distance=940 +FCREDUCEDOPT = $(FCOPTIM) +FCNOOPT = -O0 +FCDEBUG = -g # -fbacktrace -ggdb-fcheck=bounds,do,mem,pointer -ffpe-trap=invalid,zero,overflow @@ -33,7 +33,7 @@ diff -Nru WRF-4.2.1/arch/configure.defaults WRF-4.2.1-ok/arch/configure.defaults +FCSUFFIX = +BYTESWAPIO = -fconvert=big-endian +FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) -+FCBASEOPTS = -mcpu=linxicore9100 -mllvm -force-customized-pipeline=true $(OMP) $(FCBASEOPTS_NO_G) ++FCBASEOPTS = -mcpu=tsv110 $(OMP) $(FCBASEOPTS_NO_G) +MODULE_SRCH_FLAG = +TRADFLAG = -traditional +CPP = /lib/cpp -P -- Gitee From 80efa23a5b632b011f4ca882c80603abd69475d1 Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Tue, 5 Mar 2024 10:48:26 +0800 Subject: [PATCH 4/5] wrf - singularity - patch - 1 --- .../wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config index ba48023..58b677c 100644 --- a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config +++ b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config @@ -2,7 +2,7 @@ 11.11.11.11 [DOWNLOAD] -wrf/4.2.1 ${JARVIS_PROXY}/wrf-model/WRF/archive/refs/tags/v4.2.1.tar.gz wrf-4.2.1.tar.gz +wrf/4.2.1 ${JARVIS_PROXY}/wrf-model/WRF/archive/refs/tags/v4.2.1.tar.gz [DEPENDENCY] set -e @@ -64,6 +64,7 @@ case_dir = ${CASE_DIR} [BUILD] cd ${JARVIS_ROOT} +mv downloads/v4.2.1.tar.gz downloads/wrf-4.2.1.tar.gz ./jarvis -e source ./env.sh cd ${JARVIS_ROOT}/workloads -- Gitee From a9590beca0b40657f1029aaebfbde7802addccbc Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Tue, 5 Mar 2024 10:59:37 +0800 Subject: [PATCH 5/5] wrf - singularity - patch - 2 --- .../wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config index 58b677c..b568fe1 100644 --- a/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config +++ b/templates/wrf/4.2.1/bisheng/data.wrf.arm.cpu.singularity.config @@ -2,7 +2,7 @@ 11.11.11.11 [DOWNLOAD] -wrf/4.2.1 ${JARVIS_PROXY}/wrf-model/WRF/archive/refs/tags/v4.2.1.tar.gz +wrf/4.2.1 $JARVIS_PROXY/wrf-model/WRF/archive/refs/tags/v4.2.1.tar.gz wrf-4.2.1.tar.gz [DEPENDENCY] set -e @@ -64,7 +64,6 @@ case_dir = ${CASE_DIR} [BUILD] cd ${JARVIS_ROOT} -mv downloads/v4.2.1.tar.gz downloads/wrf-4.2.1.tar.gz ./jarvis -e source ./env.sh cd ${JARVIS_ROOT}/workloads -- Gitee