Adios2: Python/Fortran bindings -- bug likely in write with different dimensionality / time stepping

Created on 11 Apr 2018  路  24Comments  路  Source: ornladios/ADIOS2

I'm having some issues with writing and reading N-dimensional arrays in Python, possibly over multiple time steps. Here's a test script I made to investigate. Basically, I write a really simple piece of data, and then check if I get the same hash back on the read end. Sometimes I do, sometimes I don't. I attached an example, where I write up to 6-D arrays, over 10 time steps. Doing bpls looks more or less okay.

if __name__ == "__main__":
    comm = MPI.COMM_WORLD

    ndim = int(sys.argv[1])
    ntime = int(sys.argv[2])

    size = comm.Get_size()
    rank = comm.Get_rank()
    globalsizes = []

    hashes = []
    zeros = []

    fw = adios2.open('ND.bp', "w", comm)

    for time in range(ntime):
        h = []
        z = []
        for i in range(ndim):
            ind = i + 1
            shape = np.array([ind]*ind)
            data = (rank+1)*(np.reshape(1+np.arange(np.power(ind, ind), dtype=np.float64), tuple(shape)))

            start = np.zeros(ind, dtype=np.int)
            start[0] = rank * shape[0]
            globalsize = np.copy(shape)
            globalsize[0] *= size
            globalsizes.append(globalsize)

            fw.write("arr{0}".format(ind), data, list(globalsize), list(start), list(shape), endl=True)

            newdata = np.empty(globalsize, dtype=np.float64)
            comm.Gather(data, newdata, root=0)

            if rank == 0:
                newdata.flags.writeable = False
                h.append(hash(newdata.data))
                z.append(np.sum(newdata <= 0))
        hashes.append(h)
        zeros.append(z)
    fw.close()


    fr = adios2.open("ND.bp", "r", comm)
    for time in range(ntime):
        if rank == 0:
            for i in range(ndim):
                ind = i + 1
                data = fr.read("arr{0}".format(ind), np.zeros(ind, dtype=np.int), globalsizes[i], endl=True)

                data.flags.writeable = False

                h = hash(data.data)
                if hashes[time][i] == h:
                    print("time: {1}, dimensionality: {0} OK".format(ind, time))
                else:
                    print("time: {1}, dimensionality: {0} ERROR -- unequal hashes {3} != {4} , {2} obvously bad values returned".format(ind, time, np.sum(data <= 0), hashes[time][i], h))

    fr.close()
mpirun -host localhost -np 4 ./test-nd.py 6 10
time: 0, dimensionality: 1 OK
time: 0, dimensionality: 2 OK
time: 0, dimensionality: 3 OK
time: 0, dimensionality: 4 ERROR -- unequal hashes -5817521839159847613 != 4710672338217278104 , 648 obvously bad values returned
time: 0, dimensionality: 5 OK
time: 0, dimensionality: 6 OK
time: 1, dimensionality: 1 OK
time: 1, dimensionality: 2 OK
time: 1, dimensionality: 3 OK
time: 1, dimensionality: 4 ERROR -- unequal hashes -5817521839159847613 != 1644371425632087350 , 104 obvously bad values returned
time: 1, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != 411882050336115912 , 10576 obvously bad values returned
time: 1, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != -8040249360400408643 , 173120 obvously bad values returned
time: 2, dimensionality: 1 OK
time: 2, dimensionality: 2 OK
time: 2, dimensionality: 3 OK
time: 2, dimensionality: 4 OK
time: 2, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != 6921899629403144131 , 10068 obvously bad values returned
time: 2, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != 1150135602477787782 , 172612 obvously bad values returned
time: 3, dimensionality: 1 OK
time: 3, dimensionality: 2 OK
time: 3, dimensionality: 3 OK
time: 3, dimensionality: 4 OK
time: 3, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != 8606326729852778618 , 9560 obvously bad values returned
time: 3, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != 5384636986928982883 , 172108 obvously bad values returned
time: 4, dimensionality: 1 OK
time: 4, dimensionality: 2 OK
time: 4, dimensionality: 3 OK
time: 4, dimensionality: 4 OK
time: 4, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != -1677615237727256141 , 9052 obvously bad values returned
time: 4, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != -163812680856230090 , 171600 obvously bad values returned
time: 5, dimensionality: 1 OK
time: 5, dimensionality: 2 OK
time: 5, dimensionality: 3 OK
time: 5, dimensionality: 4 OK
time: 5, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != -1583164979516588521 , 8548 obvously bad values returned
time: 5, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != -5321989567651457599 , 171092 obvously bad values returned
time: 6, dimensionality: 1 OK
time: 6, dimensionality: 2 OK
time: 6, dimensionality: 3 OK
time: 6, dimensionality: 4 OK
time: 6, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != 2250494806201746315 , 8040 obvously bad values returned
time: 6, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != -7413598994453349213 , 170584 obvously bad values returned
time: 7, dimensionality: 1 OK
time: 7, dimensionality: 2 OK
time: 7, dimensionality: 3 OK
time: 7, dimensionality: 4 OK
time: 7, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != 6178203745650766318 , 7532 obvously bad values returned
time: 7, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != -3610488979245109061 , 170079 obvously bad values returned
time: 8, dimensionality: 1 OK
time: 8, dimensionality: 2 OK
time: 8, dimensionality: 3 OK
time: 8, dimensionality: 4 OK
time: 8, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != -8130837426127217004 , 7024 obvously bad values returned
time: 8, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != 1935007435453733543 , 169572 obvously bad values returned
time: 9, dimensionality: 1 OK
time: 9, dimensionality: 2 OK
time: 9, dimensionality: 3 OK
time: 9, dimensionality: 4 OK
time: 9, dimensionality: 5 ERROR -- unequal hashes 7537877987181268272 != -2487306817042493317 , 6520 obvously bad values returned
time: 9, dimensionality: 6 ERROR -- unequal hashes -4189560973479895787 != 6528630630600386117 , 169064 obvously bad values returned
bpls2 ND.bp --long
  double  arr1  10*{4}  1 / 4
  double  arr2  10*{8, 2}  1 / 16
  double  arr3  10*{12, 3, 3}  1 / 108
  double  arr4  10*{16, 4, 4, 4}  1 / 1024
  double  arr5  10*{20, 5, 5, 5, 5}  1 / 12500
  double  arr6  10*{24, 6, 6, 6, 6, 6}  1 / 186624
bug

All 24 comments

Thanks @suchyta1 , are the numbers reported by adios1 bpls correct? -d will dump the data.

@williamfgc Good thing to check. No -- there are lots of zeros in the output, and there shouldn't be any. I attached the output. Looking through it, it starts with the expected output, then there'll be a really small value, after which the rest of that rank is zeros.
bpls.txt

OK, @suchyta1 sounds like a write problem then. The reader is just returning the wrong data as-is. I will take a look, try to reproduce and add this to the testing framework. Thanks again.

@williamfgc Thanks, William! I'm going to try to produce some kind of similar test for Fortran too. I think, something similar _might_ be going on, but I haven't been systematic enough in testing to isolate anything whether it's actually an issue in the app.

@suchyta1 Thanks, it might be related to a buffering issue #478 . Yes please, that will help enrich the bindings tests, which is lacking.

@williamfgc Okay, here's some Fortran testing too. I wrote a script to test different dimensionality and time stepping in Fortran. This can't be done quite as simply as for Python, but at any rate the source is here. (Along with the previous Python script too).

For example doing a similar thing as before is below. This is writing a 3D array for two timesteps, and trying that same job 5 times. There are some of the bad values, and sometimes there is a runtime error, but not always.

./fortran-test.sh 3 2
Run 1: dimensionality: 3, times: 2
ERROR: MPI open failed for ftest_3.bp: 'File not found: ftest_3.bp'
ERROR: File open failed: ftest_3.bp

Run 2: dimensionality: 3, times: 2
ERROR: MPI open failed for ftest_3.bp: 'File not found: ftest_3.bp'
ERROR: File open failed: ftest_3.bp

Run 3: dimensionality: 3, times: 2
ERROR: MPI open failed for ftest_3.bp: 'File not found: ftest_3.bp'
ERROR: File open failed: ftest_3.bp

Run 4: dimensionality: 3, times: 2
ERROR: MPI open failed for ftest_3.bp: 'File not found: ftest_3.bp'
ERROR: File open failed: ftest_3.bp

Run 5: dimensionality: 3, times: 2
  double   arr3  2*{9, 3, 3}
    (0,0,0,0)    1 2 3 4 5 6
    (0,0,2,0)    7 8 9 10 11 12
    (0,1,1,0)    3.90283e+19 14 15 16 17 18
    (0,2,0,0)    19 20 21 22 23 24
    (0,2,2,0)    25 26 27 2 4 6
    (0,3,1,0)    8 10 12 14 16 18
    (0,4,0,0)    20 22 24 26 28 30
    (0,4,2,0)    32 34 36 38 40 42
    (0,5,1,0)    44 46 48 50 52 54
    (0,6,0,0)    3 6 9 12 15 18
    (0,6,2,0)    21 24 27 30 33 36
    (0,7,1,0)    -2.1508e+275 42 45 48 51 54
    (0,8,0,0)    57 60 63 66 69 72
    (0,8,2,0)    75 78 81 1 2 3
    (1,0,1,0)    4 5 6 7 8 9
    (1,1,0,0)    10 11 12 3.90283e+19 14 15
    (1,1,2,0)    16 17 18 19 20 21
    (1,2,1,0)    22 23 24 25 26 27
    (1,3,0,0)    2 4 6 8 10 12
    (1,3,2,0)    14 16 18 20 22 24
    (1,4,1,0)    26 28 30 32 34 36
    (1,5,0,0)    38 40 42 44 46 48
    (1,5,2,0)    50 52 54 3 6 9
    (1,6,1,0)    12 15 18 21 24 27
    (1,7,0,0)    30 33 36 -2.1508e+275 42 45
    (1,7,2,0)    48 51 54 57 60 63
    (1,8,1,0)    66 69 72 75 78 81

@suchyta1 can you try only advancing at write at the last value of the iteration. Advance, and endl in Python, affect all variables not just the current one. It is no different from the equivalent in each language, it is just that in adios2 the step (not line) is the logical grouping of data.

I might not be understanding what you mean @williamfgc but I think that's what I'm doing. I'm only writing one array in this case (the only data in file) -- and that's the only write statement in each loop iteration.

Everytime write is called it is advancing the step. It should be only arr"max" doing that. OK, I can see the Fortran example is doing only one variable, but the Python example is advancing the step in every write for multiple variables.

Thanks @williamfgc . That was it in the python script. All the python tests now pass. In Fortran I did not have a barrier that I should. I'll share the results with these fixed next.

On the Fortran side, the last issue I see looks a lot like issue #478. I write a 3x3 array from 3 processes, either from Fortran or Python using the high level API. (And do two runs each.) I attached the two output logs, and the Fortran source file. In summary I see a few bad values from Fortan, but not Python. I also attached the fortran source, and pushed updates into the repo.

program test
    use mpi
    use adios2

    implicit none

    integer, parameter :: ndims=3
    integer :: ierr, size, rank, i
    real(kind=8),    dimension(27)  :: dataarr
    integer(kind=8), dimension(ndims) :: globalsizes, offsets, sizes

    type(adios2_file) :: adios2_fhw, adios2_fhr


    call mpi_init(ierr)
    call mpi_comm_size(mpi_comm_world, size, ierr)
    call mpi_comm_rank(mpi_comm_world, rank, ierr)


    do i=1, ndims
        if (i.eq.1) then
            offsets(i) = rank * ndims
            globalsizes(i) = size * ndims
        else
            offsets(i) = 0
            globalsizes(i) = ndims
        end if
        sizes(i) = ndims
    end do

    do i=1, 27
        dataarr(i) = (rank+1) * (dataarr(i) + i)
    end do


    call adios2_fopen(adios2_fhw, 'ftest_3.bp', adios2_mode_write, MPI_COMM_WORLD, ierr)

    do i=1, 3
        call adios2_fwrite(adios2_fhw, "arr3", dataarr, 3, globalsizes, offsets, sizes, adios2_advance_yes, ierr)
        call mpi_barrier(mpi_comm_world, ierr)
    end do

    call adios2_fclose(adios2_fhw, ierr)


end program test
# fortran.txt
Run 1: dimensionality: 3, times: 3
  double   arr3  3*{9, 3, 3}
    (0,0,0,0)    1 2 3 4 5 6
    (0,0,2,0)    7 8 9 10 11 12
    (0,1,1,0)    5.0812e+173 14 15 16 17 18
    (0,2,0,0)    19 20 21 22 23 24
    (0,2,2,0)    25 26 27 2 4 6
    (0,3,1,0)    8 10 12 14 16 18
    (0,4,0,0)    20 22 24 26 28 30
    (0,4,2,0)    32 34 36 38 40 42
    (0,5,1,0)    44 46 48 50 52 54
    (0,6,0,0)    3 6 9 12 15 18
    (0,6,2,0)    21 24 27 30 33 36
    (0,7,1,0)    39 42 45 48 51 54
    (0,8,0,0)    57 60 63 66 69 72
    (0,8,2,0)    75 78 81 1 2 3
    (1,0,1,0)    4 5 6 7 8 9
    (1,1,0,0)    10 11 12 5.0812e+173 14 15
    (1,1,2,0)    16 17 18 19 20 21
    (1,2,1,0)    22 23 24 25 26 27
    (1,3,0,0)    2 4 6 8 10 12
    (1,3,2,0)    14 16 18 20 22 24
    (1,4,1,0)    26 28 30 32 34 36
    (1,5,0,0)    38 40 42 44 46 48
    (1,5,2,0)    50 52 54 3 6 9
    (1,6,1,0)    12 15 18 21 24 27
    (1,7,0,0)    30 33 36 39 42 45
    (1,7,2,0)    48 51 54 57 60 63
    (1,8,1,0)    66 69 72 75 78 81
    (2,0,0,0)    1 2 3 4 5 6
    (2,0,2,0)    7 8 9 10 11 12
    (2,1,1,0)    5.0812e+173 14 15 16 17 18
    (2,2,0,0)    19 20 21 22 23 24
    (2,2,2,0)    25 26 27 2 4 6
    (2,3,1,0)    8 10 12 14 16 18
    (2,4,0,0)    20 22 24 26 28 30
    (2,4,2,0)    32 34 36 38 40 42
    (2,5,1,0)    44 46 48 50 52 54
    (2,6,0,0)    3 6 9 12 15 18
    (2,6,2,0)    21 24 27 30 33 36
    (2,7,1,0)    39 42 45 48 51 54
    (2,8,0,0)    57 60 63 66 69 72
    (2,8,2,0)    75 78 81


Run 2: dimensionality: 3, times: 3
  double   arr3  3*{9, 3, 3}
    (0,0,0,0)    1 2 3 4 5 6
    (0,0,2,0)    7 8 9 10 11 12
    (0,1,1,0)    13 14 15 16 17 18
    (0,2,0,0)    19 20 21 22 23 24
    (0,2,2,0)    25 26 27 2 4 6
    (0,3,1,0)    8 10 12 14 16 18
    (0,4,0,0)    20 22 24 9.8557e+226 28 30
    (0,4,2,0)    32 34 36 38 40 42
    (0,5,1,0)    44 46 48 50 52 54
    (0,6,0,0)    3 6 9 12 15 18
    (0,6,2,0)    21 24 27 30 33 36
    (0,7,1,0)    4.12371e+241 42 45 48 51 54
    (0,8,0,0)    57 60 63 66 69 72
    (0,8,2,0)    75 78 81 1 2 3
    (1,0,1,0)    4 5 6 7 8 9
    (1,1,0,0)    10 11 12 13 14 15
    (1,1,2,0)    16 17 18 19 20 21
    (1,2,1,0)    22 23 24 25 26 27
    (1,3,0,0)    2 4 6 8 10 12
    (1,3,2,0)    14 16 18 20 22 24
    (1,4,1,0)    9.8557e+226 28 30 32 34 36
    (1,5,0,0)    38 40 42 44 46 48
    (1,5,2,0)    50 52 54 3 6 9
    (1,6,1,0)    12 15 18 21 24 27
    (1,7,0,0)    30 33 36 4.12371e+241 42 45
    (1,7,2,0)    48 51 54 57 60 63
    (1,8,1,0)    66 69 72 75 78 81
    (2,0,0,0)    1 2 3 4 5 6
    (2,0,2,0)    7 8 9 10 11 12
    (2,1,1,0)    13 14 15 16 17 18
    (2,2,0,0)    19 20 21 22 23 24
    (2,2,2,0)    25 26 27 2 4 6
    (2,3,1,0)    8 10 12 14 16 18
    (2,4,0,0)    20 22 24 9.8557e+226 28 30
    (2,4,2,0)    32 34 36 38 40 42
    (2,5,1,0)    44 46 48 50 52 54
    (2,6,0,0)    3 6 9 12 15 18
    (2,6,2,0)    21 24 27 30 33 36
    (2,7,1,0)    4.12371e+241 42 45 48 51 54
    (2,8,0,0)    57 60 63 66 69 72
    (2,8,2,0)    75 78 81



md5-7e6c5325750e637ddec9d98cddee32c7



# python.txt
  double   arr3  3*{9, 3, 3}
    (0,0,0,0)    1 2 3 4 5 6
    (0,0,2,0)    7 8 9 10 11 12
    (0,1,1,0)    13 14 15 16 17 18
    (0,2,0,0)    19 20 21 22 23 24
    (0,2,2,0)    25 26 27 2 4 6
    (0,3,1,0)    8 10 12 14 16 18
    (0,4,0,0)    20 22 24 26 28 30
    (0,4,2,0)    32 34 36 38 40 42
    (0,5,1,0)    44 46 48 50 52 54
    (0,6,0,0)    3 6 9 12 15 18
    (0,6,2,0)    21 24 27 30 33 36
    (0,7,1,0)    39 42 45 48 51 54
    (0,8,0,0)    57 60 63 66 69 72
    (0,8,2,0)    75 78 81 1 2 3
    (1,0,1,0)    4 5 6 7 8 9
    (1,1,0,0)    10 11 12 13 14 15
    (1,1,2,0)    16 17 18 19 20 21
    (1,2,1,0)    22 23 24 25 26 27
    (1,3,0,0)    2 4 6 8 10 12
    (1,3,2,0)    14 16 18 20 22 24
    (1,4,1,0)    26 28 30 32 34 36
    (1,5,0,0)    38 40 42 44 46 48
    (1,5,2,0)    50 52 54 3 6 9
    (1,6,1,0)    12 15 18 21 24 27
    (1,7,0,0)    30 33 36 39 42 45
    (1,7,2,0)    48 51 54 57 60 63
    (1,8,1,0)    66 69 72 75 78 81
    (2,0,0,0)    1 2 3 4 5 6
    (2,0,2,0)    7 8 9 10 11 12
    (2,1,1,0)    13 14 15 16 17 18
    (2,2,0,0)    19 20 21 22 23 24
    (2,2,2,0)    25 26 27 2 4 6
    (2,3,1,0)    8 10 12 14 16 18
    (2,4,0,0)    20 22 24 26 28 30
    (2,4,2,0)    32 34 36 38 40 42
    (2,5,1,0)    44 46 48 50 52 54
    (2,6,0,0)    3 6 9 12 15 18
    (2,6,2,0)    21 24 27 30 33 36
    (2,7,1,0)    39 42 45 48 51 54
    (2,8,0,0)    57 60 63 66 69 72
    (2,8,2,0)    75 78 81

  double   arr3  3*{9, 3, 3}
    (0,0,0,0)    1 2 3 4 5 6
    (0,0,2,0)    7 8 9 10 11 12
    (0,1,1,0)    13 14 15 16 17 18
    (0,2,0,0)    19 20 21 22 23 24
    (0,2,2,0)    25 26 27 2 4 6
    (0,3,1,0)    8 10 12 14 16 18
    (0,4,0,0)    20 22 24 26 28 30
    (0,4,2,0)    32 34 36 38 40 42
    (0,5,1,0)    44 46 48 50 52 54
    (0,6,0,0)    3 6 9 12 15 18
    (0,6,2,0)    21 24 27 30 33 36
    (0,7,1,0)    39 42 45 48 51 54
    (0,8,0,0)    57 60 63 66 69 72
    (0,8,2,0)    75 78 81 1 2 3
    (1,0,1,0)    4 5 6 7 8 9
    (1,1,0,0)    10 11 12 13 14 15
    (1,1,2,0)    16 17 18 19 20 21
    (1,2,1,0)    22 23 24 25 26 27
    (1,3,0,0)    2 4 6 8 10 12
    (1,3,2,0)    14 16 18 20 22 24
    (1,4,1,0)    26 28 30 32 34 36
    (1,5,0,0)    38 40 42 44 46 48
    (1,5,2,0)    50 52 54 3 6 9
    (1,6,1,0)    12 15 18 21 24 27
    (1,7,0,0)    30 33 36 39 42 45
    (1,7,2,0)    48 51 54 57 60 63
    (1,8,1,0)    66 69 72 75 78 81
    (2,0,0,0)    1 2 3 4 5 6
    (2,0,2,0)    7 8 9 10 11 12
    (2,1,1,0)    13 14 15 16 17 18
    (2,2,0,0)    19 20 21 22 23 24
    (2,2,2,0)    25 26 27 2 4 6
    (2,3,1,0)    8 10 12 14 16 18
    (2,4,0,0)    20 22 24 26 28 30
    (2,4,2,0)    32 34 36 38 40 42
    (2,5,1,0)    44 46 48 50 52 54
    (2,6,0,0)    3 6 9 12 15 18
    (2,6,2,0)    21 24 27 30 33 36
    (2,7,1,0)    39 42 45 48 51 54
    (2,8,0,0)    57 60 63 66 69 72
    (2,8,2,0)    75 78 81

fortran.txt
python.txt

@suchyta1 great! thanks for double checking. I wonder if it's 'cause we are passing a linearized 1D array in Fortran rather than an actual 3D array. Still they are both memory contiguous so it shouldn't matter. I am trying to debug now.

@suchyta1 could you make the python test portable to python3...I get an error related to the hash table when running with python3. I want to make it part of the adios2 testing suite, which requires to make it agnostic of python version. Let me know!

@williamfgc Sure. I wasn't aware hash would do that, but that's good to generally know anyway. I could also just use numpy.all() too.

Updated hashing should work in either python 2 or 3.

@suchyta1 great, thanks! In the Fortran test, what do you get if you zero initialize the dataarr. Right now it seems it depends on uninitialized values.

@williamfgc Yes, zero initializing makes the bad values disappear and become what I expect.

@williamfgc

There's now Fortran checking to make sure that the written and read data are the same here.

For example make fortran-test.

@williamfgc I have another test where I'm reading from Python. I'm getting segfaults when I use read() from Python (high level API), and I'm not quite sure why. I generated this with some irrelevant test output from GENE (Fortran), but at any rate, I've attached the .bp data here. (It's too big to attach here).

What I use is a really simple reading script.

#!/usr/bin/env python
from __future__ import absolute_import, division, print_function, unicode_literals

from mpi4py import MPI
import adios2
import numpy as np

if __name__ == "__main__":
    comm = MPI.COMM_WORLD
    fr = adios2.open('g1_adios2.bp', "r", comm)

    datashape = np.zeros(6, dtype=np.int64)

    for i in range(3):

        data = fr.read('global_offsets')
        print(data)

        var = fr.available_variables()
        dshape = var['test']['Shape'].split(',')
        for i in range(len(dshape)):
            datashape[i] = int(dshape[i])
        print(datashape)


        print("reading test")
        #data = fr.read('test', [0,0,0,0,0,0], datashape, 0, 1)
        data = fr.read('test')
        print(data)

        comm.barrier()

    fr.close()
python test.py
[[0 0 0 0]
 [0 0 0 0]
 [0 0 0 0]
 [0 0 0 0]
 [0 1 2 3]
 [0 0 0 0]]
[ 1  4 24 16 64 64]
reading test
Segmentation fault: 11
bpls g1_adios2.bp
  long long  local_dims      10*{6, 4}
  double     test            10*{1, 4, 24, 16, 64, 64}
  double     g_imag          10*{1, 4, 24, 16, 64, 64}
  integer    timestep        10*scalar
  double     g_real          10*{1, 4, 24, 16, 64, 64}
  long long  global_offsets  10*{6, 4}
  long long  rank            10*{4}

The data for "test" should mostly be zeros, but bpls correctly shows a few non-zeros that I expect:

bpls g1_adios2.bp -d test | grep -v "0 0 0 0 0 0"
  double     test            10*{1, 4, 24, 16, 64, 64}
    (0,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (0,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (0,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (1,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (1,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (1,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (2,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (2,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (2,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (3,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (3,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (3,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (4,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (4,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (4,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (5,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (5,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (5,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (6,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (6,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (6,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (7,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (7,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (7,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (8,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (8,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (8,0,3, 0, 0, 0, 0)    3 0 0 0 0 0
    (9,0,1, 0, 0, 0, 0)    1 0 0 0 0 0
    (9,0,2, 0, 0, 0, 0)    2 0 0 0 0 0
    (9,0,3, 0, 0, 0, 0)    3 0 0 0 0 0

@suchyta1 is test a local variable (shape is NULL) or is a global variable? I don't have support for local variable reads, yet. See issue #574

@williamfgc It's a global variable, with these dimensions:
double test 10*{1, 4, 24, 16, 64, 64}. Using fr.available_variables() gets the dimensions correctly when I run the python script.

@suchyta1 is this with the latest master?

@williamfgc Just rebuilt Python with latest master and it looks the same as above. However, the file was produced awhile ago. I"ll rebuild the writer too to make sure that wasn't using something outdated that's since been updated.

@suchyta1 thanks! My guess is that we are blowing up the stack. Can you run valgrind?

Was this page helpful?
0 / 5 - 0 ratings