Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Bindings hang on read #2081

Open
NAThompson opened this issue Mar 30, 2020 · 2 comments
Open

Python Bindings hang on read #2081

NAThompson opened this issue Mar 30, 2020 · 2 comments

Comments

@NAThompson
Copy link
Contributor

NAThompson commented Mar 30, 2020

Following this example, but without MPI, I get a hang with the following code:

#!/usr/bin/env python3

import math
import argparse
import adios2

def run():
    parser = argparse.ArgumentParser(description=('Graphically displays output of Kortweg-de Vries simulation'))
    arg = parser.add_argument("-f", "--filename", help=".bp filename/directory (default: kdv.bp)", default="kdv.bp")

    options = parser.parse_args()
    
    with adios2.open(options.filename, "r") as file_handle:
        print("opened file")
        for step in file_handle:
            points = file_handle.read("u")
            print("Done showing step")

        print("Done going through steps")

if __name__ == '__main__':
    run()

The statement "Done going through steps" is never printed.

(Note: it also hangs if I do step.read("u").)

The file is produced by the simulation in this PR; this file is successfully examined by bpls:

$ bpls ~/ADIOS2/build/kdv.bp -lav
File info:
  of variables:  1
  of attributes: 3
  statistics:    Min / Max

  double   dx              attr   = 0.0078125
  string   interpretation  attr   = "Equispaced"
  double   u               311*{256} = -1 / 2.71997
  double   x0              attr   = 0

Extra info:

$ python3 --version
Python 3.7.5
$  conda --version
conda 4.8.3
$ python3 -q
>>> import adios
>>> adios2.__version__
'2.5.0.2'
@williamfgc
Copy link
Contributor

williamfgc commented Mar 30, 2020

try:

for step_handle in file_handle:
    points = step_handle.read("u")

check also with the latest master

@NAThompson
Copy link
Contributor Author

Just tried your suggestion; no joy.

Sadly I can't get the Python bindings to compile on master due to #2047.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants