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

reset keep toolchain component class 'constants' every time #1294

Merged
merged 10 commits into from
Jul 7, 2015

Conversation

boegel
Copy link
Member

@boegel boegel commented Jun 5, 2015

This fixes a problem that often occurs when testing large easyconfig PRs that contain easyconfigs with a large variety on toolchains using --from-pr, for example easybuilders/easybuild-easyconfigs#1337 (comment) .

If old and new version of Intel compilers are used in the same session, things break because constants aren't exactly constant.

This fixes the problem; I took care of checking the other toolchain components too.

@wpoely86, @pforai, @stdweird: please review?

@@ -104,6 +104,9 @@ def _set_compiler_vars(self):
raise EasyBuildError("_set_compiler_vars: mismatch between icc version %s and ifort version %s",
icc_version, ifort_version)

# reset LIB_MULTITHREAD every time,
# to avoid problems when multiple Intel compilers versions are used in a single session
self.LIB_MULTITHREAD = ['iomp5', 'pthread'] # iomp5 is OpenMP related
Copy link
Contributor

Choose a reason for hiding this comment

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

hmmmm, this is not inheritance-safe. need to think about this one

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe

if self._init_LIB_MULTITHREAD is None:
    self._init_LIB_MULTITHREAD = self.LIB_MULTITHREAD[:]
else:
    self.LIB_MULTITHREAD = self._init_LIB_MULTITHREAD[:]

Copy link
Contributor

Choose a reason for hiding this comment

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

and add self._init_... = None to the __init__? (or use a dict to store all such non-constant class constants)

Copy link
Member

Choose a reason for hiding this comment

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

On another note, why do we manually add libiomp5? Using -fopenmp should take care of this?

Copy link
Member Author

Choose a reason for hiding this comment

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

should, we had a very good reason at some point for this, and I'm not keen on breaking stuff that works just to remove a handful of characters ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

these are libraries you can pass via LDFLAGS, doesn't always work with compiler options. there's probably some crappy code out there that wants library names.

ideally, EB should figure out what libraries -fopenmp links in and use those instead of hardcoding.

Copy link
Member Author

Choose a reason for hiding this comment

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

@stdweird: good point on inheritance

How about simply this in __init__.py:

self._init_LIB_MULTITHREAD = self.LIB_MULTITHREAD[:]

and this here:

self.LIB_MULTITHREAD = self._init_LIB_MULTITHREAD[:]

That should work, no?

Toolchain instances are recreated for different versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

then maybe also make 2 private methods _copy_some_class_constants and _restore_some_class_constants and call/extend those.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wouldn't generalise this, it should be considered an exception, not encouraged.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1732/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1732/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1733/
EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1733/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member Author

boegel commented Jun 5, 2015

@stdweird: fixed the inheritance issue you pointed out, please rereview?

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1734/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1734/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@@ -87,7 +87,9 @@ class IntelIccIfort(Compiler):
'dynamic':'-Bdynamic',
}

LIB_MULTITHREAD = ['iomp5', 'pthread'] ## iomp5 is OpenMP related
LIB_MULTITHREAD = ['iomp5', 'pthread'] # iomp5 is OpenMP related
# keep track of original value, needs to be restored every time since we append to class 'constant' LIB_MULTITHREAD
Copy link
Contributor

Choose a reason for hiding this comment

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

no, please hide this in the __init__, people will start to manipultae this

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1737/
EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1737/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1738/
EasyBuild framework unit test suite FAILed.

See https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1738/console for more details.

Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do.

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1739/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1739/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member Author

boegel commented Jun 5, 2015

@stdweird: central solution implemented, unit test enhanced to make sure things work as expected when multiple toolchains and toolchain versions are in play

@@ -28,7 +28,7 @@
@author: Stijn De Weirdt (Ghent University)
@author: Kenneth Hoste (Ghent University)
"""

import copy
Copy link
Contributor

Choose a reason for hiding this comment

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

not needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

will remove, thx

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1740/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1740/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@@ -95,6 +99,10 @@ def __init__(self, name=None, version=None, mns=None):

self.vars = None

self.add_class_constants_to_restore([]) # make sure self.CLASS_CONSTANTS_TO_RESTORE is initialised
self._copy_class_constants()
self._restore_class_constants()
Copy link
Contributor

Choose a reason for hiding this comment

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

make a new method

def _init_class_constants(self, names=None):
  self.add_class_constants_to_restore(names or [])
  self._copy_class_constants()  
  self._restore_class_constants()

because this looks so strange otherwise

@stdweird
Copy link
Contributor

stdweird commented Jun 6, 2015

although the code looks good, it just feel weird looking at it. but my alternative with the __init__ isn't much better 😄
so feel free to modify or merge

@hpcugentbot
Copy link

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1743/
EasyBuild framework unit test suite PASSed (see https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1743/console for more details).

This pull request is now ready for review/testing.

Please try and find someone who can tackle this; contact @boegel if you're not sure what to do.

@boegel
Copy link
Member Author

boegel commented Jun 15, 2015

The last test report for easybuilders/easybuild-easyconfigs#1337, available at easybuilders/easybuild-easyconfigs#1337 (comment), still shows problems, so I need to look at it more closely, and see why this change isn't fixing the issues there...

@boegel
Copy link
Member Author

boegel commented Jul 7, 2015

retested with easybuilders/easybuild-easyconfigs#1337, works as intended and fixes the problem it intends to fix (previous failing test was due to issues with Intel license server, not due to EB itself)

Going in, thanks for the review @stdweird!

boegel added a commit that referenced this pull request Jul 7, 2015
reset keep toolchain component class 'constants' every time
@boegel boegel merged commit f1841ab into easybuilders:develop Jul 7, 2015
@boegel boegel deleted the keep_class_constants_constant branch July 7, 2015 06:22
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.

4 participants