From 7645bdc429f6e6d0308e50ff46c02608046e319e Mon Sep 17 00:00:00 2001 From: psakievich Date: Tue, 19 Mar 2024 10:44:45 -0600 Subject: [PATCH] Clear sync state of fields for restart (#1241) * 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 --- src/Realm.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Realm.C b/src/Realm.C index 9391d2925..42519e33b 100644 --- a/src/Realm.C +++ b/src/Realm.C @@ -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(i)); + fld->clear_sync_state(); fld->modify_on_host(); ngp_field_manager().get_field(fld->mesh_meta_data_ordinal()); fld->sync_to_device();