Skip to content

Commit

Permalink
Clear sync state of fields for restart (#1241)
Browse files Browse the repository at this point in the history
* Clear sync state of fields for restart

Sync issues are arising for fields that have been messed with prior to the `populate_restart` call.  For restart, we are just reading from file so sync state should be clear when reading.

* Update Realm.C
  • Loading branch information
psakievich authored Mar 19, 2024
1 parent aa0617e commit 7645bdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Realm.C
Original file line number Diff line number Diff line change
Expand Up @@ -3416,10 +3416,10 @@ Realm::populate_restart(double& timeStepNm1, int& timeStepCount)
auto* field = stk::mesh::get_field_by_name(fname, meta_data());
if (field == nullptr)
continue;

const unsigned numStates = field->number_of_states();
for (unsigned i = 0; i < numStates; ++i) {
auto* fld = field->field_state(static_cast<stk::mesh::FieldState>(i));
fld->clear_sync_state();
fld->modify_on_host();
ngp_field_manager().get_field<double>(fld->mesh_meta_data_ordinal());
fld->sync_to_device();
Expand Down

0 comments on commit 7645bdc

Please sign in to comment.