Repository navigation
Add submodule mpi #40
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
Open
wdeconinck
wants to merge
5
commits into
improve-config
Choose a base branch
from
mpi
base: improve-config
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
dd4e6cf
Add submodule mpi
wdeconinck d0cb7e5
Fix atlas4py_parse_version duplication and possible undefined variables
wdeconinck 2ed68d3
Fix commented example
wdeconinck fd337a6
Be more explicit that the mpi comm is converted to int
wdeconinck d0badb5
Cleanup
wdeconinck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #pragma once | ||
|
|
||
| #define ATLAS4PY_ATLAS_VERSION_AT_LEAST(x, y, z) (ATLAS4PY_ATLAS_VERSION_INT >= x * 10000 + y * 100 + z) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # This file defines a function to parse version strings and export version components as CMake variables. | ||
|
|
||
| ############################################################################## | ||
| #.rst: | ||
| # | ||
| # atlas4py_parse_version | ||
| # ===================== | ||
| # | ||
| # Parse version string of the form "<major>[.<minor>[.<patch>[.<tweak>]]][<suffix>]" :: | ||
| # | ||
| # atlas4py_parse_version( <version_str> [ PREFIX <prefix> ] ) | ||
| # | ||
| # Options | ||
| # ------- | ||
| # | ||
| # PREFIX : optional | ||
| # string to be prefixed to all defined variables. If not given, | ||
| # the value "_" will be used. | ||
| # | ||
| # Notes | ||
| # ----- | ||
| # | ||
| # Following variables if possible: | ||
| # | ||
| # <prefix>_VERSION_STR = <major>[.<minor>[.<patch>[.<tweak>]]][<suffix>] | ||
| # <prefix>_VERSION = <major>[.<minor>[.<patch>[.<tweak>]]] | ||
| # <prefix>_VERSION_MAJOR = <major> | ||
| # <prefix>_VERSION_MINOR = <minor> | ||
| # <prefix>_VERSION_PATCH = <patch> | ||
| # <prefix>_VERSION_TWEAK = <tweak> | ||
| # <prefix>_VERSION_SUFFIX = <suffix> | ||
| # <prefix>_VERSION_INT = <major> * 10000 + <minor> * 100 + <patch> | ||
| # | ||
| # Note, this is taken from ecbuild_parse_version.cmake, with addition of <prefix>_VERSION_INT | ||
|
|
||
| function( atlas4py_parse_version version_str ) | ||
| set( options ) | ||
| set( single_value_args PREFIX ) | ||
| set( multi_value_args ) | ||
|
|
||
| cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${ARGN} ) | ||
|
|
||
| if( NOT _PAR_PREFIX ) | ||
| set( prefix "_" ) | ||
| else() | ||
| set( prefix ${_PAR_PREFIX} ) | ||
| endif() | ||
|
|
||
| ## Parse version_str | ||
| set( ${prefix}_VERSION_STR "${version_str}" ) | ||
| string( REGEX REPLACE "^((([0-9]+)\\.)+([0-9]+)).*" "\\1" ${prefix}_VERSION "${version_str}" ) | ||
| string( LENGTH "${${prefix}_VERSION}" ver_len ) | ||
| string( SUBSTRING "${version_str}" ${ver_len} -1 ${prefix}_VERSION_SUFFIX ) | ||
| string( REPLACE "." " " _version_list ${${prefix}_VERSION} ) # dots to spaces | ||
| separate_arguments( _version_list ) | ||
| list (LENGTH _version_list _len) | ||
| if( ${_len} GREATER 0 ) | ||
| list( GET _version_list 0 ${prefix}_VERSION_MAJOR ) | ||
| endif() | ||
| if( ${_len} GREATER 1 ) | ||
| list( GET _version_list 1 ${prefix}_VERSION_MINOR ) | ||
| endif() | ||
| if( ${_len} GREATER 2 ) | ||
| list( GET _version_list 2 ${prefix}_VERSION_PATCH ) | ||
| endif() | ||
| if( ${_len} GREATER 3 ) | ||
| list( GET _version_list 3 ${prefix}_VERSION_TWEAK ) | ||
| endif() | ||
|
|
||
| if( NOT DEFINED ${prefix}_VERSION_MINOR ) | ||
| set( ${prefix}_VERSION_MINOR 0 ) | ||
| endif() | ||
| if( NOT DEFINED ${prefix}_VERSION_PATCH ) | ||
| set( ${prefix}_VERSION_PATCH 0 ) | ||
| endif() | ||
| if( NOT DEFINED ${prefix}_VERSION_TWEAK ) | ||
| set( ${prefix}_VERSION_TWEAK 0 ) | ||
| endif() | ||
|
|
||
| math(EXPR ${prefix}_VERSION_INT "${${prefix}_VERSION_MAJOR} * 10000 + ${${prefix}_VERSION_MINOR} * 100 + ${${prefix}_VERSION_PATCH}") | ||
|
|
||
| ## Export variables to parent scope | ||
| list( APPEND export_variables_parent_scope | ||
| ${prefix}_VERSION_STR | ||
| ${prefix}_VERSION | ||
| ${prefix}_VERSION_MAJOR | ||
| ${prefix}_VERSION_MINOR | ||
| ${prefix}_VERSION_PATCH | ||
| ${prefix}_VERSION_TWEAK | ||
| ${prefix}_VERSION_SUFFIX | ||
| ${prefix}_VERSION_INT | ||
| ) | ||
| foreach( _var ${export_variables_parent_scope} ) | ||
| if( DEFINED ${_var} ) | ||
| set( ${_var} ${${_var}} PARENT_SCOPE ) | ||
| endif() | ||
| endforeach() | ||
|
|
||
| endfunction() | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No strong objection, but until there is a user that needs this I would KISS and rather only support the latest atlas api in the bindings so that no compatibility logic is required.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you mean that we should bump the required atlas version instead? I'm OK with that of course!
Let's make that a new policy from now on then.