[gmx-developers] Small hack regarding dihedrals

Bogdan Costescu bcostescu at gmail.com
Thu Sep 26 15:16:47 CEST 2013


On Thu, Sep 26, 2013 at 9:25 AM, MURAT OZTURK <murozturk at ku.edu.tr> wrote:
> It seems that there is a "#define SIMD_BONDEDS" instruction that is just for
> this job? If I delete that line, does the SIMD functionality go away?

You need to read on the C pragmas to understand this.

> If
> not, where exactly does the code decide whether to use SIMD functions?

The decision is based on user options or automated config detection by
cmake (also configure for 4.5).

> Can I
> disable SIMD selectively for dihedrals only?

Yes, f.e. by making sure that the SIMD functions are not compiled in :)

> Also, would it be preferable to use 4.6 and disable SIMD, or go back to 4.5
> and do the hack over there, performance wise? I understand 4.5 has many
> native assembly loops, whereas 4.6 takes advantage of the compiler, so if I
> am going to disable SIMD, is it better to use the 4.5 version with native
> code?

The efficiency depends not only on the code, but also on the
parameters with which it is called. So it's only you who can decide
which version is faster - by running benchmarks! But before spending
more time in this direction, I would suggest to look at the output of
a run with your desired system with a pristine GROMACS version, i.e.
without such code modifications. Is the time needed for bonded
interactions significant compared to the overall runtime ? If not, it
doesn't make much sense to optimize it...

Also please note that the code snippet I proposed acts based on a
global threshold. If you need different thresholds, f.e. for dihedrals
A-B-B-A and B-A-A-B, then the threshold should be provided as part of
the topology files and stored in a similar way to f.e. the force
constant. It's not difficult, but you have to look beyond bondfree.c.

Good luck!
Bogdan



More information about the gromacs.org_gmx-developers mailing list