You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The output class is gigantic, but a lot of lines are to deal with update of the views. Instead, we can realy more on the Field class, to perform update, including masking.
The text was updated successfully, but these errors were encountered:
I already started to do some work on this, and one hour already got me quite a lot of work done. I think I'll be able to have something ready for a draft PR early next week. A little sneak-peak: this is the core of the output class update of the tallies, average handling, and call to scorpio. Some methods (like Field::max) will be introduced in the branch.
for (autoconst& name : m_fields_names) {
// Get all the info for this field.constauto& f_in = m_field_mgrs[AfterHRemap]->get_field(name);
constauto& f_out = m_field_mgrs[Scorpio]->get_field(name);
switch (m_avg_type) {
case OutputAvgType::Instant:
f_out.deep_copy(f_in); break;
case OutputAvgType::Max:
f_out.max(f_in); break;
case OutputAvgType::Min:
f_out.min(f_in); break;
case OutputAvgType::Average:
f_out.update(f_in,1,1); break;
default:
EKAT_ERROR_MSG ("Unexpected/unsupported averaging type.\n");
}
if (is_write_step) {
if (output_step and avg_type==OutputAvgType::Average) {
// NOTE: we don't divide by the avg cnt for checkpoint outputif (m_track_avg_cnt) {
constauto avg_cnt = m_field_to_avg_cnt_map.at(name);
// We update f_out as "f_out*avg_cnt_inv + avg_cnt_mask" where//// avg_cnt_int[i] is// 1/avg_cnt[i] if avg_cnt[i]>threshold// 0 otherwise// avg_cnt_mask[i] is// 0 if avg_cnt[i]>threshold// fill_value otherwise// NOTE: the part "+avg_cnt_mask" is only done if the percentage threshold is >0.// If threshold=0, it means we are not worrying about that
f_out.scale(avg_cnt_inv);
if (m_avg_coeff_threshold>0) {
f_out.update(avg_cnt_mask);
}
} else {
// Divide by steps count only when the summation is complete
f_out.scale(1.0 / nsteps_since_last_output);
}
}
// Bring data to host
f_out.sync_to_host();
// Writeauto func_start = std::chrono::steady_clock::now();
scorpio::write_var(filename,name,f_out.get_internal_view_data<Real,Host>());
auto func_finish = std::chrono::steady_clock::now();
auto duration_loc = std::chrono::duration_cast<std::chrono::milliseconds>(func_finish - func_start);
duration_write += duration_loc.count();
}
}
}
The output class is gigantic, but a lot of lines are to deal with update of the views. Instead, we can realy more on the Field class, to perform update, including masking.
The text was updated successfully, but these errors were encountered: