Skip to content

Commit cf3ac9f

Browse files
CCE 18 on Frontier & Benchmarking fixes among others (#596)
Co-authored-by: Steve Abbott <[email protected]>
1 parent c4c1558 commit cf3ac9f

File tree

308 files changed

+5765
-5620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+5765
-5620
lines changed

.github/workflows/frontier/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
. ./mfc.sh load -c f -m g
4-
./mfc.sh build -j 8 --gpu
4+
./mfc.sh build -j 8 --gpu --sys-hdf5 --sys-fftw

.github/workflows/frontier/test.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
22

3-
./mfc.sh test -j 4 -a -- -c frontier
3+
gpus=`rocm-smi --showid | awk '{print $1}' | grep -Eo '[0-9]+' | uniq | tr '\n' ' '`
4+
ngpus=`echo "$gpus" | tr -d '[:space:]' | wc -c`
5+
6+
./mfc.sh test -j $ngpus --sys-hdf5 --sys-fftw -- -c frontier

.github/workflows/spelling.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,4 @@ jobs:
1111
uses: actions/checkout@v4
1212

1313
- name: Spell Check
14-
uses: crate-ci/typos@master
15-
with:
16-
config: .typos.toml
14+
run: ./mfc.sh spelling

.gitignore

+17-15
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package.json
33
yarn.lock
44
docker-compose.yml
55

6+
.venv/
67
/build/
78
.vscode/
89
src/*/include/case.fpp
@@ -35,26 +36,27 @@ docs/documentation/*-example.png
3536
docs/documentation/examples.md
3637

3738
examples/*batch/*/
38-
examples/*/D/*
39-
examples/*/p*
40-
examples/*/D_*
41-
examples/*/*.inf
42-
examples/*/*.inp
43-
examples/*/*.dat
44-
examples/*/*.o*
45-
examples/*/silo*
46-
examples/*/restart_data*
47-
examples/*/*.out
48-
examples/*/binary
49-
examples/*/fort.1
50-
examples/*/*.sh
51-
examples/*/*.err
52-
examples/*/viz/
39+
examples/**/D/*
40+
examples/**/p*
41+
examples/**/D_*
42+
examples/**/*.inf
43+
examples/**/*.inp
44+
examples/**/*.dat
45+
examples/**/*.o*
46+
examples/**/silo*
47+
examples/**/restart_data*
48+
examples/**/*.out
49+
examples/**/binary
50+
examples/**/fort.1
51+
examples/**/*.sh
52+
examples/**/*.err
53+
examples/**/viz/
5354
examples/*.jpg
5455
examples/*.png
5556
examples/*/workloads/
5657
examples/*/run-*/
5758
examples/*/logs/
59+
examples/**/*.f90
5860
workloads/
5961

6062
benchmarks/*batch/*/

.vscode/settings.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"**/.git": true,
88
"**/.DS_Store": true,
99
"**/build": true,
10-
"*.o": true,
11-
"*.mod": true
10+
"**/*.o": true,
11+
"**/*.mod": true,
1212
},
1313

1414
"cmake.configureOnOpen": false,
@@ -17,7 +17,7 @@
1717

1818
"files.associations": {
1919
"*.f90": "FortranFreeForm",
20-
"*.fpp": "FortranFreeForm"
20+
"*.fpp": "FortranFreeForm",
2121
},
2222

2323
"fortran.preferredCase": "lowercase",
@@ -27,5 +27,5 @@
2727
"${workspacefolder}/src/common",
2828
"${workspacefolder}/src/common/include"
2929
],
30-
"fortran.linter.extraArgs": ["--free-form"]
30+
"fortran.linter.extraArgs": ["--free-form"],
3131
}

CMakeLists.txt

+12-9
Original file line numberDiff line numberDiff line change
@@ -55,24 +55,25 @@ compiler (or a different version thereof), please:\n\
5555
- Install the compiler or load its module. (e.g. module load gcc/10.1)\n\
5656
- Set/Export the C, CXX, and FC environment variables. (e.g. 'export CC=gcc', \
5757
'export CXX=g++', and 'export FC=gfortran'.\n\
58-
- If using mfc.sh, delete the build/<code name> directory and try again. (e.g. 'rm -rf build/pre_process')\n")
58+
- If using mfc.sh, delete the build/<code name> directory and try again. (e.g. 'rm -rf build/pre_process')")
5959

6060
if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
6161
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 5)
62-
message(FATAL_ERROR "${__err_msg}ERROR: GNU v5.0 or newer is required to build MFC.")
62+
message(FATAL_ERROR "ERROR: GNU v5.0 or newer is required to build MFC.\n${__err_msg}")
6363
endif()
6464
if (MFC_OpenACC)
65-
message(FATAL_ERROR "${__err_msg}ERROR: MFC with GPU processing is not currently compatible with GNU compilers. Please use NVIDIA or Cray compilers.")
65+
message(FATAL_ERROR "ERROR: MFC with GPU processing is not currently compatible with GNU compilers. Please use NVIDIA or Cray compilers.\n${__err_msg}")
6666
endif()
6767
elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_ID STREQUAL "PGI"))
6868
if (CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 21.7)
69-
message(FATAL_ERROR "${__err_msg}ERROR: When using NVHPC, v21.7 or newer is required to build MFC.")
69+
message(FATAL_ERROR "ERROR: When using NVHPC, v21.7 or newer is required to build MFC.\n${__err_msg}")
7070
endif()
71-
if ((CMAKE_BUILD_TYPE STREQUAL "Debug") AND MFC_OpenACC)
72-
message(FATAL_ERROR "${__err_msg}ERROR: When using NVHPC, MFC with Debug and GPU options is unavailable.")
71+
72+
if ((CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 23.11) AND (CMAKE_BUILD_TYPE STREQUAL "Debug") AND MFC_OpenACC)
73+
message(FATAL_ERROR "ERROR: When using NVHPC, MFC with Debug and GPU options requires NVHPC v23.11 or newer.\n${__err_msg}")
7374
endif()
7475
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_C_COMPILER_ID STREQUAL "AppleClang")
75-
message(FATAL_ERROR "${__err_msg}ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.")
76+
message(FATAL_ERROR "ERROR: MFC does not support the Apple Clang compilers. Please consult the documentation.\n${__err_msg}")
7677
endif()
7778

7879
# Fypp is required to build MFC. We try to locate it. The path to the binary is
@@ -127,13 +128,15 @@ if (CMAKE_Fortran_COMPILER_ID STREQUAL "GNU")
127128
-fbacktrace
128129
-fimplicit-none
129130
#-ffpe-trap=invalid,zero,denormal,overflow
130-
)
131+
-fsignaling-nans
132+
)
131133
endif()
132134

133135
if (CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER 10)
134136
add_compile_options(
135137
$<$<COMPILE_LANGUAGE:Fortran>:-fallow-invalid-boz>
136138
$<$<COMPILE_LANGUAGE:Fortran>:-fallow-argument-mismatch>
139+
$<$<COMPILE_LANGUAGE:Fortran>:-fcheck=bounds>
137140
)
138141
endif()
139142
elseif (CMAKE_Fortran_COMPILER_ID STREQUAL "Cray")
@@ -183,7 +186,7 @@ elseif ((CMAKE_Fortran_COMPILER_ID STREQUAL "NVHPC") OR (CMAKE_Fortran_COMPILER_
183186
endif()
184187

185188
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
186-
add_compile_options(-C -g -O0 -traceback -Mchkptr -Minform=inform -Mbounds)
189+
add_compile_options(-C -g -O0 -traceback -Minform=inform -Mbounds)
187190
endif()
188191

189192
if (DEFINED ENV{MFC_CUDA_CC})

examples/3D_sphbubcollapse/case.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
# ==========================================================================
4646

4747
# Simulation Algorithm Parameters ==========================================
48-
# Only two patches are necesssary, the background liquid and the
48+
# Only two patches are necessary, the background liquid and the
4949
# gas bubble
5050
'num_patches' : 2,
5151
# Use the 6 equation model

mfc.sh

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ elif [ "$1" '==' "venv" ]; then
3838
shift; . "$(pwd)/toolchain/bootstrap/python.sh" $@; return
3939
elif [ "$1" '==' "clean" ]; then
4040
rm -rf "$(pwd)/build"; exit 0
41+
elif [ "$1" '==' "spelling" ]; then
42+
. "$(pwd)/toolchain/bootstrap/python.sh"
43+
44+
shift; . "$(pwd)/toolchain/bootstrap/spelling.sh" $@; exit 0
4145
fi
4246

4347
mkdir -p "$(pwd)/build"

src/pre_process/m_data_output.fpp

+6
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,12 @@ contains
367367
end if
368368
end if
369369

370+
if (precision == 1) then
371+
FMT = "(4F30.7)"
372+
else
373+
FMT = "(4F40.14)"
374+
end if
375+
370376
! 3D
371377
if (p > 0) then
372378
do i = 1, sys_size

src/simulation/m_fftw.fpp

+20-14
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ module m_fftw
5757
@:CRAY_DECLARE_GLOBAL(complex(kind(0d0)), dimension(:), data_fltr_cmplx_gpu)
5858
!$acc declare link(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu)
5959
#else
60-
real(kind(0d0)), allocatable :: data_real_gpu(:)
61-
complex(kind(0d0)), allocatable :: data_cmplx_gpu(:)
62-
complex(kind(0d0)), allocatable :: data_fltr_cmplx_gpu(:)
60+
real(kind(0d0)), allocatable, target :: data_real_gpu(:)
61+
complex(kind(0d0)), allocatable, target :: data_cmplx_gpu(:)
62+
complex(kind(0d0)), allocatable, target :: data_fltr_cmplx_gpu(:)
6363
!$acc declare create(data_real_gpu, data_cmplx_gpu, data_fltr_cmplx_gpu)
6464
#endif
6565

@@ -141,7 +141,8 @@ contains
141141
subroutine s_apply_fourier_filter(q_cons_vf)
142142

143143
type(scalar_field), dimension(sys_size), intent(inout) :: q_cons_vf
144-
144+
real(c_double), pointer :: p_real(:)
145+
complex(c_double_complex), pointer :: p_cmplx(:), p_fltr_cmplx(:)
145146
integer :: i, j, k, l !< Generic loop iterators
146147

147148
! Restrict filter to processors that have cells adjacent to axis
@@ -166,11 +167,16 @@ contains
166167
end do
167168
end do
168169

169-
!$acc host_data use_device(data_real_gpu, data_cmplx_gpu)
170+
p_real => data_real_gpu
171+
p_cmplx => data_cmplx_gpu
172+
p_fltr_cmplx => data_fltr_cmplx_gpu
173+
174+
!$acc data attach(p_real, p_cmplx, p_fltr_cmplx)
175+
!$acc host_data use_device(p_real, p_cmplx, p_fltr_cmplx)
170176
#if defined(__PGI)
171177
ierr = cufftExecD2Z(fwd_plan_gpu, data_real_gpu, data_cmplx_gpu)
172178
#else
173-
ierr = hipfftExecD2Z(fwd_plan_gpu, c_loc(data_real_gpu), c_loc(data_cmplx_gpu))
179+
ierr = hipfftExecD2Z(fwd_plan_gpu, c_loc(p_real), c_loc(p_cmplx))
174180
call hipCheck(hipDeviceSynchronize())
175181
#endif
176182
!$acc end host_data
@@ -186,11 +192,11 @@ contains
186192
end do
187193
end do
188194

189-
!$acc host_data use_device(data_real_gpu, data_fltr_cmplx_gpu)
195+
!$acc host_data use_device(p_real, p_fltr_cmplx)
190196
#if defined(__PGI)
191197
ierr = cufftExecZ2D(bwd_plan_gpu, data_fltr_cmplx_gpu, data_real_gpu)
192198
#else
193-
ierr = hipfftExecZ2D(bwd_plan_gpu, c_loc(data_fltr_cmplx_gpu), c_loc(data_real_gpu))
199+
ierr = hipfftExecZ2D(bwd_plan_gpu, c_loc(p_fltr_cmplx), c_loc(p_real))
194200
call hipCheck(hipDeviceSynchronize())
195201
#endif
196202
!$acc end host_data
@@ -225,11 +231,11 @@ contains
225231
end do
226232
end do
227233

228-
!$acc host_data use_device(data_real_gpu, data_cmplx_gpu)
234+
!$acc host_data use_device(p_real, p_cmplx)
229235
#if defined(__PGI)
230236
ierr = cufftExecD2Z(fwd_plan_gpu, data_real_gpu, data_cmplx_gpu)
231237
#else
232-
ierr = hipfftExecD2Z(fwd_plan_gpu, c_loc(data_real_gpu), c_loc(data_cmplx_gpu))
238+
ierr = hipfftExecD2Z(fwd_plan_gpu, c_loc(p_real), c_loc(p_cmplx))
233239
call hipCheck(hipDeviceSynchronize())
234240
#endif
235241
!$acc end host_data
@@ -246,11 +252,11 @@ contains
246252
end do
247253
end do
248254

249-
!$acc host_data use_device(data_real_gpu, data_fltr_cmplx_gpu)
255+
!$acc host_data use_device(p_real, p_fltr_cmplx)
250256
#if defined(__PGI)
251257
ierr = cufftExecZ2D(bwd_plan_gpu, data_fltr_cmplx_gpu, data_real_gpu)
252258
#else
253-
ierr = hipfftExecZ2D(bwd_plan_gpu, c_loc(data_fltr_cmplx_gpu), c_loc(data_real_gpu))
259+
ierr = hipfftExecZ2D(bwd_plan_gpu, c_loc(p_fltr_cmplx), c_loc(p_real))
254260
call hipCheck(hipDeviceSynchronize())
255261
#endif
256262
!$acc end host_data
@@ -297,8 +303,8 @@ contains
297303
end do
298304
end do
299305
#endif
300-
301-
end subroutine s_apply_fourier_filter
306+
!$acc end data
307+
end subroutine s_apply_fourier_filter ! --------------------------------
302308

303309
!> The purpose of this subroutine is to destroy the fftw plan
304310
!! that will be used in the forward and backward DFTs when

0 commit comments

Comments
 (0)