Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: refactored meson files for cray build #1258

Merged
merged 4 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build: refactored meson files for cray build
Refactor meson files to build a CRAY parallel version of MODFLOW using
cray-mpich (7.7.19) and cray-petsc (3.14.5). Bumped minimum version of
meson to 1.1.0. Updated PARALLEL.md with information on installing
OpenMPI and PETSc on MacOS using Homebrew. Added license for PETSc
(this is only added to the license when MODFLOW is built with PETSc.
Added functionality to use MODFLOW 6 PROFESSIONAL in the
header written to the screen and listing files when MODFLOW 6 is built with
PETSC. Added minimal MODFLOW simulation files in .mf6minsim directory
that can be used for testing serial and parallel builds.
  • Loading branch information
jdhughes-usgs committed Jun 16, 2023
commit 2fc8657c747dded5593a0774d4705dd867942fda
20 changes: 20 additions & 0 deletions .hpc/BUILD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Building MODFLOW 6 on HPC systems

## SLURM job

```
sbatch --reservation=dev cray-meson-build.slurm.batch
```

## Interactive job

```
module switch PrgEnv-${PE_ENV,,} PrgEnv-intel
module load cray-petsc meson ninja
export PKG_CONFIG_PATH=/opt/cray/pe/mpt/7.7.19/gni/mpich-intel/16.0/lib/pkgconfig:/opt/cray/pe/petsc/3.14.5.0/real/INTEL/19.1/x86_skylake/lib/pkgconfig:$PKG_CONFIG_PATH

srun --reservation=dev --account=impd --pty bash

meson setup builddir -Ddebug=false --prefix=$(pwd) --libdir=bin -Dcray=true -Ddebug=false --wipe
meson install -C builddir
```
37 changes: 37 additions & 0 deletions .hpc/cray-meson-build.slurm.batch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#SBATCH --job-name=meson-MODFLOW-build
#SBATCH --nodes=1
#SBATCH --ntasks=2
#SBATCH --account=impd
#SBATCH --time=00:10:00
#SBATCH --output=slurm-%j.out

# load appropriate modules
module switch PrgEnv-${PE_ENV,,} PrgEnv-intel
module load cray-petsc meson ninja
export PKG_CONFIG_PATH=/opt/cray/pe/mpt/7.7.19/gni/mpich-intel/16.0/lib/pkgconfig:/opt/cray/pe/petsc/3.14.5.0/real/INTEL/19.1/x86_skylake/lib/pkgconfig:$PKG_CONFIG_PATH

# list loaded modules
module list

# move to root directory
cd ..

# define paths relative to the root directory
MODFLOW6ROOT=$(pwd)
BINDIR=$MODFLOW6ROOT/bin
TESTDIR=$MODFLOW6ROOT/.mf6minsim

# build MODFLOW 6
CC=cc CXX=CC F77=ftn F90=ftn FC=ftn meson setup builddir --prefix=$(pwd) --libdir=bin -Dcray=true -Ddebug=false --wipe
meson install -C builddir

# test MODFLOW 6 build
cd $TESTDIR

# serial run
$BINDIR/mf6

# parallel run
srun $BINDIR/mf6 -p
6 changes: 6 additions & 0 deletions .mf6minsim/.petscrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-ksp_type cg
-pc_type bjacobi
-sub_pc_type ilu
-sub_pc_factor_levels 2
-dvclose 1.0e-6
-options_left no
12 changes: 12 additions & 0 deletions .mf6minsim/leftmodel.chd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN dimensions
MAXBOUND 1
END dimensions

BEGIN period 1
1 1 1 1.00000000
END period 1

21 changes: 21 additions & 0 deletions .mf6minsim/leftmodel.dis
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN dimensions
NLAY 1
NROW 1
NCOL 5
END dimensions

BEGIN griddata
delr
CONSTANT 100.00000000
delc
CONSTANT 100.00000000
top
CONSTANT 10.00000000
botm
CONSTANT -100.00000000
END griddata

6 changes: 6 additions & 0 deletions .mf6minsim/leftmodel.ic
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN griddata
strt
CONSTANT 0.00000000
END griddata

11 changes: 11 additions & 0 deletions .mf6minsim/leftmodel.nam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN packages
DIS6 leftmodel.dis dis
IC6 leftmodel.ic ic
NPF6 leftmodel.npf npf
CHD6 leftmodel.chd chd_0
END packages

13 changes: 13 additions & 0 deletions .mf6minsim/leftmodel.npf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
SAVE_FLOWS
SAVE_SPECIFIC_DISCHARGE
END options

BEGIN griddata
icelltype
CONSTANT 1
k
CONSTANT 1.00000000
END griddata

21 changes: 21 additions & 0 deletions .mf6minsim/mfsim.nam
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN timing
TDIS6 par_gwf01-1d.tdis
END timing

BEGIN models
gwf6 leftmodel.nam leftmodel
gwf6 rightmodel.nam rightmodel
END models

BEGIN exchanges
GWF6-GWF6 par_gwf01-1d.gwfgwf leftmodel rightmodel
END exchanges

BEGIN solutiongroup 1
ims6 par_gwf01-1d.ims leftmodel rightmodel
END solutiongroup 1

13 changes: 13 additions & 0 deletions .mf6minsim/par_gwf01-1d.gwfgwf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
auxiliary ANGLDEGX CDIST
END options

BEGIN dimensions
NEXG 1
END dimensions

BEGIN exchangedata
1 1 5 1 1 1 1 50.00000000 50.00000000 100.00000000 0.00000000 100.00000000
END exchangedata

20 changes: 20 additions & 0 deletions .mf6minsim/par_gwf01-1d.ims
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
PRINT_OPTION all
END options

BEGIN nonlinear
OUTER_DVCLOSE 1.00000000E-08
OUTER_MAXIMUM 100
UNDER_RELAXATION dbd
END nonlinear

BEGIN linear
INNER_MAXIMUM 300
INNER_DVCLOSE 1.00000000E-08
inner_rclose 0.00100000
LINEAR_ACCELERATION cg
RELAXATION_FACTOR 0.0000000
preconditioner_levels 2
END linear

13 changes: 13 additions & 0 deletions .mf6minsim/par_gwf01-1d.tdis
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
TIME_UNITS days
END options

BEGIN dimensions
NPER 1
END dimensions

BEGIN perioddata
1.00000000 1 1.00000000
END perioddata

12 changes: 12 additions & 0 deletions .mf6minsim/rightmodel.chd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN dimensions
MAXBOUND 1
END dimensions

BEGIN period 1
1 1 5 10.00000000
END period 1

23 changes: 23 additions & 0 deletions .mf6minsim/rightmodel.dis
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
XORIGIN 500.00000000
YORIGIN 0.00000000
END options

BEGIN dimensions
NLAY 1
NROW 1
NCOL 5
END dimensions

BEGIN griddata
delr
CONSTANT 100.00000000
delc
CONSTANT 100.00000000
top
CONSTANT 10.00000000
botm
CONSTANT -100.00000000
END griddata

6 changes: 6 additions & 0 deletions .mf6minsim/rightmodel.ic
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN griddata
strt
CONSTANT 0.00000000
END griddata

11 changes: 11 additions & 0 deletions .mf6minsim/rightmodel.nam
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
END options

BEGIN packages
DIS6 rightmodel.dis dis
IC6 rightmodel.ic ic
NPF6 rightmodel.npf npf
CHD6 rightmodel.chd chd_0
END packages

13 changes: 13 additions & 0 deletions .mf6minsim/rightmodel.npf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# File generated by Flopy version 3.3.7 on 06/01/2023 at 12:15:38.
BEGIN options
SAVE_FLOWS
SAVE_SPECIFIC_DISCHARGE
END options

BEGIN griddata
icelltype
CONSTANT 1
k
CONSTANT 1.00000000
END griddata

71 changes: 0 additions & 71 deletions doc/ReleaseNotes/v6.5.0.tex

This file was deleted.

4 changes: 4 additions & 0 deletions meson.options
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
option('parallel', type : 'boolean', value : false, description : 'Parallel build')
option('mpich', type : 'boolean', value : false, description : 'Use MPICH version of MPI')
option('cray', type : 'boolean', value : false, description : 'Parallel build on CRAY with MPICH')
option('buildname', type : 'string', value : 'mf6', description : 'Optional build name')
1 change: 0 additions & 1 deletion meson_options.txt

This file was deleted.

Loading