Add openmp support to namd easyblock.#1173
Conversation
Also add TCL support.
| # compiler (options) | ||
| self.cfg.update('namd_cfg_opts', '--cc "%s" --cc-opts "%s"' % (os.environ['CC'], os.environ['CFLAGS'])) | ||
| self.cfg.update('namd_cfg_opts', '--cxx "%s" --cxx-opts "%s"' % (os.environ['CXX'], os.environ['CXXFLAGS'])) | ||
| self.cfg.update('namd_cfg_opts', '--cxx "%s --std=c++11" --cxx-opts "%s"' % (os.environ['CXX'], os.environ['CXXFLAGS'])) |
There was a problem hiding this comment.
@akesandgren should --std=c++11 be used regardless of NAMD version?
There was a problem hiding this comment.
Well, didn't really check namd 2.9 or 2.10b1 (which are the only non 2.12 versions currently listed in EB) I'd vote for deprecating them anyway.
There was a problem hiding this comment.
Maybe they should be archived, yes, but only with EasyBuild 4.0.
Until then, we should maintain backward compatibility.
There was a problem hiding this comment.
tested, using --std=c++11 breaks older NAMD easyconfig, so let's inject this conditionally
done in akesandgren#5
| tup = (self.cfg['charm_arch'], self.cfg['charm_opts'], self.cfg['parallel'], os.environ['CXXFLAGS']) | ||
| cmd = "./build charm++ %s %s -j%s %s -DMPICH_IGNORE_CXX_SEEK" % tup | ||
| charm_subdir = '.'.join(os.path.basename(charm_tarballs[0]).split('.')[:-1]) | ||
| cmd = "./build charm++ %s %s --with-numa -j%s %s -DMPICH_IGNORE_CXX_SEEK" % tup |
There was a problem hiding this comment.
--with-numa also works for old versions?
There was a problem hiding this comment.
Yes numa works for 2.9 at least
| self.cfg.update('namd_cfg_opts', "--fftw-prefix %s" % fftw) | ||
|
|
||
| namd_charm_arch = "--charm-arch %s" % '-'.join(self.cfg['charm_arch'].strip().split(' ')) | ||
| namd_charm_arch = "--charm-arch %s" % '-'.join(self.cfg['charm_arch'].strip().split()) |
There was a problem hiding this comment.
won't this break existing easyconfigs that use spaces in charm_arch?
There was a problem hiding this comment.
There is no space in --charm-arch's argument. it's always a "a-b-c-d" string
There was a problem hiding this comment.
but charm_arch may contain a space (see https://github.com/hpcugent/easybuild-easyconfigs/search?utf8=%E2%9C%93&q=charm_arch&type=), you're changing the split
There was a problem hiding this comment.
OK, sorry, this is OK. You're still splitting on spaces in charm_arch here, but also handling consecutive spaces correctly.
| cmd = "%(namd)s %(testdir)s" % { | ||
| ppn = '' | ||
| if self.toolchain.options.get('openmp', False): | ||
| ppn = '+ppn 2' |
There was a problem hiding this comment.
Why 2, I'd expect 1 here (or nothing at all, as it was before)?
There was a problem hiding this comment.
This is the number of threads to use, and since we're testing openmp, in this case, it's better to turn it on and set to 2 than let it fly off on it's own and try to use #cores as threads.
only use --std=c++11 for NAMD 2.12 and up
|
Tested with existing NAMD easyconfigs + those in easybuilders/easybuild-easyconfigs#4516 and easybuilders/easybuild-easyconfigs#3199, good to go. Thanks @akesandgren! |
Also add TCL support.