Skip to content

Commit

Permalink
Merge pull request #109 from ajnonaka/heffte_index_fix
Browse files Browse the repository at this point in the history
Heffte index fix
  • Loading branch information
ajnonaka authored Jan 24, 2024
2 parents 2297e43 + dd0fe54 commit 9f2c82e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 36 deletions.
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

0 comments on commit 9f2c82e

Please sign in to comment.