xref: /honee/src/smartsim_weak.c (revision aa0b7f7657f4e28bd62c02105f76f6156d9627c2)
1*aa0b7f76SJames Wright // Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and other CEED contributors.
2*aa0b7f76SJames Wright // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3*aa0b7f76SJames Wright //
4*aa0b7f76SJames Wright // SPDX-License-Identifier: BSD-2-Clause
5*aa0b7f76SJames Wright //
6*aa0b7f76SJames Wright // This file is part of CEED:  http://github.com/ceed
7*aa0b7f76SJames Wright //
8*aa0b7f76SJames Wright // @file This creates weak functions for smartsim dependent functions. If the smartsim-dependent functions are actually built, these functions are not
9*aa0b7f76SJames Wright // linked to the final executable.
10*aa0b7f76SJames Wright 
11*aa0b7f76SJames Wright #include "../navierstokes.h"
12*aa0b7f76SJames Wright 
13*aa0b7f76SJames Wright PetscErrorCode SGS_DD_TrainingSetup(Ceed ceed, User user, CeedData ceed_data, ProblemData *problem) __attribute__((weak));
14*aa0b7f76SJames Wright PetscErrorCode SGS_DD_TrainingSetup(Ceed ceed, User user, CeedData ceed_data, ProblemData *problem) {
15*aa0b7f76SJames Wright   PetscFunctionBeginUser;
16*aa0b7f76SJames Wright   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with SMARTREDIS_DIR set to run %s", __func__);
17*aa0b7f76SJames Wright };
18*aa0b7f76SJames Wright 
19*aa0b7f76SJames Wright PetscErrorCode TSMonitor_SGS_DD_Training(TS ts, PetscInt step_num, PetscReal solution_time, Vec Q, void *ctx) __attribute__((weak));
20*aa0b7f76SJames Wright PetscErrorCode TSMonitor_SGS_DD_Training(TS ts, PetscInt step_num, PetscReal solution_time, Vec Q, void *ctx) {
21*aa0b7f76SJames Wright   PetscFunctionBeginUser;
22*aa0b7f76SJames Wright   SETERRQ(PETSC_COMM_WORLD, PETSC_ERR_SUP, "Must build with SMARTREDIS_DIR set to run %s", __func__);
23*aa0b7f76SJames Wright };
24*aa0b7f76SJames Wright 
25*aa0b7f76SJames Wright PetscErrorCode SGS_DD_TrainingDataDestroy(SGS_DD_TrainingData sgs_dd_train) __attribute__((weak));
26*aa0b7f76SJames Wright PetscErrorCode SGS_DD_TrainingDataDestroy(SGS_DD_TrainingData sgs_dd_train) {
27*aa0b7f76SJames Wright   PetscFunctionBeginUser;
28*aa0b7f76SJames Wright   if (!sgs_dd_train) PetscFunctionReturn(PETSC_SUCCESS);
29*aa0b7f76SJames Wright   PetscCall(PetscPrintf(PETSC_COMM_WORLD, "Warning: SGS_DD_TrainingData struct should not be initialized if SMARTREDIS_DIR isn't set on build..."));
30*aa0b7f76SJames Wright   PetscFunctionReturn(PETSC_SUCCESS);
31*aa0b7f76SJames Wright }
32