Skip to content

Commit

Permalink
Update FFTW benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
samhatfield committed May 12, 2021
1 parent ab66225 commit 0f87ef8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
11 changes: 8 additions & 3 deletions fftw_benchmark/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#===============================================================================
# Makefile for Lorenz '63 model used for investigating half-precision support on
# Fugaku
# Makefile for FFTW benchmark.
#
# ECMWF/RIKEN-CCS
#===============================================================================
Expand All @@ -10,13 +9,19 @@ ifeq ($(FORTCOMP),)
FORTCOMP := frtpx
endif

# Set optimisation flag to -Kfast if not already set
ifeq ($(FORTOPT),)
FORTOPT := -Kfast
endif

# Link to libfjcrt when compiling on Fugaku
ifeq ($(FORTLIB),)
FORTLIB := -lfjcrt
endif

# Define main target
main: main.o
$(FORTCOMP) $(FORTOPT) $(FFTWF_LIB) -o $@ $^
$(FORTCOMP) $(FORTOPT) $(FFTWF_LIB) $(FORTLIB) -o $@ $^

# Define generic target for Fortran 90
%.o: %.F90
Expand Down
12 changes: 6 additions & 6 deletions fftw_benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ It is based on [this](https://gist.github.com/appleparan/c048c44668ede7ef28ba63c
First define the `FFTWF_LIB` environment variable, pointing it to the location
of the FFTW library directory. For example, on Fugaku I set
```
export FFTWF_LIB=-L/vol0004/apps/oss/spack-v0.16/opt/spack/linux-rhel8-a64fx/\
fj-4.3.1/fftw-3.3.8-b6z4s4rfp5ju6m6pa3zr5a2xpbws7zum/lib\
-Wl,-rpath,/vol0004/apps/oss/spack-v0.16/opt/spack/linux-rhel8-a64fx/\
fj-4.3.1/fftw-3.3.8-b6z4s4rfp5ju6m6pa3zr5a2xpbws7zum/lib -lfftw3f
export FFTWF_LIB="-L/vol0004/apps/oss/spack-v0.16/opt/spack/linux-rhel8-a64fx/fj-4.3.1/fujitsu-fftw-master-2irjm2a56j7tahcmggbnde2uxf6gjdml/lib -Wl,-rpath,/vol0004/apps/oss/spack-v0.16/opt/spack/linux-rhel8-a64fx/fj-4.3.1/fujitsu-fftw-master-2irjm2a56j7tahcmggbnde2uxf6gjdml/lib -lfftw3f"
```
which uses the `fujitsu-fftw` Spack module.

Also if you don't want to use the Fujitsu compiler you must also set the
`FORTCOMP` environment variable to your compiler of choice, and set the
`FORTOPT` environment variable with your optimisation flags.
`FORTCOMP` environment variable to your compiler of choice, set the
`FORTOPT` environment variable with your optimisation flags and set the
`FORTLIB` to the empty string.

0 comments on commit 0f87ef8

Please sign in to comment.