Skip to content

Instantly share code, notes, and snippets.

View 0x1mason's full-sized avatar

Eric Millin 0x1mason

  • IBM
  • Durm, Cackalack del Norte
View GitHub Profile
@0x1mason
0x1mason / lock.patch
Created July 25, 2017 00:54
omp lock patch
diff --git a/grib_api/src/grib_context.c b/grib_api/src/grib_context.c
index ecfd1a5..384f005 100644
--- a/grib_api/src/grib_context.c
+++ b/grib_api/src/grib_context.c
@@ -341,6 +341,8 @@ static grib_context default_grib_context = {
0 /* classes */
#if GRIB_PTHREADS
,PTHREAD_MUTEX_INITIALIZER /* mutex */
+#elif GRIB_OMP_THREADS
+ ,0 /* omp_nest_lock_t */
diff --git a/src/grib_context.c b/src/grib_context.c
index d4f5a34..d59b7f3 100644
--- a/src/grib_context.c
+++ b/src/grib_context.c
@@ -1018,8 +1018,12 @@ void codes_assertion_failed(const char* message, const char* file, int line)
/* Default behaviour is to abort
* unless user has supplied his own assertion routine */
if (assertion == NULL) {
+ grib_context* c = NULL;
+ c = grib_context_get_default();
@0x1mason
0x1mason / Ground.cs
Last active December 26, 2017 03:15
ground
using System.Collections.Generic;
namespace Andrey
{
public enum Terrain
{
Forest,
MountainForest,
Marsh,
Desert,