Project

General

Profile

Bug #254

trivial fixes for IBM compilers

Added by Mark Abraham about 11 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Erik Lindahl
Category:
mdrun
Target version:
Affected version - extra info:
Affected version:
Difficulty:
uncategorized
Close

Description

At around lines 902 and 930 of src/mdlib/pme.c there are some preprocessor directives present that are #ifdefed to be read only under IBM compilers. Actually they only have effect under IBM compilers when compiling for a symmetric multi-processing architecture, and provoke a warning about an invalid pragma otherwise. See http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=/com.ibm.xlcpp8a.doc/compiler/ref/tuoptppp.htm. Since this happy nirvana can only occur when _IBMSMP is defined (see http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/topic/com.ibm.xlcpp8a.doc/compiler/ref/ruoptsmp.htm#ruoptsmp)

To avoid the compiler warnings, I suggest that both fragments read:

#if ((defined IBMC || defined IBMCPP) && defined _IBMSMP)
/* Magic optimization pragma proposed by Mathias Puetz */
#pragma ibm independent_loop
#endif

Also, around line 317 of src/gmxlib/nonbonded/nb_kernel_bluegene/interaction.h there's an #ifdef that refers to IS_XLC_OK (going on my memory of the original version). That's not defined by any xlc compiler as far as I can tell, and I think this is just an artefact from Puetz's development. The whole source file won't compile except under the BlueGene XL C cross-compiler, but if one wants to be conservative, I recommend this fragment read:

if (defined IBMC || defined IBMCPP)

#define convert2ints(x,xi,conv,i1,i2) \
xi = __fpctiwz(x); \
__stfpd(conv,xi); \
i1 = ((int *)conv)[1]; \
i2 = ((int *)conv)[3]

#else

#define convert2ints(x,xi,conv,i1,i2) \
i1 = (int)__creal(x); \
i2 = (int)__cimag(x)

#endif

History

#1 Updated by Erik Lindahl almost 11 years ago

Fixed in release branch, will go into head after 4.0.3.

Also available in: Atom PDF