Skip to content
Snippets Groups Projects
helloBPWriter.py 786 B
Newer Older
# clang-format off
#
# Distributed under the OSI-approved Apache License, Version 2.0.  See
# accompanying file Copyright.txt for details.
#
# test_hello.py
#  Created on: Feb 2, 2017
#      Author: William F Godoy godoywf@ornl.gov
import adios2
myArray = np.array([1., 2., 3., 4., 5., 6.])
adios = adios2.ADIOS(MPI.COMM_WORLD, adios2.DebugON)

# Variable
ioArray = bpIO.DefineVariable(
    "bpArray", [myArray.size], [0], [myArray.size], adios2.ConstantDims)
bpFileWriter = bpIO.Open("myArray.bp", adios2.OpenModeWrite)
# bpFileWriter = bpIO.Open("myArray.bp", adiosOpenModeWrite,
# MPI.COMM_WORLD) //doesn't work
bpFileWriter.Write(ioArray, myArray)
bpFileWriter.Close()