Skip to content
Snippets Groups Projects
Commit 52189ace authored by Rafael Ravedutti's avatar Rafael Ravedutti
Browse files

Adjust NVCC flags and print DEM setup info

parent cce65f5b
No related branches found
No related tags found
No related merge requests found
......@@ -10,10 +10,10 @@ obj
obj_cpu
obj_gpu
todo*
lj_cpu
lj_gpu
lj.cu
lj.cpp
md_cpu
md_gpu
md.cu
md.cpp
dem_cpu
dem_gpu
dem.cu
......
......@@ -14,7 +14,9 @@ DEBUG_FLAGS=
# CUDA settings
NVCC=nvcc
NVCC_FLAGS=-O3 -mavx2 -mfma
#NVCC_FLAGS=-O3 -mavx2 -mfma
NVCC_FLAGS=-O3 -arch=sm_80 -mavx2 -mfma -ffast-math -funroll-loops --forward-unknown-to-host-compiler
#NVCC_FLAGS=-O3 -arch=sm_80 -march=native -ffast-math -funroll-loops --forward-unknown-to-host-compiler
NVCC_PATH:="$(shell which ${NVCC})"
CUDA_FLAGS=-DENABLE_CUDA_AWARE_MPI
CUDART_FLAGS=-lcudart -L /apps/SPACK/0.19.1/opt/linux-almalinux8-zen/gcc-8.5.0/nvhpc-23.7-bzxcokzjvx4stynglo4u2ffpljajzlam/Linux_x86_64/23.7/cuda/12.2/targets/x86_64-linux/lib
......
......@@ -151,6 +151,23 @@ int dem_sc_grid(PairsSimulation *ps, double xmax, double ymax, double zmax, doub
last_uid++;
}
int global_nparticles = nparticles;
if(ps->getDomainPartitioner()->getWorldSize() > 1) {
MPI_Allreduce(&nparticles, &global_nparticles, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
}
if(ps->getDomainPartitioner()->getRank() == 0) {
std::cout << "DEM Simple-Cubic Grid" << std::endl;
std::cout << "Domain size: <" << xmax << ", " << ymax << ", " << zmax << ">" << std::endl;
std::cout << "Spacing: " << spacing << std::endl;
std::cout << "Diameter: " << diameter
<< " (min = " << min_diameter << ", max = " << max_diameter << ")" << std::endl;
std::cout << "Initial velocity: " << initial_velocity << std::endl;
std::cout << "Particle density: " << particle_density << std::endl;
std::cout << "Number of types: " << ntypes << std::endl;
std::cout << "Number of particles: " << global_nparticles << std::endl;
}
return nparticles;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment