Skip to content

Commit

Permalink
WIP from Polaris
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwrigh committed May 5, 2023
1 parent 171ba70 commit 70277b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/fluids/problems/sgs_dd_training.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,17 +438,17 @@ PetscErrorCode TSMonitor_SGS_DD_Training(TS ts, PetscInt step_num, PetscReal sol

PetscErrorCode TSPostStep_SGS_DD_Training(TS ts) {
User user;
PetscInt check_run[2] = {0};
const size_t check_run_dims[1] = {2};
const char check_run_key[] = "check-run";
PetscReal check_run[2] = {0};
const size_t check_run_dims[1] = {2}, check_run_key_size = strlen(check_run_key);

PetscFunctionBeginUser;
PetscCall(TSGetApplicationContext(ts, &user));
SmartSimData smartsim = user->smartsim;

SmartRedisCall(unpack_tensor(smartsim->client, "check-run", 9, check_run, check_run_dims, 1, SRTensorTypeDouble, SRMemLayoutContiguous));

SmartRedisCall(unpack_tensor(smartsim->client, check_run_key, check_run_key_size, check_run, check_run_dims, 1, SRTensorTypeDouble, SRMemLayoutContiguous));
if (check_run[0] == 0) {
PetscCall(PetscPrintf(user->comm, "Simulation stopped by 'check-run' tensor in Redis database\n"));
PetscCall(PetscPrintf(user->comm, "-- Simulation stopped by 'check-run' tensor in Redis database\n"));
PetscCall(TSSetConvergedReason(ts, TS_CONVERGED_USER));
}

Expand Down

0 comments on commit 70277b9

Please sign in to comment.