Use absolute include paths in nbnxn kernels
[alexxy/gromacs.git] / src / gromacs / mdlib / nbnxn_kernels / nbnxn_kernel_file_generator / make_verlet_simd_kernel_files.py
index 68d90850791f29f51dcff408799a88983bfef131..b7740bfcaf0bfdb19cbdef72a32a2c7053e54310 100755 (executable)
@@ -75,6 +75,7 @@
 import re
 import sys
 import os
+os.chdir(os.path.dirname(os.path.abspath(__file__)))
 import collections # Requires Python 2.7
 sys.path.append('../../../../../admin')
 from copyright import create_copyright_header
@@ -107,11 +108,12 @@ ElectrostaticsDict['ElecEwTwinCut'] = { 'define' : '#define CALC_COUL_EWALD\n#de
  
 # The dict order must match the order of a C enumeration.
 VdwTreatmentDict = collections.OrderedDict()
-VdwTreatmentDict['VdwLJCombGeom'] = { 'define' : '#define LJ_COMB_GEOM' }
-VdwTreatmentDict['VdwLJCombLB'] = { 'define' : '#define LJ_COMB_LB' }
-VdwTreatmentDict['VdwLJ'] = { 'define' : '/* Use no LJ combination rule */' }
-VdwTreatmentDict['VdwLJFSw'] = { 'define' : '/* Use no LJ combination rule */\n#define LJ_FORCE_SWITCH' }
-VdwTreatmentDict['VdwLJPSw'] = { 'define' : '/* Use no LJ combination rule */\n#define LJ_POT_SWITCH' }
+VdwTreatmentDict['VdwLJCombGeom'] = { 'define' : '#define LJ_CUT\n#define LJ_COMB_GEOM' }
+VdwTreatmentDict['VdwLJCombLB'] = { 'define' : '#define LJ_CUT\n#define LJ_COMB_LB' }
+VdwTreatmentDict['VdwLJ'] = { 'define' : '#define LJ_CUT\n/* Use full LJ combination matrix */' }
+VdwTreatmentDict['VdwLJFSw'] = { 'define' : '#define LJ_FORCE_SWITCH\n/* Use full LJ combination matrix */' }
+VdwTreatmentDict['VdwLJPSw'] = { 'define' : '#define LJ_POT_SWITCH\n/* Use full LJ combination matrix */' }
+VdwTreatmentDict['VdwLJEwCombGeom'] = { 'define' : '#define LJ_CUT\n#define LJ_EWALD_GEOM\n/* Use full LJ combination matrix + geometric rule for the grid correction */' }
 
 # This is OK as an unordered dict
 EnergiesComputationDict = {
@@ -141,9 +143,7 @@ VerletKernelTypeDict = {
     },
     '4xn' : {
         'Define' : 'GMX_NBNXN_SIMD_4XN',
-        'WidthSetup' : ('#ifdef GMX_NBNXN_HALF_WIDTH_SIMD\n' \
-                        '#define GMX_USE_HALF_WIDTH_SIMD_HERE\n' \
-                        '#endif\n'),
+        'WidthSetup' : (''),
         'WidthCheck' : ('#if !(GMX_SIMD_REAL_WIDTH == 2 || GMX_SIMD_REAL_WIDTH == 4 || GMX_SIMD_REAL_WIDTH == 8)\n' \
                         '#error "unsupported SIMD width"\n' \
                         '#endif\n'),
@@ -164,6 +164,7 @@ for type in VerletKernelTypeDict:
     KernelNamePrefix = 'nbnxn_kernel'
     KernelsName = "{0}_simd_{1}".format(KernelNamePrefix,type)
     KernelsHeaderFileName = "{0}.h".format(KernelsName,type)
+    KernelsHeaderPathName = "gromacs/mdlib/nbnxn_kernels/simd_{0}/{1}".format(type,KernelsHeaderFileName)
     KernelFunctionLookupTable = {}
     KernelDeclarations = ''
     KernelTemplate = read_kernel_template("{0}_kernel.c.pre".format(KernelsName))
@@ -190,7 +191,7 @@ for type in VerletKernelTypeDict:
                                            ElectrostaticsDict[elec]['define'],
                                            VdwTreatmentDict[ljtreat]['define'],
                                            EnergiesComputationDict[ener]['define'],
-                                           KernelsHeaderFileName,
+                                           KernelsHeaderPathName,
                                            KernelName,
                                            " " * (len(KernelName) + 1),
                                            VerletKernelTypeDict[type]['UnrollSize'],