[gmx-users] gromacs invsqrt() overlaps with icc invsqrt()

chris.neale at utoronto.ca chris.neale at utoronto.ca
Tue Jun 2 16:54:57 CEST 2009


Hello,

I have just compiled gromacs 4.0.4 using the intel compiler. While I  
believe that gromacs itself doesn't get a huge benefit from icc, fftw  
certainly does and it's on the order of a 10% speedup, which is  
significant enough for me to dedicate some time to getting this working.

Problem is, invsqrt is defined both in gromacs and in the icc  
libraries, as is already known:
http://www.gromacs.org/pipermail/gmx-users/2006-June/022009.html

../../../include/vec.h(152): warning #147: declaration is incompatible  
with "double invsqrt(double)" (declared at line 635 of  
"/opt/sharcnet/intel/11.0.083/icc/include/math.h")
   static inline real invsqrt(real x)

I have solved this problem by the following procedure:

#########################
#!/bin/bash
for i in `find ./gromacs-4.0.4`; do
   sed 's/invsqrt/invSAFEsqrt/g' "$i" > tmp;
   mv tmp "$i";
done
chmod +x ./gromacs-4.0.4/configure
mv ./gromacs-4.0.4/src/gmxlib/cinvsqrtdata.c  
./gromacs-4.0.4/src/gmxlib/cinvSAFEsqrtdata.c
#########################

And it now compiles without warning.

I was unable to link an icc-compiled fftw to a PGI or gcc compilation  
of gromacs, due to linking problems, although I imagine that that is  
possible.

First, does anybody see any immediate problems with this?

Second, is there still a motivation to get rid of this problem?

Third, does anybody know how I can link an icc-compiled fftw to a PGI  
or gcc compilation of gromacs, and if there is any reason that this is  
a bad idea?

Thanks,
Chris.




More information about the gromacs.org_gmx-users mailing list