-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fluids: Move smartsim things to header file
- Loading branch information
Showing
2 changed files
with
34 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2017-2023, Lawrence Livermore National Security, LLC and other CEED contributors. | ||
// All Rights Reserved. See the top-level LICENSE and NOTICE files for details. | ||
// | ||
// SPDX-License-Identifier: BSD-2-Clause | ||
// | ||
// This file is part of CEED: http://github.com/ceed | ||
|
||
#include <c_client.h> | ||
#include <petscsys.h> | ||
#include <sr_enums.h> | ||
|
||
#if defined(__clang_analyzer__) | ||
void SmartRedisCall(SRError); | ||
#else | ||
#define SmartRedisCall(...) \ | ||
do { \ | ||
SRError ierr_smartredis_call_q_; \ | ||
PetscStackUpdateLine; \ | ||
ierr_smartredis_call_q_ = __VA_ARGS__; \ | ||
if (PetscUnlikely(ierr_smartredis_call_q_ != SRNoError)) \ | ||
SETERRQ(PETSC_COMM_SELF, ierr_smartredis_call_q_, "SmartRedis Error (Code %d): %s", ierr_smartredis_call_q_, SRGetLastError()); \ | ||
} while (0) | ||
#endif | ||
|
||
static PetscErrorCode SmartRedisVerifyPutTensor(void *c_client, const char *name, const size_t name_length) { | ||
bool does_exist = false; | ||
PetscFunctionBeginUser; | ||
|
||
SmartRedisCall(tensor_exists(c_client, name, name_length, &does_exist)); | ||
PetscCheck(does_exist, PETSC_COMM_SELF, -1, "Tensor of name '%s' was not written to the database successfully", name); | ||
|
||
PetscFunctionReturn(0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters