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

Change a few comments and make dust compile on crusher #14

Merged
merged 2 commits into from
Jan 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ ifdef HIPCONFIG
DFLAGS += -DO_HIP
CXXFLAGS += $(HIPCONFIG)
GPUCXX ?= hipcc
GPUFLAGS += -Wall
#GPUFLAGS += -Wall
LD := $(CXX)
LDFLAGS := $(CXXFLAGS) -L$(ROCM_PATH)/lib
LIBS += -lamdhip64
Expand Down
4 changes: 2 additions & 2 deletions builds/make.host.frontier
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ CFLAGS_OPTIMIZE = -g -O2
CXXFLAGS_DEBUG = -g -O0 -std=c++17
CXXFLAGS_OPTIMIZE = -g -Ofast -std=c++17 -Wno-unused-result

GPUFLAGS_OPTIMIZE = -std=c++17 --offload-arch=gfx90a -Wno-unused-result
GPUFLAGS_DEBUG = -g -O0 -std=c++17 --offload-arch=gfx90a -Wno-unused-result
GPUFLAGS_OPTIMIZE = -std=c++17 --offload-arch=gfx90a -Wall -Wno-unused-result
GPUFLAGS_DEBUG = -g -O0 -std=c++17 --offload-arch=gfx90a -Wall -Wno-unused-result
HIPCONFIG = -I$(ROCM_PATH)/include $(shell hipconfig -C) # workaround for Rocm 5.2 warnings
#HIPCONFIG = $(shell hipconfig -C)

Expand Down
4 changes: 2 additions & 2 deletions src/dust/dust_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ __global__ void Dust_Kernel(Real *dev_conserved, int nx, int ny, int nz, int n_g
}

// McKinnon et al. (2017)
__device__ Real calc_tau_sp(Real n, Real T) {
__device__ __host__ Real calc_tau_sp(Real n, Real T) {
Real YR_IN_S = 3.154e7;
Real a1 = 1; // dust grain size in units of 0.1 micrometers
Real d0 = n / (6e-4); // gas density in units of 10^-27 g/cm^3
Expand All @@ -125,7 +125,7 @@ __device__ Real calc_tau_sp(Real n, Real T) {
}

// McKinnon et al. (2017)
__device__ Real calc_dd_dt(Real d_dust, Real tau_sp) {
__device__ __host__ Real calc_dd_dt(Real d_dust, Real tau_sp) {
return -d_dust / (tau_sp/3);
}

Expand Down
2 changes: 1 addition & 1 deletion src/grid/initial_conditions.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*! \file initial_conditions.cpp
/* \brief Definitions of initial conditions for different tests.
* \brief Definitions of initial conditions for different tests.
Note that the grid is mapped to 1D as i + (x_dim)*j + (x_dim*y_dim)*k.
Functions are members of the Grid3D class. */

Expand Down
1 change: 1 addition & 0 deletions src/hydro/hydro_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ Real Calc_dt_GPU(Real *dev_conserved, int nx, int ny, int nz, int n_ghost, int n
}
CudaCheckError();

// Note: dev_dti[0] is DeviceVector syntactic sugar for returning a value via cudaMemcpy
return dev_dti[0];
}

Expand Down
2 changes: 0 additions & 2 deletions src/utils/reduction_utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@
*/
__inline__ __device__ void gridReduceMax(Real val, Real* out)
{
// __syncthreads(); // Wait for all threads to calculate val;
// __syncthreads(); // Wait for all threads to calculate val;

// Reduce the entire block in parallel
val = blockReduceMax(val);
Expand Down