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

Backward compatible support for ADIOS2 2.10.x #60

Merged
merged 9 commits into from
Feb 12, 2024

Conversation

nate-sime
Copy link
Contributor

Addresses #59.

Comment on lines 8 to 11
if (packaging.version.parse(adios2.__version__)
>= packaging.version.Version("2.10.0")):
adios2 = adios2.bindings

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or something like

try:
    import adios2.bindings as adios2
except ImportError:
    import adios2

?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, this might be better in case they revert the bindings at some point

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The disadvantage with the try catch is the yielded exception may be confusing regarding the true nature of the problem. I.e. does adios2 exist, or is it simply a scope resolution issue between versions of the package.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about:

def import_adios():
    try:
        import adios2
        return adios2.bindings
    except AttributeError:
        import adios2
        return adios2

@jorgensd jorgensd mentioned this pull request Feb 9, 2024
jorgensd added a commit that referenced this pull request Feb 9, 2024
jorgensd added a commit that referenced this pull request Feb 9, 2024
* Add openmpi and failing adios2 version to CI.

* Remove formatting-check from openmpi

* Add petsc_arch

* Fix outsize dtype

* Add debug print

* Remove error from print

* Set environment variable

* Revert debug print

* Set ompi flags to openmpi pipeline

* Deactivate v2.10.0-rc1 waiting for #60
@jorgensd jorgensd marked this pull request as ready for review February 9, 2024 12:28
@jorgensd jorgensd changed the title Proposal for handling the adios2 interface change Backward compatible support for ADIOS2 2.10.x Feb 12, 2024
@jorgensd jorgensd merged commit 7e08ceb into jorgensd:main Feb 12, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

3 participants