Skip to content

Albany: Add Albany package.#8332

Merged
adamjstewart merged 1 commit intospack:developfrom
gahansen:Albany_feature_addition
Jun 18, 2018
Merged

Albany: Add Albany package.#8332
adamjstewart merged 1 commit intospack:developfrom
gahansen:Albany_feature_addition

Conversation

@gahansen
Copy link
Copy Markdown
Contributor

  • Add package.py to support the Albany GitHub project builds.

  • Update the Trilinos package.py script to provide additional
    options needed for Albany.

maintainers = ['gahanse']

# Add proper versions and checksums here.
version('master', git='https://github.com/gahansen/Albany.git', branch='master')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...

version('master', git='https://github.com/gahansen/Albany.git', branch='master')

variant('install', default=True,
description='Enable Install')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what does this mean?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is currently an explicit install option (on or off) in Albany's build process. I can eliminate this if I clean that option up on the Albany side. I'll do that and eliminate this option.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On further inspection, some Albany users need this option. I'll explicitly set it in the update instead of having it as a variant.

description='Enable LCM_SPECULATIVE')
variant('lame', default=False,
description='Enable LAME')
variant('edebug', default=False,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

elsewhere we call it debug.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...

description='Enable ALBANY_CI')
variant('ascr', default=False,
description='Enable ALBANY_ASCR')
variant('perf', default=False,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

does this run some tests? If so, it's not a variant:

spack install -h
--run-tests           run package tests during installation (same as --test=all)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No - sorry for the confusion. Albany optionally links to a Configuration Interface (CI) that is a GUI that helps users setup the Albany input and execution spec. I could add a better description than "Enable ALBANY_CI" at the expense of making that string longer. Are there limitations on the length of that string (either technical or project policies?)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are no limitations on the length of the description. However, if the line goes over 79 characters, flake8 will complain. As long as you keep the entire variant(...) on a single line, flake8 will not check that line.

# Add dependencies
depends_on('mpi')
depends_on('trilinos@develop:~superlu-dist+isorropia+tempus+rythmos+teko+intrepid+intrepid2+minitensor+phal+pnetcdf+nox+piro+rol+shards+stk+superlu')
depends_on('trilinos@develop:~superlu-dist+isorropia+tempus+rythmos+teko+intrepid+intrepid2+minitensor+phal+pnetcdf+nox+piro+rol+shards+stk+superlu', when='+lcm')
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do you need this one if it's the same as the previous line?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...

including fluid mechanics, solid mechanics (elasticity and plasticity),
ice-sheet flow, quantum device modeling, and many other applications."""

# Add a proper url for your package's homepage here.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can remove this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...

homepage = "http://gahansen.github.io/Albany"
url = "https://github.com/gahansen/Albany/tarball/master"

maintainers = ['gahanse']
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We usually use GitHub handles in the maintainers list so that we can ping people when there are build problems.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...


maintainers = ['gahanse']

# Add proper versions and checksums here.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You can delete this comment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...


options.extend([
'-DALBANY_TRILINOS_DIR:FILEPATH={0}'.format(trilinos_dir),
'-DCMAKE_INSTALL_PREFIX:PATH=%s' % self.prefix
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't need this one, Spack already adds it for you in CMakePackage.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix...

description='Enable Intrepid')
variant('intrepid2', default=False,
description='Enable Intrepid2')
variant('minitensor', default=False,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add packages in alphabetical order, this makes it easier to maintain.

'ON' if '+intrepid' in spec else 'OFF'),
'-DTrilinos_ENABLE_Intrepid2=%s' % (
'ON' if '+intrepid2' in spec else 'OFF'),
'-DTrilinos_ENABLE_Phalanx=%s' % (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please use alphabetical order here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Will do.

'-DTrilinos_ENABLE_Rythmos=%s' % (
'ON' if '+rythmos' in spec else 'OFF'),
'-DTrilinos_ENABLE_Teko=%s' % (
'ON' if '+teko' in spec else 'OFF'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please add checks like conflict for configurations you know are incompatible so that they fail in the spack resolution phase and not during Trilinos configure/build. For example, Teko has a required dependency on many packages including Tpetra, ML, etc. Thus, it would be nice to have things like

    conflicts('+piro', when='~tpetra')

I understand that this would be time consuming, but I don't see a better solution (would be nice if we could somehow do parts of spack's trilinos package by parsing Trilinos Dependencies.cmake).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll add that dependency. TriBits has an effective dependency system in place, we will need to dig through Dependencies.cmake and duplicate the dependencies in the Spack file for the options that I added. Would you be open to helping me with that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gahansen Would be glad to help.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Email is inbound...

@aprokop
Copy link
Copy Markdown
Contributor

aprokop commented Jun 4, 2018

@gahansen I created a separate Trilinos update PR, that incorporates your changes and includes a bunch of checks for package depencies in #8363. Can you please rebase this PR on top of that and test it out?

EDIT: I also renamed the phal option from this PR to its full name phalanx.

@gahansen
Copy link
Copy Markdown
Contributor Author

gahansen commented Jun 6, 2018

Commit ba7f3fa replaces the above. @aprokop very kindly adopted my suggested changes to the Trilinos package and submitted PR outlined in #8363 which provides the changes needed that the Albany package requires. This commit contains only the albany/package.py file that builds on that for the new Albany package. I believe I addressed the above comments in this commit. Thanks to everyone who helped with this!

Copy link
Copy Markdown
Contributor

@aprokop aprokop left a comment

Choose a reason for hiding this comment

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

Looks good to me. The only minor nitpick is that depending on just trilinos@develop seems over restrictive to me. It should not be a problem compiling it with trilinos@master, for example, as they are now typically just few days off.

@gahansen
Copy link
Copy Markdown
Contributor Author

gahansen commented Jun 6, 2018

Thanks for the thought @aprokop . I actually tried trilinos@master, but spack fell back to using [email protected] when I did that. I think there might be a priority in spack, with the "@develop" is highest, but the numeric version is preferred over other string identifiers. Or perhaps it was due to an oversight on my part?

@adamjstewart
Copy link
Copy Markdown
Member

I think there might be a priority in spack, with the "@develop" is highest, but the numeric version is preferred over other string identifiers.

Correct. By default, Spack installs the newest numeric release for stability. If you want a different release, you have to explicitly request it.

@aprokop
Copy link
Copy Markdown
Contributor

aprokop commented Jun 6, 2018

I think you can do something like depends_on('trilinos@master,develop~superlu...). Nalu seems to be doing something similar.

@gahansen
Copy link
Copy Markdown
Contributor Author

gahansen commented Jun 6, 2018

Thanks @aprokop! Your syntax suggestion for the Trilinos dependency works great. I added 0f34beb to change this Albany dependency to your suggestion.

@aprokop
Copy link
Copy Markdown
Contributor

aprokop commented Jun 7, 2018

Just one minor point of confusion for me. @adamjstewart Is @develop: same as @develop?

@adamjstewart
Copy link
Copy Markdown
Member

Yes, develop sorts higher than any other version.

@aprokop
Copy link
Copy Markdown
Contributor

aprokop commented Jun 7, 2018

@adamjstewart Thanks! @gahansen So, you could remove the : at the end of depends_on('trilinos...') line. Or you could leave it as it is. I have no further comments.

@gahansen
Copy link
Copy Markdown
Contributor Author

@adamjstewart - I'm new to the Spack effort. Do I need to take further action to move forward to a merge?

@adamjstewart
Copy link
Copy Markdown
Member

I think the only thing left is @aprokop's comment on the unnecessary colon.

* Add package.py to support the Albany GitHub project builds.
@gahansen
Copy link
Copy Markdown
Contributor Author

Sounds great. I just pushed 77e92da that has the changes above squashed into it, along with the unnecessary colon removal suggested by @aprokop .

@adamjstewart
Copy link
Copy Markdown
Member

Will merge as soon as @davydden approves.

@adamjstewart adamjstewart merged commit d98d45e into spack:develop Jun 18, 2018
@gahansen gahansen deleted the Albany_feature_addition branch June 18, 2018 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants