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 4c18a6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/fluids/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ LDFLAGS = $(call pkgconf, --libs-only-L --libs-only-other $(PETSc.pc) $(ceed.pc)
LDFLAGS += -Wl,-rpath,$(SMARTREDIS_DIR)/lib64/
LDFLAGS += $(patsubst -L%, $(call pkgconf, --variable=ldflag_rpath $(PETSc.pc))%, $(call pkgconf, --libs-only-L $(PETSc.pc) $(ceed.pc) $(hiredis.pc) $(redis++.pc)))
LDFLAGS += -L$(SMARTREDIS_DIR)/lib64/
LDLIBS = $(call pkgconf, --libs-only-l $(PETSc.pc) $(ceed.pc) $(hiredis.pc) $(redis++.pc)) $(lsmartredis) -lm
LDLIBS = $(call pkgconf, --libs-only-l $(PETSc.pc) $(ceed.pc) $(hiredis.pc) $(redis++.pc)) $(lsmartredis) -lm -lSegFault

OBJDIR := build
SRCDIR := src
Expand Down
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 4c18a6f

Please sign in to comment.