StreamHPC / gromacs

OpenCL porting of the GROMACS molecular simulation toolkit
http://www.gromacs.org
Other
25 stars 4 forks source link

Test and fix E_el sum inside the OpenCL kernel to be correct - first phase #36

Closed ancahamuraru closed 9 years ago

ancahamuraru commented 9 years ago

Check if the OpenCL kernel correctly computes E_el sum. If it doesn't, fix it.

To do the test, compare:

Have the two builds in two separate folders.

Check also gmx_rng_make_seed function and temporary force it to produce the same values for the two builds that are tested.

It will be discussed later if forcing a predefined behaviour for gmx_rng_make_seed needs to be controlled by some debug flag/option.

Check also for DEBUG_E_EL_SUM_PHASE_1 macro nbnxn_ocl_kernel_utils.clh and nbnxn_kernel_gpu_ref.c are using this macro to disable part of the computation.

You have to explicitly add #define DEBUG_E_EL_SUM_PHASE_1 in order for the above mentioned changes to be active.

nbnxn_kernel_gpu_ref.c has been modified for DEBUG_E_EL_SUM_PHASE_1 : the loops have been inverted to match the actual OpenCL kernel and vctot sum is reset to 0 for each ic iteration.

ancahamuraru commented 9 years ago

Update: gmx_rng_make_seed has no impact on the actual computation, not for the reference set of input data (gmxbench-3.0.tar.gz). It is used to select text messages to be printed to console/log.

ancahamuraru commented 9 years ago

Not done, but assumed all is working correctly since the program runs on AMD and NVIDIA GPUs through the end for adh_cubic, d.poly-ch2 samples. The output results are close enough to the CUDA results.