Mindboggling Problem Related To NAMD2 Code

From: Rahul (rahulmehta87_at_gmail.com)
Date: Sun Jun 01 2008 - 04:19:13 CDT

Hi all,

I am a college student currently looking at ways to GPU-accelerate
NAMD2. I am working with the source code of NAMD 2.6, and I am going
to use NVIDIA CUDA to create a GPU-accelerated version.

A cursory look at the function profile of the code indicates that most
of the execution time is spent on computation of nonbonded forces. The
basic computations are conveniently enclosed in a file called
src/ComputeNonbondedBase2.h, which consists of a loop over all the
atoms. If these computations are to be ported to a GPU, I need to
create, according to CUDA convention, a global kernel function that
will carry out these operations. Before even starting to use CUDA, if
I try to enclose the loop in a function, and run it on the CPU, it
should work out fine, ideally. However, when I enclose this loop in a
function, I get results (output coordinates for the same input) that
are somewhat different from the reference values. The error increases
with the number of timesteps, and is very significant.

Including lines within the loop one-by-one in the function shows that
the error occurs when the declaration and assignment statements of
variables vdw_a, vdw_b, vdw_c and vdw_d are included in the function.
I have been trying to solve this for the last 2 weeks without any

I have been working on a platform that consists of an Intel Core2 Quad
CPU having a clock speed of 2.4 GHz, using Red Hat Linux, having gcc4.
The problem persists even after using gcc3 for the compilation. The
interesting thing is that the same problem does not occur on another
machine that has an amd64 architecture.

Does anyone have any ideas on how to solve this problem?


Steps To Be Taken To Reproduce The Results

1. Pre-process src/ComputeNonbondedStd.C, src/ComputeNonbondedLES.C,
src/ComputeNonbondedFEP.C and src/ComputeNonbondedPProf.C using gcc -E

2. Enclose one of the loops following a "#pragma ivdep" in a function,
and pass the requisite arguments. Replace the loop by a function cal.
Ensure that the changes to any of the variables within the function
are reflected after exit from that function. Some of the arguments
might have to be passed as pointers or references to ensure this.

3. Now re-make NAMD and run it with the same input. Compute the output
with the reference solution.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:49:31 CST