Unverified Commit b916b3c8 authored by Axel Huebl's avatar Axel Huebl
Browse files

Python: long (complex) double

Add long double and long double complex types in Python bindings.
parent 42e20d39
......@@ -63,12 +63,21 @@ varU64 = ioWriter.DefineVariable(
varR32 = ioWriter.DefineVariable(
"varR32", data.R32, shape, start, count, adios2.ConstantDims)
varR64 = ioWriter.DefineVariable(
"varR64", data.R64, shape, start, count, adios2.ConstantDims)
varR128 = ioWriter.DefineVariable(
"varR128", data.R128, shape, start, count, adios2.ConstantDims)
varC32 = ioWriter.DefineVariable(
"varC32", data.C32, shape, start, count, adios2.ConstantDims)
varC64 = ioWriter.DefineVariable(
"varC64", data.C64, shape, start, count, adios2.ConstantDims)
varC128 = ioWriter.DefineVariable(
"varC128", data.C128, shape, start, count, adios2.ConstantDims)
attString = ioWriter.DefineAttribute("attrString", ["hello attribute"])
attI8 = ioWriter.DefineAttribute("attrI8", data.I8)
attC64 = ioWriter.DefineAttribute("attrC64", data.C64)
# ADIOS Engine
writer = ioWriter.Open("npTypes.bp", adios2.Mode.Write)
......@@ -85,6 +94,10 @@ for i in range(0, 3):
npu64 = np.full((Nx), i, dtype=np.uint64)
npr32 = np.full((Nx), i, dtype=np.float32)
npr64 = np.full((Nx), i, dtype=np.float64)
npr128 = np.full((Nx), i, dtype=np.longdouble)
npc32 = np.full((Nx), i, dtype=np.csingle)
npc64 = np.full((Nx), i, dtype=np.cdouble)
npc128 = np.full((Nx), i, dtype=np.clongdouble)
writer.BeginStep()
writer.Put(varI8, npi8)
......@@ -99,6 +112,11 @@ for i in range(0, 3):
writer.Put(varR32, npr32)
writer.Put(varR64, npr64)
writer.Put(varR128, npr128)
writer.Put(varC32, npc32)
writer.Put(varC64, npc64)
writer.Put(varC128, npc128)
writer.EndStep()
writer.Close()
......@@ -110,6 +128,7 @@ reader = ioReader.Open("npTypes.bp", adios2.Mode.Read)
attrString = ioReader.InquireAttribute("attrString")
attrI8 = ioReader.InquireAttribute("attrI8")
attrC64 = ioReader.InquireAttribute("attrC64")
varI8 = ioReader.InquireVariable("varI8")
varI16 = ioReader.InquireVariable("varI16")
......@@ -121,9 +140,14 @@ varU32 = ioReader.InquireVariable("varU32")
varU64 = ioReader.InquireVariable("varU64")
varR32 = ioReader.InquireVariable("varR32")
varR64 = ioReader.InquireVariable("varR64")
varR128 = ioReader.InquireVariable("varR128")
varC32 = ioReader.InquireVariable("varC32")
varC64 = ioReader.InquireVariable("varC64")
varC128 = ioReader.InquireVariable("varC128")
check_object(attrString, "attrString")
check_object(attrString, "attrI8")
check_object(attrString, "attrC64")
check_object(varI8, "varI8")
check_object(varI16, "varI16")
......@@ -135,12 +159,17 @@ check_object(varU32, "varU32")
check_object(varU64, "varU64")
check_object(varR32, "varR32")
check_object(varR64, "varR64")
check_object(varR128, "varR128")
check_object(varC32, "varCR32")
check_object(varC64, "varC64")
check_object(varC128, "varC128")
attr_names = ["attrString", "attrI8"]
attr_names = ["attrString", "attrI8", "attrC64"]
var_names = ["varStr", "varI8", "varI16", "varI32", "varI64",
"varU8", "varU16", "varU32", "varU64",
"varR32", "varR64"]
"varR32", "varR64", "varR128",
"varC32", "varC64", "varC128"]
attributesInfo = ioReader.AvailableAttributes()
for name, info in attributesInfo.items():
......@@ -221,6 +250,30 @@ if varR64 is not None:
inR64 = np.zeros((3, size * Nx), dtype=np.float64)
reader.Get(varR64, inR64)
if varR128 is not None:
varR128.SetSelection([[0], [size * Nx]])
varR128.SetStepSelection([0, 3])
inR128 = np.zeros((3, size * Nx), dtype=np.longdouble)
reader.Get(varR128, inR128)
if varC32 is not None:
varC32.SetSelection([[0], [size * Nx]])
varC32.SetStepSelection([0, 3])
inC32 = np.zeros((3, size * Nx), dtype=np.csingle)
reader.Get(varC32, inC32)
if varC64 is not None:
varC64.SetSelection([[0], [size * Nx]])
varC64.SetStepSelection([0, 3])
inC64 = np.zeros((3, size * Nx), dtype=np.cdouble)
reader.Get(varC64, inC64)
if varC128 is not None:
varC128.SetSelection([[0], [size * Nx]])
varC128.SetStepSelection([0, 3])
inC128 = np.zeros((3, size * Nx), dtype=np.clongdouble)
reader.Get(varC128, inC128)
reader.PerformGets()
for i in range(0, 3):
......@@ -255,6 +308,18 @@ for i in range(0, 3):
if(inR64[i][j] != i):
raise ValueError('failed reading R64')
if(inR128[i][j] != i):
raise ValueError('failed reading R128')
if(inC32[i][j] != i):
raise ValueError('failed reading C32')
if(inC64[i][j] != i):
raise ValueError('failed reading C64')
if(inC128[i][j] != i):
raise ValueError('failed reading C128')
# here tests reader data
reader.Close()
......@@ -39,10 +39,13 @@ Nx = 8
# list of tested attributes and variables
attr_names = ["attrString", "attrI8", "attrI16", "attrI32", "attrI64",
"attrU8", "attrU16", "attrU32", "attrU64", "attrR32", "attrR64"]
"attrU8", "attrU16", "attrU32", "attrU64",
"attrR32", "attrR64", "attrR128",
"attrC32", "attrC64", "attrC128"]
var_names = ["varStr", "varI8", "varI16", "varI32", "varI64",
"varU8", "varU16", "varU32", "varU64",
"varR32", "varR64"]
"varR32", "varR64", "varR128",
"varC32", "varC64", "varC128"]
# Start ADIOS
adios = adios2.ADIOS(comm)
......@@ -78,9 +81,17 @@ varU64 = ioWriter.DefineVariable(
varR32 = ioWriter.DefineVariable(
"varR32", data.R32, shape, start, count, adios2.ConstantDims)
varR64 = ioWriter.DefineVariable(
"varR64", data.R64, shape, start, count, adios2.ConstantDims)
varR128 = ioWriter.DefineVariable(
"varR128", data.R128, shape, start, count, adios2.ConstantDims)
varC32 = ioWriter.DefineVariable(
"varC32", data.C32, shape, start, count, adios2.ConstantDims)
varC64 = ioWriter.DefineVariable(
"varC64", data.C64, shape, start, count, adios2.ConstantDims)
varC128 = ioWriter.DefineVariable(
"varC128", data.C128, shape, start, count, adios2.ConstantDims)
attString = ioWriter.DefineAttribute("attrString", ["one", "two", "three"])
attI8 = ioWriter.DefineAttribute("attrI8", data.I8)
......@@ -93,6 +104,10 @@ attU32 = ioWriter.DefineAttribute("attrU32", data.U32)
attU64 = ioWriter.DefineAttribute("attrU64", data.U64)
attR32 = ioWriter.DefineAttribute("attrR32", data.R32)
attR64 = ioWriter.DefineAttribute("attrR64", data.R64)
attR128 = ioWriter.DefineAttribute("attrR128", data.R128)
attC32 = ioWriter.DefineAttribute("attrC32", data.C32)
attC64 = ioWriter.DefineAttribute("attrC64", data.C64)
attC128 = ioWriter.DefineAttribute("attrC128", data.C128)
ioWriter.SetEngine("BPFile")
ioParams = {}
......@@ -138,6 +153,11 @@ for i in range(0, nsteps):
writer.Put(varR32, data.R32)
writer.Put(varR64, data.R64)
writer.Put(varR128, data.R128)
writer.Put(varC32, data.C32)
writer.Put(varC64, data.C64)
writer.Put(varC128, data.C128)
writer.EndStep()
writer.Close()
......@@ -158,6 +178,10 @@ attrU32 = ioReader.InquireAttribute("attrU32")
attrU64 = ioReader.InquireAttribute("attrU64")
attrR32 = ioReader.InquireAttribute("attrR32")
attrR64 = ioReader.InquireAttribute("attrR64")
attrR128 = ioReader.InquireAttribute("attrR128")
attrC32 = ioReader.InquireAttribute("attrC32")
attrC64 = ioReader.InquireAttribute("attrC64")
attrC128 = ioReader.InquireAttribute("attrC128")
check_object(attrString, "attrString")
check_object(attrI8, "attrI8")
......@@ -170,6 +194,10 @@ check_object(attrU32, "attrU32")
check_object(attrU64, "attrU64")
check_object(attrR32, "attrR32")
check_object(attrR64, "attrR64")
check_object(attrR128, "attrR128")
check_object(attrC32, "attrC32")
check_object(attrC64, "attrC64")
check_object(attrC128, "attrC128")
attrStringData = attrString.DataString()
if(attrStringData[0] != "one"):
......@@ -189,6 +217,10 @@ attrU32Data = attrU32.Data()
attrU64Data = attrU64.Data()
attrR32Data = attrR32.Data()
attrR64Data = attrR64.Data()
attrR128Data = attrR128.Data()
attrC32Data = attrC32.Data()
attrC64Data = attrC64.Data()
attrC128Data = attrC128.Data()
check_array(attrI8Data, data.I8, 'I8')
check_array(attrI16Data, data.I16, 'I16')
......@@ -200,6 +232,10 @@ check_array(attrU32Data, data.U32, 'U32')
check_array(attrU64Data, data.U64, 'U64')
check_array(attrR32Data, data.R32, 'R32')
check_array(attrR64Data, data.R64, 'R64')
check_array(attrR128Data, data.R128, 'R128')
check_array(attrC32Data, data.C32, 'C32')
check_array(attrC64Data, data.C64, 'C64')
check_array(attrC128Data, data.C128, 'C128')
attributesInfo = ioReader.AvailableAttributes()
for name, info in attributesInfo.items():
......@@ -221,6 +257,10 @@ varU32 = ioReader.InquireVariable("varU32")
varU64 = ioReader.InquireVariable("varU64")
varR32 = ioReader.InquireVariable("varR32")
varR64 = ioReader.InquireVariable("varR64")
varR128 = ioReader.InquireVariable("varR128")
varC32 = ioReader.InquireVariable("varC32")
varC64 = ioReader.InquireVariable("varC64")
varC128 = ioReader.InquireVariable("varC128")
check_object(varStr, "varStr")
check_object(varI8, "varI8")
......@@ -233,6 +273,10 @@ check_object(varU32, "varU32")
check_object(varU64, "varU64")
check_object(varR32, "varR32")
check_object(varR64, "varR64")
check_object(varR128, "varR128")
check_object(varC32, "varC32")
check_object(varC64, "varC64")
check_object(varC128, "varC128")
variablesInfo = ioReader.AvailableVariables()
for name, info in variablesInfo.items():
......
......@@ -42,10 +42,17 @@ varU64 = bpIO.DefineVariable(
varR32 = bpIO.DefineVariable(
"varR32", data.R32, [], [], [data.R32.size], adios2.ConstantDims)
varR64 = bpIO.DefineVariable(
"varR64", data.R64, [], [], [data.R64.size], adios2.ConstantDims)
varR128 = bpIO.DefineVariable(
"varR128", data.R128, [], [], [data.R128.size], adios2.ConstantDims)
varC32 = bpIO.DefineVariable(
"varC32", data.C32, [], [], [data.C32.size], adios2.ConstantDims)
varC64 = bpIO.DefineVariable(
"varC64", data.C64, [], [], [data.C64.size], adios2.ConstantDims)
varC128 = bpIO.DefineVariable(
"varC128", data.C128, [], [], [data.C128.size], adios2.ConstantDims)
# ADIOS Engine
bpFileWriter = bpIO.Open("npTypes.bp", adios2.Mode.Write)
......@@ -62,5 +69,10 @@ bpFileWriter.Put(varU64, data.U64)
bpFileWriter.Put(varR32, data.R32)
bpFileWriter.Put(varR64, data.R64)
bpFileWriter.Put(varR128, data.R128)
bpFileWriter.Put(varC32, data.C32)
bpFileWriter.Put(varC64, data.C64)
bpFileWriter.Put(varC128, data.C128)
bpFileWriter.Close()
......@@ -45,6 +45,10 @@ with adios2.open("types_np.bp", "w", comm) as fw:
fw.write("gvarU64", np.array(data.U64[0]))
fw.write("gvarR32", np.array(data.R32[0]))
fw.write("gvarR64", np.array(data.R64[0]))
fw.write("gvarR128", np.array(data.R128[0]))
fw.write("gvarC32", np.array(data.C32[0]))
fw.write("gvarC64", np.array(data.C64[0]))
fw.write("gvarC128", np.array(data.C128[0]))
# single value attributes
fw.write_attribute("attrStr", "Testing single string attribute")
......@@ -58,6 +62,10 @@ with adios2.open("types_np.bp", "w", comm) as fw:
fw.write_attribute("attrU64", np.array(data.U64[0]))
fw.write_attribute("attrR32", np.array(data.R32[0]))
fw.write_attribute("attrR64", np.array(data.R64[0]))
fw.write_attribute("attrR128", np.array(data.R128[0]))
fw.write_attribute("attrC32", np.array(data.C32[0]))
fw.write_attribute("attrC64", np.array(data.C64[0]))
fw.write_attribute("attrC128", np.array(data.C128[0]))
fw.write_attribute(
"attrStrArray", ["string1", "string2", "string3"])
......@@ -71,6 +79,10 @@ with adios2.open("types_np.bp", "w", comm) as fw:
fw.write_attribute("attrU64Array", data.U64)
fw.write_attribute("attrR32Array", data.R32)
fw.write_attribute("attrR64Array", data.R64)
fw.write_attribute("attrR128Array", data.R128)
fw.write_attribute("attrC32Array", data.C32)
fw.write_attribute("attrC64Array", data.C64)
fw.write_attribute("attrC128Array", data.C128)
fw.write("rank", np.array(rank), [adios2.LocalValueDim])
fw.write("steps", "Step:" + str(i))
......@@ -84,6 +96,10 @@ with adios2.open("types_np.bp", "w", comm) as fw:
fw.write("varU64", data.U64, shape, start, count)
fw.write("varR32", data.R32, shape, start, count)
fw.write("varR64", data.R64, shape, start, count)
fw.write("varR128", data.R128, shape, start, count)
fw.write("varC32", data.C32, shape, start, count)
fw.write("varC64", data.C64, shape, start, count)
fw.write("varC128", data.C128, shape, start, count)
if(rank == 0 and i == 0):
fw.write_attribute("varattrStrArray", [
......@@ -99,6 +115,10 @@ with adios2.open("types_np.bp", "w", comm) as fw:
fw.write_attribute("varattrR32Array", data.R32, "varR32")
fw.write_attribute("varattrR64Array", data.R64, "varR64")
fw.write_attribute("varattrR64Value", data.R64, "varR64")
fw.write_attribute("varattrR128Array", data.R128, "varR128")
fw.write_attribute("varattrC32Array", data.C32, "varC32")
fw.write_attribute("varattrC64Array", data.C64, "varC64")
fw.write_attribute("varattrC128Array", data.C128, "varC128")
fw.end_step()
......@@ -137,6 +157,10 @@ with adios2.open("types_np.bp", "r", comm) as fr:
inU64 = fr_step.read("gvarU64")
inR32 = fr_step.read("gvarR32")
inR64 = fr_step.read("gvarR64")
inR128 = fr_step.read("gvarR128")
inC32 = fr_step.read("gvarC32")
inC64 = fr_step.read("gvarC64")
inC128 = fr_step.read("gvarC128")
if(inTag[0] != "Testing ADIOS2 high-level API"):
print("InTag: " + str(inTag))
......@@ -172,6 +196,18 @@ with adios2.open("types_np.bp", "r", comm) as fr:
if(inR64 != data.R64[0]):
raise ValueError('gvarR64 read failed')
if(inR128 != data.R128[0]):
raise ValueError('gvarR128 read failed')
if(inC32 != data.C32[0]):
raise ValueError('gvarC32 read failed')
if(inC64 != data.C64[0]):
raise ValueError('gvarC64 read failed')
if(inC128 != data.C128[0]):
raise ValueError('gvarC128 read failed')
# attributes
inTag = fr_step.read_attribute_string("attrStr")
inI8 = fr_step.read_attribute("attrI8")
......@@ -184,6 +220,10 @@ with adios2.open("types_np.bp", "r", comm) as fr:
inU64 = fr_step.read_attribute("attrU64")
inR32 = fr_step.read_attribute("attrR32")
inR64 = fr_step.read_attribute("attrR64")
inR128 = fr_step.read_attribute("attrR128")
inC32 = fr_step.read_attribute("attrC32")
inC64 = fr_step.read_attribute("attrC64")
inC128 = fr_step.read_attribute("attrC128")
if(inTag[0] != "Testing single string attribute"):
raise ValueError('attr string read failed')
......@@ -218,6 +258,18 @@ with adios2.open("types_np.bp", "r", comm) as fr:
if(inR64[0] != data.R64[0]):
raise ValueError('attrR64 read failed')
if(inR128[0] != data.R128[0]):
raise ValueError('attrR128 read failed')
if(inC32[0] != data.C32[0]):
raise ValueError('attrC32 read failed')
if(inC64[0] != data.C64[0]):
raise ValueError('attrC64 read failed')
if(inC128[0] != data.C128[0]):
raise ValueError('attrC128 read failed')
# Array attribute
inTag = fr_step.read_attribute_string("attrStrArray")
inI8 = fr_step.read_attribute("attrI8Array")
......@@ -230,6 +282,10 @@ with adios2.open("types_np.bp", "r", comm) as fr:
inU64 = fr_step.read_attribute("attrU64Array")
inR32 = fr_step.read_attribute("attrR32Array")
inR64 = fr_step.read_attribute("attrR64Array")
inR128 = fr_step.read_attribute("attrR128Array")
inC32 = fr_step.read_attribute("attrC32Array")
inC64 = fr_step.read_attribute("attrC64Array")
inC128 = fr_step.read_attribute("attrC128Array")
if(inTag != ["string1", "string2", "string3"]):
raise ValueError('attrStrArray read failed')
......@@ -264,6 +320,18 @@ with adios2.open("types_np.bp", "r", comm) as fr:
if((inR64 == data.R64).all() is False):
raise ValueError('attrR64 array read failed')
if((inR128 == data.R128).all() is False):
raise ValueError('attrR128 array read failed')
if((inC32 == data.C32).all() is False):
raise ValueError('attrC32 array read failed')
if((inC64 == data.C64).all() is False):
raise ValueError('attrC64 array read failed')
if((inC128 == data.C128).all() is False):
raise ValueError('attrC128 array read failed')
inTags = fr_step.read_attribute_string("varattrStrArray", "steps")
inI8 = fr_step.read_attribute("varattrI8Array", "varI8")
in16 = fr_step.read_attribute("varattrI16Array", "varI16")
......@@ -275,6 +343,10 @@ with adios2.open("types_np.bp", "r", comm) as fr:
inU64 = fr_step.read_attribute("varattrU64Array", "varU64")
inR32 = fr_step.read_attribute("varattrR32Array", "varR32")
inR64 = fr_step.read_attribute("varattrR64Array", "varR64")
inR128 = fr_step.read_attribute("varattrR128Array", "varR128")
inC32 = fr_step.read_attribute("varattrC32Array", "varC32")
inC64 = fr_step.read_attribute("varattrC64Array", "varC64")
inC128 = fr_step.read_attribute("varattrC128Array", "varC128")
if(inTags != ["varattr1", "varattr2", "varattr3"]):
print(inTags)
......@@ -310,6 +382,18 @@ with adios2.open("types_np.bp", "r", comm) as fr:
if((inR64 == data.R64).all() is False):
raise ValueError('var attrR64 array read failed')
if((inR128 == data.R128).all() is False):
raise ValueError('var attrR128 array read failed')
if((inC32 == data.C32).all() is False):
raise ValueError('var attrC32 array read failed')
if((inC64 == data.C64).all() is False):
raise ValueError('var attrC64 array read failed')
if((inC128 == data.C128).all() is False):
raise ValueError('var attrC128 array read failed')
stepStr = "Step:" + str(step)
instepStr = fr_step.read_string("steps")
......@@ -332,6 +416,10 @@ with adios2.open("types_np.bp", "r", comm) as fr:
indataU64 = fr_step.read("varU64", start, count)
indataR32 = fr_step.read("varR32", start, count)
indataR64 = fr_step.read("varR64", start, count)
indataR128 = fr_step.read("varR128", start, count)
indataC32 = fr_step.read("varC32", start, count)
indataC64 = fr_step.read("varC64", start, count)
indataC128 = fr_step.read("varC128", start, count)
fr_step.end_step()
if((indataI8 == data.I8).all() is False):
......@@ -363,3 +451,15 @@ with adios2.open("types_np.bp", "r", comm) as fr:
if((indataR64 == data.R64).all() is False):
raise ValueError('R64 array read failed')
if((indataR128 == data.R128).all() is False):
raise ValueError('R128 array read failed')
if((indataC32 == data.C32).all() is False):
raise ValueError('C32 array read failed')
if((indataC64 == data.C64).all() is False):
raise ValueError('C64 array read failed')
if((indataC128 == data.C128).all() is False):
raise ValueError('C128 array read failed')
......@@ -49,6 +49,10 @@ with adios2.open("types_np_local.bp", "w", comm) as fw:
fw.write("varU64", data.U64, shape, start, count)
fw.write("varR32", data.R32, shape, start, count)
fw.write("varR64", data.R64, shape, start, count)
fw.write("varR128", data.R128, shape, start, count)
fw.write("varC32", data.C32, shape, start, count)
fw.write("varC64", data.C64, shape, start, count)
fw.write("varC128", data.C128, shape, start, count)
fw.end_step()
......@@ -75,6 +79,10 @@ with adios2.open("types_np_local.bp", "r", comm) as fr:
indataU64 = fr_step.read("varU64", b)
indataR32 = fr_step.read("varR32", b)
indataR64 = fr_step.read("varR64", b)
indataR128 = fr_step.read("varR128", b)
indataC32 = fr_step.read("varC32", b)
indataC64 = fr_step.read("varC64", b)
indataC128 = fr_step.read("varC128", b)
check_array(indataI8, data.I8, 'I8')
check_array(indataI16, data.I16, 'I16')
......@@ -86,3 +94,7 @@ with adios2.open("types_np_local.bp", "r", comm) as fr:
check_array(indataU64, data.U64, 'U64')
check_array(indataR32, data.R32, 'R32')
check_array(indataR64, data.R64, 'R64')
check_array(indataR128, data.R128, 'R128')
check_array(indataC32, data.C32, 'C32')
check_array(indataC64, data.C64, 'C64')
check_array(indataC128, data.C128, 'C128')
......@@ -43,6 +43,10 @@ with adios2.open("types_np.h5", "w", comm, "HDF5") as fw:
fw.write("gvarU64", np.array(data.U64[0]))
fw.write("gvarR32", np.array(data.R32[0]))
fw.write("gvarR64", np.array(data.R64[0]))
fw.write("gvarR128", np.array(data.R128[0]))
fw.write("gvarC32", np.array(data.C32[0]))
fw.write("gvarC64", np.array(data.C64[0]))
fw.write("gvarC128", np.array(data.C128[0]))
# single value attributes
fw.write_attribute("attrStr", "Testing single string attribute")
......@@ -56,6 +60,10 @@ with adios2.open("types_np.h5", "w", comm, "HDF5") as fw:
fw.write_attribute("attrU64", np.array(data.U64[0]))
fw.write_attribute("attrR32", np.array(data.R32[0]))
fw.write_attribute("attrR64", np.array(data.R64[0]))
fw.write_attribute("attrR128", np.array(data.R128[0]))
fw.write_attribute("attrC32", np.array(data.C32[0]))
fw.write_attribute("attrC64", np.array(data.C64[0]))
fw.write_attribute("attrC128", np.array(data.C128[0]))
fw.write_attribute(
"attrStrArray", ["string1", "string2", "string3"])
......@@ -69,6 +77,10 @@ with adios2.open("types_np.h5", "w", comm, "HDF5") as fw:
fw.write_attribute("attrU64Array", data.U64)
fw.write_attribute("attrR32Array", data.R32)
fw.write_attribute("attrR64Array", data.R64)
fw.write_attribute("attrR128Array", data.R128)
fw.write_attribute("attrC32Array", data.C32)
fw.write_attribute("attrC64Array", data.C64)
fw.write_attribute("attrC128Array", data.C128)
fw.write("steps", "Step:" + str(i))
fw.write("varI8", data.I8, shape, start, count)
......@@ -81,6 +93,10 @@ with adios2.open("types_np.h5", "w", comm, "HDF5") as fw:
fw.write("varU64", data.U64, shape, start, count)
fw.write("varR32", data.R32, shape, start, count)
fw.write("varR64", data.R64, shape, start, count)
fw.write("varR128", data.R128, shape, start, count)
fw.write("varC32", data.C32, shape, start, count)
fw.write("varC64", data.C64, shape, start, count)
fw.write("varC128", data.C128, shape, start, count)
if(rank == 0 and i == 0):
fw.write_attribute("varattrStrArray", [
......@@ -96,6 +112,10 @@ with adios2.open("types_np.h5", "w", comm, "HDF5") as fw:
fw.write_attribute("varattrR32Array", data.R32, "varR32")
fw.write_attribute("varattrR64Array", data.R64, "varR64")
fw.write_attribute("varattrR64Value", data.R64, "varR64")
fw.write_attribute("varattrR128Array", data.R128, "varR128")
fw.write_attribute("varattrC32Array", data.C32, "varC32")
fw.write_attribute("varattrC64Array", data.C64, "varC64")
fw.write_attribute("varattrC128Array", data.C128, "varC128")
fw.end_step()
......@@ -131,6 +151,10 @@ with adios2.open("types_np.h5", "r", comm, "HDF5") as fr:
inU64 = fr_step.read("gvarU64")
inR32 = fr_step.read("gvarR32")
inR64 = fr_step.read("gvarR64")
inR128 = fr_step.read("gvarR128")
inC32 = fr_step.read("gvarC32")