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

HEFFTE support in compressible FHD + Advanced diagnostics for compressible turbulence #146

Open
wants to merge 50 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
40fd574
added code for heffte usage in fhdex; needs testing
isriva Sep 22, 2023
4d6a4b2
heffte compiles fine both on host and cuda device
isriva Sep 27, 2023
965d889
heffte compiles and runs fine, needs longer run testing
isriva Sep 29, 2023
40a635d
heffte works well. needs tests on multiple cuda and amd gpus
isriva Oct 5, 2023
48bca93
flag to restart without advancing time. also more changes to heffte
isriva Oct 9, 2023
b625dc4
more compilation mods to get heffte working on frontier
Oct 11, 2023
d2e0f80
minor change
isriva Oct 12, 2023
5b7ad92
more changes
isriva Oct 12, 2023
c6e97ba
heffte seems to be working now
isriva Oct 27, 2023
f682b7a
get heffte and k-space integration working on frontier
Oct 28, 2023
9d4c66a
GPU-aware MPI compilation on Frontier -- ongoing tests
Nov 2, 2023
ddf50e9
use native amrex functions for MFab reduction
Nov 2, 2023
0abe9cd
reading checkpoint does not require old box array
Nov 2, 2023
124e761
fix typo
Nov 2, 2023
37bd3c3
recompute transport coeff. when restarting for turbulent FFTs
Nov 3, 2023
a7d9004
do reductions on MFab and not BaseFab
isriva Nov 5, 2023
5fff523
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Nov 9, 2023
63e7904
use bulk viscosity in bulk dissipation
isriva Nov 29, 2023
7f7ddfb
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Nov 29, 2023
71549d8
PDFs for turbulence fields: velocity, pressure, density, temperature
isriva Dec 6, 2023
fd59c06
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Dec 6, 2023
b50e410
minor change to PDF calculation
isriva Dec 7, 2023
27a019e
PDFs of decomposed velocities
isriva Dec 7, 2023
d863f84
compute individual vorticity components and their PDFs
isriva Dec 8, 2023
fada4df
include FFTW libraries for heffte fftw backend
isriva Dec 9, 2023
af68571
enable cross-platform compilation
isriva Dec 11, 2023
ef07931
get heffte to compile on perlmutter and more PDF diagnostics
isriva Jan 26, 2024
f671549
spectral calculations for turbulence outupt
isriva Jan 26, 2024
07d1744
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Jan 26, 2024
b819acf
fix spectra calculations
isriva Jan 31, 2024
bb86955
fixed spectral filter calculations
isriva Jan 31, 2024
fd7dddc
build script for frontier
Jan 31, 2024
6c601ce
Merge remote-tracking branch 'origin/fhd_heffte' into fhd_heffte
Jan 31, 2024
86839a5
Merge branch 'main' into fhd_heffte
ajnonaka Sep 12, 2024
9d29d03
Merge remote-tracking branch 'origin/main' into fhd_heffte
Sep 14, 2024
06da690
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Sep 15, 2024
6b60577
setup APIs for AMREX_FFT
isriva Oct 25, 2024
397dc36
Merge remote-tracking branch 'origin/main' into fhd_heffte
isriva Oct 25, 2024
8f8e12d
vorticity components written to plotfiles now
isriva Oct 25, 2024
529902b
corrected spectral filter calculations
isriva Oct 25, 2024
ac3765c
modified Makefiles to build on Perlmutter
isriva Oct 25, 2024
73705a7
Merge remote-tracking branch 'origin/fhd_heffte' into fhd_heffte
isriva Oct 25, 2024
376abb1
build on Frontier
Oct 25, 2024
61be49a
more build files for Frontier
Oct 25, 2024
5dddc8d
Merge remote-tracking branch 'origin/fhd_heffte' into fhd_heffte
Oct 25, 2024
ca1e504
modified build script for Perlmutter
isriva Oct 31, 2024
de7ad32
small fixes to get amrex fft working
isriva Oct 31, 2024
41d1da3
Merge remote-tracking branch 'origin/fhd_heffte' into fhd_heffte
isriva Oct 31, 2024
ce96feb
modified buld script for Frontier
Nov 1, 2024
08439dd
simplification of fft setup
WeiqunZhang Nov 1, 2024
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
41 changes: 33 additions & 8 deletions exec/compressible_stag/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ MAX_SPEC = 8
MAX_REAC = 5

USE_PARTICLES = FALSE
DO_TURB = FALSE
DO_TURB = FALSE

USE_HEFFTE_FFTW = FALSE
USE_HEFFTE_CUFFT = FALSE
USE_HEFFTE_ROCFFT = FALSE
USE_DISTRIBUTED_FFT = TRUE

ifeq ($(USE_HEFFTE_FFTW),TRUE)
HEFFTE_HOME ?= ../../../heffte/
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
HEFFTE_HOME ?= ../../../heffte-org/build_aware/
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
HEFFTE_HOME ?= ../../../heffte-org/build_noaware/
endif

include $(AMREX_HOME)/Tools/GNUMake/Make.defs

Expand All @@ -41,23 +54,35 @@ include ../../src_rng/Make.package
VPATH_LOCATIONS += ../../src_rng/
INCLUDE_LOCATIONS += ../../src_rng/


include ../../src_common/Make.package
VPATH_LOCATIONS += ../../src_common/
INCLUDE_LOCATIONS += ../../src_common/

#ifeq ($(USE_HEFFTE_FFTW),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#endif

ifeq ($(USE_HEFFTE_FFTW),TRUE)
DEFINES += -DHEFFTE_FFTW
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
DEFINES += -DHEFFTE_CUFFT
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
DEFINES += -DHEFFTE_ROCFFT
endif

include $(AMREX_HOME)/Src/Base/Make.package

include ../../src_analysis/Make.package
VPATH_LOCATIONS += ../../src_analysis/
INCLUDE_LOCATIONS += ../../src_analysis/

include $(AMREX_HOME)/Tools/GNUMake/Make.rules

ifeq ($(findstring cgpu, $(HOST)), cgpu)
CXXFLAGS += $(FFTW)
endif

ifeq ($(USE_CUDA),TRUE)
LIBRARIES += -lcufft
else ifeq ($(USE_HIP),TRUE)
Expand All @@ -66,7 +91,7 @@ else ifeq ($(USE_HIP),TRUE)
LIBRARY_LOCATIONS += $(ROC_PATH)/rocfft/lib
LIBRARIES += -L$(ROC_PATH)/rocfft/lib -lrocfft
else
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
endif

ifeq ($(DO_TURB), TRUE)
Expand Down
69 changes: 69 additions & 0 deletions exec/compressible_stag/SPECTRAL_FILTER/GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
AMREX_HOME ?= ../../../../amrex/

DEBUG = FALSE
USE_MPI = TRUE
USE_OMP = FALSE
USE_CUDA = FALSE
USE_HIP = FALSE
COMP = gnu
DIM = 3
TINY_PROFILE = FALSE

USE_HEFFTE_FFTW = FALSE
USE_HEFFTE_CUFFT = FALSE
USE_HEFFTE_ROCFFT = FALSE

ifeq ($(USE_HEFFTE_FFTW),TRUE)
HEFFTE_HOME ?= ../../../../heffte/
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
HEFFTE_HOME ?= ../../../../heffte-org/build_aware/
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
HEFFTE_HOME ?= ../../../../heffte/
endif

include $(AMREX_HOME)/Tools/GNUMake/Make.defs

VPATH_LOCATIONS += .
INCLUDE_LOCATIONS += .

#ifeq ($(USE_HEFFTE_FFTW),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
# include $(HEFFTE_HOME)/src/Make.package
#endif

include ./Make.package
ifeq ($(USE_HEFFTE_FFTW),TRUE)
DEFINES += -DHEFFTE_FFTW
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
else ifeq ($(USE_HEFFTE_CUFFT),TRUE)
DEFINES += -DHEFFTE_CUFFT
VPATH_LOCATIONS += $(HEFFTE_HOME)/include
INCLUDE_LOCATIONS += $(HEFFTE_HOME)/include
LIBRARY_LOCATIONS += $(HEFFTE_HOME)/lib
LIBRARIES += -lheffte
else ifeq ($(USE_HEFFTE_ROCFFT),TRUE)
DEFINES += -DHEFFTE_ROCFFT
endif

include $(AMREX_HOME)/Src/Base/Make.package

include $(AMREX_HOME)/Tools/GNUMake/Make.rules

ifeq ($(USE_CUDA),TRUE)
LIBRARIES += -lcufft
else ifeq ($(USE_HIP),TRUE)
# Use rocFFT. ROC_PATH is defined in amrex
INCLUDE_LOCATIONS += $(ROC_PATH)/rocfft/include
LIBRARY_LOCATIONS += $(ROC_PATH)/rocfft/lib
LIBRARIES += -L$(ROC_PATH)/rocfft/lib -lrocfft
else
LIBRARIES += -L$(FFTW_DIR) -lfftw3_mpi -lfftw3 -lfftw3f
endif

ifeq ($(DO_TURB), TRUE)
DEFINES += -DTURB
endif

5 changes: 5 additions & 0 deletions exec/compressible_stag/SPECTRAL_FILTER/Make.package
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CEXE_sources += main.cpp
CEXE_sources += main_driver.cpp
CEXE_sources += spectral_functions.cpp

CEXE_headers += spectral_functions.H
27 changes: 27 additions & 0 deletions exec/compressible_stag/SPECTRAL_FILTER/build_frontier.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/bash

## load necessary modules
module load craype-accel-amd-gfx90a
module load amd-mixed
#module load rocm/5.2.0 # waiting for 5.6 for next bump
module load cray-mpich/8.1.23
module load cce/15.0.0 # must be loaded after rocm

# GPU-aware MPI
export MPICH_GPU_SUPPORT_ENABLED=1

# optimize CUDA compilation for MI250X
export AMREX_AMD_ARCH=gfx90a

# compiler environment hints
##export CC=$(which hipcc)
##export CXX=$(which hipcc)
##export FC=$(which ftn)
##export CFLAGS="-I${ROCM_PATH}/include"
##export CXXFLAGS="-I${ROCM_PATH}/include -Wno-pass-failed"
##export LDFLAGS="-L${ROCM_PATH}/lib -lamdhip64 ${PE_MPICH_GTL_DIR_amd_gfx90a} -lmpi_gtl_hsa"
export LDFLAGS="-L${MPICH_DIR}/lib -lmpi ${CRAY_XPMEM_POST_LINK_OPTS} -lxpmem ${PE_MPICH_GTL_DIR_amd_gfx90a} ${PE_MPICH_GTL_LIBS_amd_gfx90a}"
export CXXFLAGS="-I${MPICH_DIR}/include"
export HIPFLAGS="--amdgpu-target=gfx90a"

make -j10 USE_HIP=TRUE USE_HEFFTE_ROCFFT=TRUE USE_ASSERTION=TRUE
30 changes: 30 additions & 0 deletions exec/compressible_stag/SPECTRAL_FILTER/build_perlmutter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/bash

# required dependencies
module load cray-fftw
module load cmake
module load cudatoolkit

module list

# necessary to use CUDA-Aware MPI and run a job
export CRAY_ACCEL_TARGET=nvidia80

export MPICH_GPU_SUPPORT_ENABLED=1

# optimize CUDA compilation for A100
export AMREX_CUDA_ARCH=8.0

# optimize CPU microarchitecture for AMD EPYC 3rd Gen (Milan/Zen3)
# note: the cc/CC/ftn wrappers below add those
export CXXFLAGS="-march=znver3"
export CFLAGS="-march=znver3"

# compiler environment hints
export CC=cc
export CXX=CC
export FC=ftn
export CUDACXX=$(which nvcc)
export CUDAHOSTCXX=CC

make -j10 USE_CUDA=TRUE USE_HEFFTE_CUFFT=TRUE USE_ASSERTION=TRUE MAX_SPEC=2
28 changes: 28 additions & 0 deletions exec/compressible_stag/SPECTRAL_FILTER/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <AMReX.H>
//#include <AMReX_ParmParse.H>

// function declaration
void main_driver (const char* argv);

int main (int argc, char* argv[])
{
amrex::Initialize(argc,argv);

// this specific part has been moved to Flagellum/main_driver.cpp
// {
// amrex::ParmParse pp("particles");
//#ifdef AMREX_USE_GPU
// bool particles_do_tiling = true;
//#else
// bool particles_do_tiling = false;
//#endif
// pp.queryAdd("do_tiling", particles_do_tiling);
// }

// argv[1] contains the name of the inputs file entered at the command line
main_driver(argv[1]);

amrex::Finalize();

return 0;
}
Loading
Loading