add easyblock for RAxML#2180
Conversation
Test reports |
|
Test report by @lexming Overview of tested easyconfigs (in order)
Build succeeded for 2 out of 2 (2 easyconfigs in total) |
|
@lexming Some existing |
| from easybuild.tools.systemtools import get_cpu_features, HAVE_ARCHSPEC | ||
| from easybuild.tools.toolchain.compiler import OPTARCH_GENERIC | ||
|
|
||
| RAXML_BINARY_NAME = "raxmlHPC" |
There was a problem hiding this comment.
Not sure RAXML_BINARY_NAME is useful, since it's only used in one place currently?
|
|
||
| RAXML_BINARY_NAME = "raxmlHPC" | ||
| # Supported instruction sets ordered by priority (high to low) and related CPU features | ||
| RAXML_INSTRUCT_SETS = ["AVX2", "AVX", "SSE3"] |
There was a problem hiding this comment.
What about AVX-512? If there's a reason no to include that, add a comment on it?
Where can the list of supported instruction sets be found (docs link? README?)
Also, out of curiosity, does it also support NEON (for aarch64)?
If someone cares enough the easyblock can be updated later to also cover that, doesn't need to be done here.
There was a problem hiding this comment.
They don't support that in their makefiles, this choice reflects what they actually set in CFLAGS (they do not respect the CFLAGS in the environment)
| # Supported instruction sets ordered by priority (high to low) and related CPU features | ||
| RAXML_INSTRUCT_SETS = ["AVX2", "AVX", "SSE3"] | ||
| RAXML_CPU_FEATURES = { | ||
| "SSE3": ["sse3", "see4_1", "sse4_2"], |
There was a problem hiding this comment.
typo:
| "SSE3": ["sse3", "see4_1", "sse4_2"], | |
| "SSE3": ["sse3", "sse4_1", "sse4_2"], |
| """RAxML easyblock constructor, define class variables.""" | ||
| super(EB_RAxML, self).__init__(*args, **kwargs) | ||
|
|
||
| def filter_optarch_features(support_features): |
There was a problem hiding this comment.
Make this a function outside of the easyblock? Same for others below.
Advantage is that tests can be added easily to CI for these, and code becomes quite a bit easier to parse for humans
| return feature.lower() in host | ||
|
|
||
| try: | ||
| return any(f in get_cpu_features() for f in RAXML_CPU_FEATURES[feature]) |
There was a problem hiding this comment.
Would be nicer with a single return as the end, I'm not a big fan of inline returns, see also https://realpython.com/python-return-statement/#remembering-the-return-value (but that's partially personal, I guess)
There was a problem hiding this comment.
Maybe this function should be moved into framework, it's pretty generic... Same for filter_optarch_features
| # unrestricted optimization settings, set optimization level for host micro-architecture | ||
| cpu_features = [feat for feat in cpu_features if has_cpu_feature(feat)] | ||
| dbg_msg = "Enabling the following CPU optimizations for RAxML by autodetection: %s" | ||
| self.log.debug(dbg_msg, ", ".join(cpu_features)) |
| dbg_msg = "Enabling the following CPU optimizations for RAxML by autodetection: %s" | ||
| self.log.debug(dbg_msg, ", ".join(cpu_features)) | ||
| # add generic build | ||
| cpu_features.append(None) |
There was a problem hiding this comment.
Can you clarify (in the comment) why this is done?
| parallel_features.extend(RAXML_PARALLEL_FEATURES["mpi"]) | ||
|
|
||
| # List of builds to carry out | ||
| self.target_makefiles = list_filename_variants(cpu_features, parallel_features, "Makefile", "gcc", ".") |
There was a problem hiding this comment.
Is always using gcc OK? What if we're installing RAxML with Intel compilers?
| if not any(feature in mf for feature in RAXML_PARALLEL_FEATURES["mpi"]): | ||
| cc_opt = compiler_nompi | ||
| self.cfg["buildopts"] = '-f %s CC="%s" %s' % (mf, cc_opt, user_buildopts) | ||
| self.log.debug("Building RAxML makefile with %s: %s", cc_opt, mf) |
| "files": [os.path.join("bin", x) for x in self.target_bins], | ||
| "dirs": ["share/manual", "share/usefulScripts"], | ||
| } | ||
| super(EB_RAxML, self).sanity_check_step(custom_paths=custom_paths) |
There was a problem hiding this comment.
Also include a custom sanity check command like raxmlHPC -h?
|
@lexming this easyblock needs some attention... |
|
There's good knowledge in here about what to actually build (it's clear you probably need a serial and a parallel build). The actual Makefiles they ship are not very complicated. Rather than do architecture detection etc., what I'm thinking of doing is just creating patched versions that respect the EasyBuild compilers and options, build both the serial and parallel versions and leave it at that. The files that are being compile are 10+ years old, and in the commit that includes the performance optimisation they mention the improvement being 5-10% with GCC 4.7+...how would that compare with a modern compiler? |
|
Just to have a cross-reference: see also: |
|
@ocaisa I fully agree, closing this in favour of easybuilders/easybuild-easyconfigs#23975 |
This easyblock automatically builds those binaries of RAxML that
optarchsettings)Current easyconfigs of RAxML build one arbitrary binary of RAxML and create a symlink with the name
raxmlHPC. This is a bad approach because the different binaries of RAxML have different requirements and features. For instance, binaries using MPI have a minimum number of trees to process