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

enhance systemtools.py to also support POWER systems #1044

Merged
merged 23 commits into from
Feb 26, 2015

Conversation

boegel
Copy link
Member

@boegel boegel commented Sep 12, 2014

fixes issues reported in easybuilders/easybuild#32 by @chwilk

@boegel
Copy link
Member Author

boegel commented Sep 12, 2014

@wpoely86: please review?

@@ -219,30 +222,40 @@ def get_cpu_speed():
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

seeing this block made me think of http://www.isitfriday.org/ on a thursday....

Copy link
Contributor

Choose a reason for hiding this comment

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

why is this whole block wrapped in a try/except?

Copy link
Member Author

Choose a reason for hiding this comment

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

please recheck, cleaned up significantly now

Copy link
Member

Choose a reason for hiding this comment

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

The affinity mask is a POSIX thing right? So why not try the BSD thing and then fall back to the affinity mask?

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 don't think the BSD one takes into account cpuset and all that crap, the affinity one does, so that should be tried first (and it should always work on Linux)

Copy link
Member

Choose a reason for hiding this comment

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

yeah agreed. But now, it's only tried on Linux. Why not try it always?

Copy link
Member Author

Choose a reason for hiding this comment

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

because it won't work on non-Linux systems :)

@JackPerdue
Copy link
Contributor

I wholeheartedly endorse this change (given my need to get building on PPC64). 👍

@JackPerdue
Copy link
Contributor

Note: If you could add "PPC = 'PPC'" somewhere around line 55 that would make it easier to add the following to toolchains/compiler/gcc.py:

COMPILER_OPTIMAL_ARCHITECTURE_OPTION = {
...
systemtools.PPC : 'mcpu=native' # no support for march=native on PPC

And make it easier for me to try to figure out how to make this bit of code in tools/toolchain/compiler.py work:

    if build_option('optarch') is not None:
        optarch = build_option('optarch')
    elif self.arch in (self.COMPILER_OPTIMAL_ARCHITECTURE_OPTION or []):
        optarch = self.COMPILER_OPTIMAL_ARCHITECTURE_OPTION[self.arch]

(my python Kung Fu is the worst)

But this code works on Power7 running a lpar kernel with a /proc/cpuinfo that looks like the below. So far I have (gcc only):

$ find /software/easybuild/modulefiles/ -type f | grep -c .
294
$ module spider |& grep -c Homepage:
184
on:
$ uname -a
Linux p7-5229-lpar 2.6.32-431.29.2.el6.ppc64 #1 SMP Sun Jul 27 15:53:50 EDT 2014 ppc64 ppc64 ppc64 GNU/Linux
with /proc/cpuinfo similar to:
processor : 0
cpu : POWER7 (architected), altivec supported
clock : 4228.000000MHz
revision : 2.1 (pvr 004a 0201)
[repeat for processor=4 to 60 step 4]
timebase : 512000000
platform : pSeries
model : IBM,8246-L2T
machine : CHRP IBM,8246-L2T

Anyway... I strongly endorse this update (since I'm under a lot of pressure to get EasyBuild working on P7 and am hoping to at least get GCC stable/happy while trying to create ibmxl.py and friends for the IBM compilers/etc.).

@boegel boegel mentioned this pull request Feb 11, 2015
27 tasks
except ValueError:
pass

raise SystemToolsException('Can not determine number of cores on this system')
if core_cnt is None:
raise SystemToolsException('Can not determine number of cores on this system')
Copy link
Member

Choose a reason for hiding this comment

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

and POWER?

Copy link
Member Author

Choose a reason for hiding this comment

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

nothing specific for POWER here, we only need to differentiate between Linux and Darwin

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1421/
Test PASSed.

model = out.strip()
_log.debug("Determined CPU model on Darwin using cmd '%s': %s" % (cmd, model))

if model is None:
Copy link
Member

Choose a reason for hiding this comment

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

nothing for power?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure, see the comment right above where model_regex is defined

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1425/
Test PASSed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1428/
Test PASSed.

from vsc.utils.affinity import sched_getaffinity
except ImportError:
pass
from vsc.utils.affinity import sched_getaffinity
Copy link
Contributor

Choose a reason for hiding this comment

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

oooh, this uses ctypes and assumes stuff about glibc. careful with this one on non-linux.

Copy link
Member Author

Choose a reason for hiding this comment

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

only used on Linux

@stdweird
Copy link
Contributor

@boegel looks ok, regexps are unnecessarily complicated though

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1429/
Test PASSed.

@hpcugentbot
Copy link
Contributor

Refer to this link for build results (access rights to CI server needed):
https://jenkins1.ugent.be/job/easybuild-framework-pr-builder/1430/
Test PASSed.

@boegel
Copy link
Member Author

boegel commented Feb 26, 2015

remarks fixed, unit tests are happy, so (finally!) good to go in, in time for EasyBuild v2.0

thanks to @ocaisa, I've been able to confirm that this basically passes all tests on Linux/POWER too (there's a small issue w.r.t. a hanging test (or test setup) in toolchain.py on the system where this was tested on, but is likely more related to modulecmd.tcl being used, I'll figure that out)

thanks for the thorough review, @wpoely86 and @stdweird, and @JackPerdue for the feedback (there's a dedicated POWER constant available now, and the requested changes were made in the GCC compiler support)

boegel added a commit that referenced this pull request Feb 26, 2015
enhance systemtools.py to also support POWER systems
@boegel boegel merged commit 3c0f1d1 into easybuilders:develop Feb 26, 2015
@boegel boegel deleted the systemtools_fixes_power branch February 26, 2015 12:28
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.

5 participants