Skip to content

Commit 727afa9

Browse files
authored
fix some burn failure diagonstics on GPUs (#1635)
if we are on the GPU with printf allowed, we weren't backing up the thermo state
1 parent 83ce77c commit 727afa9

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

integration/integrator_setup_sdc.H

+7-6
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,29 @@ IntegratorT integrator_setup (BurnT& state, amrex::Real dt, bool is_retry)
103103
return int_state;
104104
}
105105

106+
///
107+
/// Save the initial composition and thermodynamic state for
108+
/// diagnostics.
109+
///
106110
template <typename BurnT>
107111
AMREX_GPU_HOST_DEVICE AMREX_INLINE
108112
state_backup_t integrator_backup (const BurnT& state) {
109113

110-
// Save the initial composition and temperature for our later
111-
// diagnostics.
112-
113114
state_backup_t state_save;
114115

115116
#ifndef AMREX_USE_GPU
116117
for (int n = 0; n < NumSpec; ++n) {
117118
state_save.xn_in[n] = state.y[SFS+n] / state.y[SRHO];
118119
}
119-
// we are assuming that the temperature was valid on input
120-
state_save.T_in = state.T;
121120
#ifdef AUX_THERMO
122121
for (int n = 0; n < NumAux; ++n) {
123122
state_save.aux_in[n] = state.y[SFX+n] / state.y[SRHO];
124123
}
125124
#endif
126-
state_save.rhoe_in = state.y[SEINT];
127125
#endif
126+
// we are assuming that the temperature was valid on input
127+
state_save.T_in = state.T;
128+
state_save.rhoe_in = state.y[SEINT];
128129

129130
return state_save;
130131

integration/integrator_setup_strang.H

+5-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ IntegratorT integrator_setup (BurnT& state, amrex::Real dt, bool is_retry)
9595
return int_state;
9696
}
9797

98-
98+
///
99+
/// Save the initial composition and thermodynamic state for
100+
/// diagnostics.
101+
///
99102
template <typename BurnT>
100103
AMREX_GPU_HOST_DEVICE AMREX_INLINE
101104
state_backup_t integrator_backup (const BurnT& state) {
@@ -106,8 +109,8 @@ state_backup_t integrator_backup (const BurnT& state) {
106109
for (int n = 0; n < NumSpec; ++n) {
107110
state_save.xn_in[n] = state.xn[n];
108111
}
109-
state_save.T_in = state.T;
110112
#endif
113+
state_save.T_in = state.T;
111114
state_save.e_in = state.e;
112115

113116
return state_save;

0 commit comments

Comments
 (0)