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 index fix #109

Merged
merged 3 commits into from
Jan 24, 2024
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
30 changes: 13 additions & 17 deletions ExampleCodes/heFFTe/Basic/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,31 @@ OR
>> mkdir build
>> cd build

######################
HOST BUILD
######################

>> cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=. \ # can choose any installation /path/to/heffte
-DHeffte_ENABLE_FFTW=ON \
-DHeffte_ENABLE_CUDA=OFF \
..
# NOTE: -DCMAKE_INSTALL_PREFIX can be a different location /path/to/DCMAKE_INSTALL_PREFIX

>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=. -DHeffte_ENABLE_FFTW=ON -DHeffte_ENABLE_CUDA=OFF ..

>> make -j4
>> make install

>> cd /path/to/amrex-tutorials/ExampleCodes/heFFTe/Basic
>> make -j4 HEFFTE_HOME=/path/to/heffte
>> make -j4 HEFFTE_HOME=/path/to/DCMAKE_INSTALL_PREFIX

######################
NVIDIA/CUDA BUILD
######################

# NOTE: -DCMAKE_INSTALL_PREFIX can be a different location /path/to/DCMAKE_INSTALL_PREFIX
# NOTE: -DHeffte_DISABLE_GPU_AWARE_MPI=OFF is not working on perlmutter

>> cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=. \ # can choose any installation /path/to/heffte
-DHeffte_ENABLE_FFTW=ON \
-DHeffte_ENABLE_CUDA=ON \
-DHeffte_DISABLE_GPU_AWARE_MPI=ON \ # OFF is not working on perlmutter
..
>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=. -DHeffte_ENABLE_FFTW=ON -DHeffte_ENABLE_CUDA=ON -DHeffte_DISABLE_GPU_AWARE_MPI=ON ..

>> make -j4
>> make install

>> cd /path/to/amrex-tutorials/ExampleCodes/heFFTe/Basic/
>> make -j4 USE_CUDA=TRUE HEFFTE_HOME=/path/to/heffte
>> make -j4 USE_CUDA=TRUE HEFFTE_HOME=/path/to/DCMAKE_INSTALL_PREFIX
4 changes: 2 additions & 2 deletions ExampleCodes/heFFTe/Basic/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ int main (int argc, char* argv[])
// Avoid division by zero
if (re == 0.0) {
if (im == 0.0){
data(i,j,k,4) = 0.0;
data(i,j,k,3) = 0.0;
} else if (im > 0.0) {
data(i,j,k,3) = M_PI/2.0;
} else {
Expand Down Expand Up @@ -382,7 +382,7 @@ int main (int argc, char* argv[])
// Avoid division by zero
if (re == 0.0) {
if (im == 0.0){
data(i,j,k,4) = 0.0;
data(i,j,k,3) = 0.0;
} else if (im > 0.0) {
data(i,j,k,3) = M_PI/2.0;
} else {
Expand Down
30 changes: 13 additions & 17 deletions ExampleCodes/heFFTe/Poisson/README
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,31 @@ OR
>> mkdir build
>> cd build

######################
HOST BUILD
######################

>> cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=. \ # can choose any installation /path/to/heffte
-DHeffte_ENABLE_FFTW=ON \
-DHeffte_ENABLE_CUDA=OFF \
..
# NOTE: -DCMAKE_INSTALL_PREFIX can be a different location /path/to/DCMAKE_INSTALL_PREFIX

>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=. -DHeffte_ENABLE_FFTW=ON -DHeffte_ENABLE_CUDA=OFF ..

>> make -j4
>> make install

>> cd /path/to/amrex-tutorials/ExampleCodes/heFFTe/Poisson
>> make -j4 HEFFTE_HOME=/path/to/heffte
>> make -j4 HEFFTE_HOME=/path/to/DCMAKE_INSTALL_PREFIX

######################
NVIDIA/CUDA BUILD
######################

# NOTE: -DCMAKE_INSTALL_PREFIX can be a different location /path/to/DCMAKE_INSTALL_PREFIX
# NOTE: -DHeffte_DISABLE_GPU_AWARE_MPI=OFF is not working on perlmutter

>> cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_PREFIX=. \ # can choose any installation /path/to/heffte
-DHeffte_ENABLE_FFTW=ON \
-DHeffte_ENABLE_CUDA=ON \
-DHeffte_DISABLE_GPU_AWARE_MPI=ON \ # OFF is not working on perlmutter
..
>> cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=. -DHeffte_ENABLE_FFTW=ON -DHeffte_ENABLE_CUDA=ON -DHeffte_DISABLE_GPU_AWARE_MPI=ON ..

>> make -j4
>> make install

>> cd /path/to/amrex-tutorials/ExampleCodes/heFFTe/Poisson/
>> make -j4 USE_CUDA=TRUE HEFFTE_HOME=/path/to/heffte
>> make -j4 USE_CUDA=TRUE HEFFTE_HOME=/path/to/DCMAKE_INSTALL_PREFIX
Loading