Skip to content

Commit

Permalink
Merge pull request #177 from AMReX-FHD/cleanup_turb_fft
Browse files Browse the repository at this point in the history
Retain only amrex::FFT for turbulence diagnostics
  • Loading branch information
ajnonaka authored Jan 3, 2025
2 parents de50cab + 1990002 commit 6505147
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 2,026 deletions.
43 changes: 1 addition & 42 deletions exec/compressible_stag/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@ USE_FFT = TRUE
USE_PARTICLES = 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

VPATH_LOCATIONS += .
Expand Down Expand Up @@ -59,41 +46,13 @@ 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 ($(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
include $(AMREX_HOME)/Tools/GNUMake/Make.rules

ifeq ($(DO_TURB), TRUE)
DEFINES += -DTURB
Expand Down
9 changes: 1 addition & 8 deletions src_analysis/Make.package
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,4 @@ CEXE_headers += StructFact.H
CEXE_sources += StructFact.cpp

CEXE_headers += TurbSpectra.H
CEXE_headers += TurbSpectra_distributed.H
CEXE_sources += TurbSpectra_distributed.cpp

#CEXE_sources += TurbSpectra_single.cpp
#CEXE_sources += TurbSpectra_heffte.cpp

#CEXE_headers += TurbSpectra_single.H
#CEXE_headers += TurbSpectra_heffte.H
CEXE_sources += TurbSpectra.cpp
62 changes: 51 additions & 11 deletions src_analysis/TurbSpectra.H
Original file line number Diff line number Diff line change
@@ -1,12 +1,52 @@
#ifndef _TurbSpectra_H_
#define _TurbSpectra_H_

#include <TurbSpectra_distributed.H>
//#if defined(HEFFTE_FFTW) || defined(HEFFTE_CUFFT) || defined(HEFFTE_ROCFFT) // use heFFTe
//#include <TurbSpectra_heffte.H>
//#elif defined(USE_DISTRIBUTED_FFT) // use single grid FFT
//#include <TurbSpectra_distributed.H>
//#else // use single grid FFT
//#include <TurbSpectra_single.H>
//#endif
#ifndef _TurbSpectraDistributed_H_
#define _TurbSpectraDistributed_H_

#include <AMReX.H>
#include <AMReX_MultiFab.H>
#include <AMReX_Vector.H>
#include <AMReX_VisMF.H>

#include <AMReX_GpuComplex.H>

#include <string>

#include "common_functions.H"

#define ALIGN 16

using namespace amrex;


void IntegrateKScalar(const MultiFab& cov_mag,
const std::string& name,
const int& step,
const int& comp);
//void IntegrateKScalarHeffte(const BaseFab<GpuComplex<Real> >& spectral_field,
// const std::string& name, const Real& scaling,
// const Box& c_local_box,
// const Real& sqrtnpts,
// const int& step);
void IntegrateKVelocity(const MultiFab& cov_mag,
const std::string& name,
const int& step,
const int& comp);
//void IntegrateKVelocityHeffte(const BaseFab<GpuComplex<Real> >& spectral_fieldx,
// const BaseFab<GpuComplex<Real> >& spectral_fieldy,
// const BaseFab<GpuComplex<Real> >& spectral_fieldz,
// const std::string& name, const Real& scaling,
// const Box& c_local_box,
// const int& step);
void TurbSpectrumScalar(const MultiFab& variables,
const amrex::Geometry& geom,
const int& step,
const amrex::Vector<amrex::Real>& var_scaling,
const amrex::Vector< std::string >& var_names);
void TurbSpectrumVelDecomp(const MultiFab& vel,
MultiFab& vel_decomp,
const amrex::Geometry& geom,
const int& step,
const amrex::Real& var_scaling,
const amrex::Vector< std::string >& var_names);


#endif
File renamed without changes.
52 changes: 0 additions & 52 deletions src_analysis/TurbSpectra_distributed.H

This file was deleted.

53 changes: 0 additions & 53 deletions src_analysis/TurbSpectra_heffte.H

This file was deleted.

Loading

0 comments on commit 6505147

Please sign in to comment.