Commit e7b1f5b0 authored by Hal Finkel's avatar Hal Finkel
Browse files

Merge branch 'master' of git.mcs.anl.gov:genericio

Conflicts:
	GNUmakefile
parents b060d3c8 be75350b
......@@ -62,12 +62,17 @@ BLOSC_CPPFLAGS := \
BASE_CPPFLAGS := $(BLOSC_CPPFLAGS) -I. -D__STDC_CONSTANT_MACROS
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
OPENMPFLAG=-fopenmp
endif
FEDIR = frontend
FE_CFLAGS := -g -fPIC -O3 -fopenmp -std=gnu99
FE_CFLAGS := -g -fPIC -O3 $(OPENMPFLAG) -std=gnu99
FE_CPPFLAGS := $(BASE_CPPFLAGS) -Ithirdparty/sqlite -DGENERICIO_NO_MPI
MPIDIR = mpi
MPI_CFLAGS := -g -O3 -fopenmp -std=gnu99
MPI_CFLAGS := -g -O3 $(OPENMPFLAG) -std=gnu99
MPI_CPPFLAGS := $(BASE_CPPFLAGS)
$(FEDIR):
......
......@@ -37,9 +37,10 @@
#
# *****************************************************************************
from __future__ import print_function
import numpy as np
import ctypes as ct
import os
import os,sys
#Define where the library is and load it
_path = os.path.dirname(__file__)
......@@ -71,14 +72,17 @@ libpygio.inspect_gio.restype=None
libpygio.inspect_gio.argtypes=[ct.c_char_p]
def gio_read(file_name,var_name):
if sys.version_info[0] == 3:
file_name = bytes(file_name,'ascii')
var_name = bytes(var_name,'ascii')
var_size = libpygio.get_elem_num(file_name)
var_type = libpygio.get_variable_type(file_name,var_name)
field_count = libpygio.get_variable_field_count(file_name,var_name)
if(var_type==10):
print "Variable not found"
print("Variable not found")
return
elif(var_type==9):
print "variable type not known (not int32/int64/float/double)"
print("variable type not known (not int32/int64/float/double)")
elif(var_type==0):
#float
result = np.ndarray((var_size,field_count),dtype=np.float32)
......@@ -101,10 +105,15 @@ def gio_read(file_name,var_name):
return result
def gio_has_variable(file_name,var_name):
if sys.version_info[0] == 3:
file_name=bytes(file_name,'ascii')
var_name=bytes(var_name,'ascii')
var_size = libpygio.get_elem_num(file_name)
var_type = libpygio.get_variable_type(file_name,var_name)
return var_type!=10
def gio_inspect(file_name):
if sys.version_info[0] == 3:
file_name=bytes(file_name,'ascii')
libpygio.inspect_gio(file_name)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment