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

Add exceptions for FFTW/3.3.6 on POWER with GCC 5/6/7 #1274

Merged
merged 3 commits into from Oct 21, 2017

Conversation

ocaisa
Copy link
Member

@ocaisa ocaisa commented Oct 19, 2017

No description provided.

fftw_version = self.version
if cpu_arch in [POWER] and self.toolchain.comp_family() in [TC_CONSTANT_GCC] and \
LooseVersion(fftw_version) == LooseVersion("3.3.6"):
# See https://github.com/FFTW/fftw3/issues/59 which applies to GCC 5/6/7
Copy link
Member Author

Choose a reason for hiding this comment

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

@boegel There is no easy way to check the GCC version to be used in this easyblock, at the time this list of options is created the dependencies are not loaded.

Copy link
Member

Choose a reason for hiding this comment

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

please use == rather than in if there's only one thing to compare with, and try to avoid line wrapping

Also, shouldn't you use <= rather than == for the FFTW version? In addition, are you sure the problem is going to be fixed in the next FFTW release?

cpu_arch = get_cpu_architecture()
comp_fam = self.toolchain.comp_family()
fftw_ver = LooseVersion(self.version)
if cpu_arch == POWER and comp_fam == TC_CONSTANT_GCC and fftw_ver <= LooseVersion('3.3.6'):

Copy link
Member

Choose a reason for hiding this comment

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

W.r.t. to the GCC version, that would be tricky to check at this stage, indeed.

Not sure if we should worry about it too much though, GCC 4.x is quite old now, and unlikely to be used on POWER anyway?

What kind of problems would you run into when using GCC 4.x?

You could add a check for the GCC version being used in the prepare method instead, and error out if it's too old for POWER, at that point the toolchain is loaded.

Copy link
Member Author

@ocaisa ocaisa Oct 20, 2017

Choose a reason for hiding this comment

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

So the system GCC on the Power system I'm using is 4.8.5 and my understanding is that these flags work fine with GCC4.8 and GCC4.9 (see FFTW/fftw3#59 (comment) )...but I haven't checked myself and I'm not going to.
Leaving a blanket GCC check like the above is fine since they will do harm for GCC4 (apart from maybe make it a little slower) and we are not expecting people to willingly chose an old compiler on Power.

Copy link
Member Author

@ocaisa ocaisa Oct 20, 2017

Choose a reason for hiding this comment

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

I don't have a guarantee the problem will be fixed in the next release but the bug is reported ( FFTW/fftw3#59 ) and I would prefer not to turn off these optimisations by default but rather run into the problem and then see that I need to include 3.3.7 or whatever. For earlier versions than 3.3.6, I don't know if there is a problem or not so I err on the side of caution (but I am happy to change it).

Copy link
Member

Choose a reason for hiding this comment

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

OK on both not checking GCC version & only doing this for FFTW 3.3.6 for now.

fftw_version = self.version
if cpu_arch in [POWER] and self.toolchain.comp_family() in [TC_CONSTANT_GCC] and \
LooseVersion(fftw_version) == LooseVersion("3.3.6"):
# See https://github.com/FFTW/fftw3/issues/59 which applies to GCC 5/6/7
Copy link
Member

Choose a reason for hiding this comment

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

please use == rather than in if there's only one thing to compare with, and try to avoid line wrapping

Also, shouldn't you use <= rather than == for the FFTW version? In addition, are you sure the problem is going to be fixed in the next FFTW release?

cpu_arch = get_cpu_architecture()
comp_fam = self.toolchain.comp_family()
fftw_ver = LooseVersion(self.version)
if cpu_arch == POWER and comp_fam == TC_CONSTANT_GCC and fftw_ver <= LooseVersion('3.3.6'):

fftw_version = self.version
if cpu_arch in [POWER] and self.toolchain.comp_family() in [TC_CONSTANT_GCC] and \
LooseVersion(fftw_version) == LooseVersion("3.3.6"):
# See https://github.com/FFTW/fftw3/issues/59 which applies to GCC 5/6/7
Copy link
Member

Choose a reason for hiding this comment

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

W.r.t. to the GCC version, that would be tricky to check at this stage, indeed.

Not sure if we should worry about it too much though, GCC 4.x is quite old now, and unlikely to be used on POWER anyway?

What kind of problems would you run into when using GCC 4.x?

You could add a check for the GCC version being used in the prepare method instead, and error out if it's too old for POWER, at that point the toolchain is loaded.

if cpu_arch in [POWER] and self.toolchain.comp_family() in [TC_CONSTANT_GCC] and \
LooseVersion(fftw_version) == LooseVersion("3.3.6"):
# See https://github.com/FFTW/fftw3/issues/59 which applies to GCC 5/6/7
if (prec == 'single'):
Copy link
Member

Choose a reason for hiding this comment

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

drop the (...), not needed:

if prec == 'single':

# append additional configure options (may be empty string, but that's OK)
self.cfg.update('configopts', [' '.join(prec_configopts) + common_config_opts])
self.cfg.update('configopts', [' '.join(prec_configopts) + ' ' + common_config_opts])
Copy link
Member

Choose a reason for hiding this comment

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

Since this is a bug fix, maybe this should be done in a separate PR? Trivial to merge...

Copy link
Member Author

Choose a reason for hiding this comment

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

Done in #1277

Copy link
Member

Choose a reason for hiding this comment

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

merged #1277, thanks

@boegel boegel added this to the 3.5.0 milestone Oct 21, 2017
@boegel
Copy link
Member

boegel commented Oct 21, 2017

Tested with existing FFTW easyconfig, and confirmation that it works as intended via test report in easybuilders/easybuild-easyconfigs#5242

@boegel boegel merged commit 35d177f into easybuilders:develop Oct 21, 2017
@ocaisa ocaisa deleted the fftw_power branch October 27, 2021 10:40
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.

None yet

2 participants