-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clear sync state of fields for restart #1241
Conversation
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is probably reasonable if we're just replacing all field data by reading from file.
Thanks @psakievich. Note that the current fix generates this error message:
so I put it inside the loop: 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();
} We're testing this out now, let's see if fixes the problems. Lawrence |
It doesn't make sense to do both clear_sync_state and also modify/sync. Where is the field being modified? You should only do modify if you are modifying the field data. Alternatively you do clear_sync_state if you intend to overwrite the field data and you don't care which memory space has the most recent previous modification. |
I'm second guessing this now too @alanw0. The modification is on L3419, but the states are all screwed up. |
What do you mean by 'screwed up'? Keep us posted if you think stk is missing some calls or has things wrong. |
@alanw0 #1190 shouldn't be happening is what I mean. I'm also not really sure why we need this per component code here either though. Seems like it is likely redundant. I also don't think we need a sync to device here either. That should happen at the calling points for the code using the fields on device. Seems like this could be excessive host-device communication. Seems like we should be able to just delete all of this: Lines 3421 to 3435 in 56c0e6d
Provided the ioBroker marks fields as modified on host when it reads them in. |
My apologies, I should have reported this earlier -- adding the Lawrence |
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.Closes #1191