Hi Joachim,

On 27/05/16 11:21, Joachim Hein wrote:
Hi everyone,

I have a user request for Gromacs in double precision. The “vanilla” gromacs configs do not build this, so I have to do some massaging and would need help with the easy block.

Based on the Gromacs documentation: http://manual.gromacs.org/documentation/5.1.2/install-guide/index.html#introduction-to-building-gromacs I need to add a string

-DGMX_DOUBLE=on

to the cmake options. Such things (e.g. OpenMP, MPI support) seem to be handled in the relevant easyblock and the easyconfig. Hacking into the easyconfigs I am reasonably competent by now, but it seems the easyblock is lacking the support for that switch.

Looking how openmp is handled in that easyblock (EasyBuild/2.8.0/lib/python2.7/site-packages/easybuild_easyblocks-2.8.0-py2.7.egg/easybuild/easyblocks/g/gromacs.py) It seems one needs to add

            # enable double support if desired
            if self.toolchain.options.get(‘double', None):
                self.cfg.update('configopts', "-DGMX_DOUBLE=ON")
            else:
                self.cfg.update('configopts', "-DGMX_DOUBLE=OFF”)


after which one could activate double support from the easyconfig

This is only going to work if 'double' is a known toolchain option, but it's not.

Since this is specific to GROMACS, I would define a 'double_precision' custom easyconfig parameter for GROMACS instead.

This is done in the easyblock via 'extra_options', see for example https://github.com/hpcugent/easybuild-easyblocks/blob/master/easybuild/easyblocks/w/wrf.py#L62 (and https://github.com/hpcugent/easybuild/wiki/Tutorial%3A-building-WRF-after-adding-support-for-it#class-definition-class-constructor-and-defining-extra-easyconfig-options).

However, you should be able to do this straight from the easyconfig, without any required modifications to the easyblock for GROMACS:

    configopts = "-DGMX_DOUBLE=ON"

Be careful you don't hard overwrite possible other 'configopts' specifications that may be already there...


Now comes the questions (apart from whether there is anything wrong in the above):

  * If I don’t want to mess with the EB supplied easy blocks, where do
    I put homegrown ones?  I tried with the include-easy*block*s in
    the configuration file and copied the gromacs.py into a
    gromacsdbl.py in there.  From the output of the eb
    --list-easyblocks it doesn’t seem to pick this up.  How do I do my
    own local easy blocks?  Is that documented?


--include-easyblocks is the goto way to let EB pick up custom easyblocks, see also http://easybuild.readthedocs.io/en/latest/Including_additional_Python_modules.html#including-additional-easyblocks-include-easyblocks

There were some bug fixes related to this in recent EasyBuild versions; which version are you using?

You should not rename gromacs.py for your custom copy, EasyBuild relies on the name of the module (and --include-easyblcoks doesn't rename them).

Also, make sure the specify the full path, that may help: --list-easyblocks $PWD/gromacs.py .


  * Is adding the above switch to the gromacs easy block something
    that could be done for an upcoming EB release?  Perhaps have the
    gromacs easyconfig build both (single and double precision).  I
    used to install both (touching he cmake) before EasyBuild.


That may be an option, yes; enhancements to existing easyblocks are always welcome.

Note that there's already a pending update, I hope to get to that for EasyBuild v2.9.0 (planned for end of June-ish).

I'm not sure if building both single & double precision by default is a good option (I'm not familiar enough with GROMACS to know).


regards,

Kenneth

Any comments?

Thanks
  Joachim

Reply via email to