Skip to content

Add openmp support to namd easyblock.#1173

Merged
boegel merged 3 commits intoeasybuilders:developfrom
akesandgren:namd-openmp-update
May 11, 2017
Merged

Add openmp support to namd easyblock.#1173
boegel merged 3 commits intoeasybuilders:developfrom
akesandgren:namd-openmp-update

Conversation

@akesandgren
Copy link
Copy Markdown
Contributor

Also add TCL support.

Comment thread easybuild/easyblocks/n/namd.py Outdated
# 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']))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@akesandgren should --std=c++11 be used regardless of NAMD version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe they should be archived, yes, but only with EasyBuild 4.0.

Until then, we should maintain backward compatibility.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

--with-numa also works for old versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

won't this break existing easyconfigs that use spaces in charm_arch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

There is no space in --charm-arch's argument. it's always a "a-b-c-d" string

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why 2, I'd expect 1 here (or nothing at all, as it was before)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@boegel boegel added this to the 3.3.0 milestone May 8, 2017
only use --std=c++11 for NAMD 2.12 and up
@boegel
Copy link
Copy Markdown
Member

boegel commented May 11, 2017

Tested with existing NAMD easyconfigs + those in easybuilders/easybuild-easyconfigs#4516 and easybuilders/easybuild-easyconfigs#3199, good to go.

Thanks @akesandgren!

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.

2 participants