Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/sundials-c…
Browse files Browse the repository at this point in the history
…odes-addons
  • Loading branch information
balos1 committed Apr 3, 2024
2 parents b1a164e + 36ae768 commit 879eca1
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/arkode/CXX_parallel/ark_brusselator1D.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* SUNDIALS Copyright End
* ---------------------------------------------------------------------------*/

#ifndef _ARK_BRUSSELATOR1D_H
#define _ARK_BRUSSELATOR1D_H

#include <cmath>
#include <cstdio>
#include <cstdlib>
Expand Down Expand Up @@ -266,3 +269,5 @@ static int check_retval(void* returnvalue, const char* funcname, int opt);
static void gpuAssert(GPU_PREFIX(Error_t) code, const char* file, int line,
int abort);
#endif

#endif
5 changes: 5 additions & 0 deletions examples/nvector/test_nvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* test an NVECTOR module implementation.
* -----------------------------------------------------------------*/

#ifndef _TEST_NVECTOR_H
#define _TEST_NVECTOR_H

#include <math.h>
#include <sundials/sundials_types.h>

Expand Down Expand Up @@ -146,3 +149,5 @@ void SetTiming(int onoff, int myid);
#ifdef __cplusplus
}
#endif

#endif
5 changes: 5 additions & 0 deletions examples/utilities/custom_memory_helper_gpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* unmanaged memory only and synchronous copies.
* -----------------------------------------------------------------*/

#ifndef _CUSTOM_MEMORY_HELPER_GPU_H
#define _CUSTOM_MEMORY_HELPER_GPU_H

#include <assert.h>
#include <string.h>
#if defined(__NVCC__)
Expand Down Expand Up @@ -157,3 +160,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx)

return helper;
}

#endif
5 changes: 5 additions & 0 deletions examples/utilities/custom_memory_helper_sycl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* unmanaged memory only and synchronous copies.
* -----------------------------------------------------------------*/

#ifndef _CUSTOM_MEMORY_HELPER_SYCL_H
#define _CUSTOM_MEMORY_HELPER_SYCL_H

#include <cstdlib>
#include <sundials/sundials_memory.h>
#include <sycl/sycl.hpp>
Expand Down Expand Up @@ -116,3 +119,5 @@ SUNMemoryHelper MyMemoryHelper(SUNContext sunctx)

return helper;
}

#endif
3 changes: 3 additions & 0 deletions src/arkode/arkode.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ ARKodeMem arkCreate(SUNContext sunctx)
{
arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
"Allocation of step adaptivity structure failed");
arkFree((void**)&ark_mem);
return (NULL);
}
ark_mem->lrw += ARK_ADAPT_LRW;
Expand All @@ -144,6 +145,7 @@ ARKodeMem arkCreate(SUNContext sunctx)
{
arkProcessError(NULL, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
"Allocation of step controller object failed");
arkFree((void**)&ark_mem);
return (NULL);
}
ark_mem->hadapt_mem->owncontroller = SUNTRUE;
Expand Down Expand Up @@ -180,6 +182,7 @@ ARKodeMem arkCreate(SUNContext sunctx)
{
arkProcessError(NULL, 0, __LINE__, __func__, __FILE__,
"Error setting default solver options");
arkFree((void**)&ark_mem);
return (NULL);
}

Expand Down
1 change: 1 addition & 0 deletions src/arkode/arkode_arkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void* ARKStepCreate(ARKRhsFn fe, ARKRhsFn fi, sunrealtype t0, N_Vector y0,
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
MSG_ARK_ARKMEM_FAIL);
ARKStepFree((void**)&ark_mem);
return (NULL);
}
memset(step_mem, 0, sizeof(struct ARKodeARKStepMemRec));
Expand Down
3 changes: 3 additions & 0 deletions src/arkode/arkode_erkstep.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx)
{
arkProcessError(ark_mem, ARK_MEM_FAIL, __LINE__, __func__, __FILE__,
MSG_ARK_ARKMEM_FAIL);
ERKStepFree((void**)&ark_mem);
return (NULL);
}
memset(step_mem, 0, sizeof(struct ARKodeERKStepMemRec));
Expand All @@ -101,6 +102,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx)
{
arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__,
"Error setting default solver options");
ERKStepFree((void**)&ark_mem);
return (NULL);
}

Expand All @@ -124,6 +126,7 @@ void* ERKStepCreate(ARKRhsFn f, sunrealtype t0, N_Vector y0, SUNContext sunctx)
{
arkProcessError(ark_mem, retval, __LINE__, __func__, __FILE__,
"Unable to initialize main ARKODE infrastructure");
ERKStepFree((void**)&ark_mem);
return (NULL);
}

Expand Down
5 changes: 5 additions & 0 deletions src/sundials/sundials_adiak_metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* SUNDIALS Copyright End
* ----------------------------------------------------------------*/

#ifndef _SUNDIALS_ADIAK_METADATA_H
#define _SUNDIALS_ADIAK_METADATA_H

#ifdef SUNDIALS_ADIAK_ENABLED
#include <adiak.h>

Expand Down Expand Up @@ -142,3 +145,5 @@ static void sunAdiakCollectMetadata()
#endif
}
#endif

#endif
5 changes: 5 additions & 0 deletions src/sundials/sundials_iterative_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* different iterative solvers.
* ---------------------------------------------------------------------------*/

#ifndef _SUNDIALS_ITERATIVE_IMPL_H
#define _SUNDIALS_ITERATIVE_IMPL_H

#include <sundials/sundials_iterative.h>

/* -----------------------------------------------------------------------------
Expand All @@ -33,3 +36,5 @@ struct _SUNQRData
N_Vector vtemp2;
sunrealtype* temp_array;
};

#endif

0 comments on commit 879eca1

Please sign in to comment.