Skip to content

Commit f23fceb

Browse files
Fix Frontier performance regression (#413)
Co-authored-by: Henry LE BERRE <[email protected]> Co-authored-by: wilfonba <[email protected]>
1 parent 64d9677 commit f23fceb

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

src/common/m_variables_conversion.fpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#:include 'macros.fpp'
66
#:include 'inline_conversions.fpp'
7-
#:include '../simulation/include/case.fpp'
7+
#:include 'case.fpp'
88

99
!> @brief This module consists of subroutines used in the conversion of the
1010
!! conservative variables into the primitive ones and vice versa. In

src/simulation/m_global_parameters.fpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ module m_global_parameters
110110
#:else
111111
integer :: num_dims !< Number of spatial dimensions
112112
#:endif
113-
integer :: num_fluids
114113
logical :: adv_alphan !< Advection of the last volume fraction
115114
logical :: mpp_lim !< Mixture physical parameters (MPP) limits
116115
integer :: time_stepper !< Time-stepper algorithm
@@ -119,9 +118,11 @@ module m_global_parameters
119118
#:if MFC_CASE_OPTIMIZATION
120119
integer, parameter :: weno_polyn = ${weno_polyn}$ !< Degree of the WENO polynomials (polyn)
121120
integer, parameter :: weno_order = ${weno_order}$ !< Order of the WENO reconstruction
121+
integer, parameter :: num_fluids = ${num_fluids}$ !< number of fluids in the simulation
122122
#:else
123123
integer :: weno_polyn !< Degree of the WENO polynomials (polyn)
124124
integer :: weno_order !< Order of the WENO reconstruction
125+
integer :: num_fluids !< number of fluids in the simulation
125126
#:endif
126127

127128
real(kind(0d0)) :: weno_eps !< Binding for the WENO nonlinear weights
@@ -141,10 +142,10 @@ module m_global_parameters
141142
integer :: cpu_start, cpu_end, cpu_rate
142143

143144
#:if not MFC_CASE_OPTIMIZATION
144-
!$acc declare create(num_dims, weno_polyn, weno_order)
145+
!$acc declare create(num_dims, weno_polyn, weno_order, num_fluids)
145146
#:endif
146147

147-
!$acc declare create(mpp_lim, num_fluids, model_eqns, mixture_err, alt_soundspeed, avg_state, mapped_weno, mp_weno, weno_eps, hypoelasticity)
148+
!$acc declare create(mpp_lim, model_eqns, mixture_err, alt_soundspeed, avg_state, mapped_weno, mp_weno, weno_eps, hypoelasticity)
148149

149150
logical :: relax !< activate phase change
150151
integer :: relax_model !< Relaxation model
@@ -462,7 +463,6 @@ contains
462463

463464
! Simulation algorithm parameters
464465
model_eqns = dflt_int
465-
num_fluids = dflt_int
466466
adv_alphan = .false.
467467
mpp_lim = .false.
468468
time_stepper = dflt_int
@@ -541,6 +541,7 @@ contains
541541
#:if not MFC_CASE_OPTIMIZATION
542542
nb = 1
543543
weno_order = dflt_int
544+
num_fluids = dflt_int
544545
#:endif
545546

546547
R0_type = dflt_int
@@ -634,9 +635,6 @@ contains
634635
! Gamma/Pi_inf Model ===============================================
635636
if (model_eqns == 1) then
636637

637-
! Setting number of fluids
638-
num_fluids = 1
639-
640638
! Annotating structure of the state and flux vectors belonging
641639
! to the system of equations defined by the selected number of
642640
! spatial dimensions and the gamma/pi_inf model

src/simulation/m_start_up.fpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ contains
126126
! Namelist of the global parameters which may be specified by user
127127
namelist /user_inputs/ case_dir, run_time_info, m, n, p, dt, &
128128
t_step_start, t_step_stop, t_step_save, t_step_print, &
129-
model_eqns, num_fluids, adv_alphan, &
129+
model_eqns, adv_alphan, &
130130
mpp_lim, time_stepper, weno_eps, weno_flat, &
131131
riemann_flat, cu_mpi, cu_tensor, &
132132
mapped_weno, mp_weno, weno_avg, &
@@ -141,7 +141,7 @@ contains
141141
rhoref, pref, bubbles, bubble_model, &
142142
R0ref, &
143143
#:if not MFC_CASE_OPTIMIZATION
144-
nb, weno_order, &
144+
nb, weno_order, num_fluids, &
145145
#:endif
146146
Ca, Web, Re_inv, &
147147
monopole, mono, num_mono, &

toolchain/mfc/case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def __get_sim_fpp(self, print: bool) -> str:
176176
#:set nb = {int(self.params.get("nb", 1))}
177177
#:set num_dims = {1 + min(int(self.params.get("n", 0)), 1) + min(int(self.params.get("p", 0)), 1)}
178178
#:set nterms = {nterms}
179+
#:set num_fluids = {int(self.params["num_fluids"])}
179180
"""
180181

181182
return """\

toolchain/mfc/run/case_dicts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186

187187
ALL = list(set(PRE_PROCESS + SIMULATION + POST_PROCESS))
188188

189-
CASE_OPTIMIZATION = [ "nb", "weno_order" ]
189+
CASE_OPTIMIZATION = [ "nb", "weno_order", "num_fluids"]
190190

191191

192192
def get_input_dict_keys(target_name: str) -> list:

toolchain/mfc/run/input.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def __save_fpp(self, target, contents: str) -> None:
3131
cons.print("Writing a (new) custom case.fpp file.")
3232
common.file_write(fpp_path, contents, True)
3333

34-
# pylint: disable=too-many-locals
3534
def generate_fpp(self, target) -> None:
3635
if target.isDependency:
3736
return

0 commit comments

Comments
 (0)