removed group non-boneded call with verlet scheme
authorSzilard Pall <pszilard@cbr.su.se>
Thu, 22 Nov 2012 18:03:16 +0000 (19:03 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Fri, 23 Nov 2012 01:54:59 +0000 (02:54 +0100)
With the verlet scheme non-bonded calculations are started from
do_force_cutsVERLET(), unlike in the case of group scheme which does
this in do_force_lowlevel(), one level lower. However, the conditional
that prevented do_force_lowlevel() to call do_nonbonded() with verlet
was incorrect leading to an unnecessary, but more or less harmless
do_nonbonded() call. This commit corrects the behavior and also moves
the check inside do_force_lowlevel().

Additionally, a subcounter start call was missing with GB, this has also
been corrected.

Change-Id: If593fd577a5647e6047b5698d4505c1a2d611e05

src/mdlib/force.c
src/mdlib/sim_util.c

index f86c6afdc244a8e44d2c37a73e003a14f233729e..abfab008019b174a833f4e23185554250e267b89 100644 (file)
@@ -253,7 +253,9 @@ void do_force_lowlevel(FILE       *fplog,   gmx_large_int_t step,
        }
 
     where();
-    if (flags & GMX_FORCE_NONBONDED)
+    /* We only do non-bonded calculation with group scheme here, the verlet
+     * calls are done from do_force_cutsVERLET(). */
+    if (fr->cutoff_scheme == ecutsGROUP && (flags & GMX_FORCE_NONBONDED))
     {
         donb_flags = 0;
         /* Add short-range interactions */
@@ -311,6 +313,7 @@ void do_force_lowlevel(FILE       *fplog,   gmx_large_int_t step,
     /* MRS: Eventually, many need to include free energy contribution here! */
        if (ir->implicit_solvent)
     {
+        wallcycle_sub_start(wcycle, ewcsBONDED);
                calc_gb_forces(cr,md,born,top,atype,x,f,fr,idef,
                        ir->gb_algorithm,ir->sa_algorithm,nrnb,bBornRadii,&pbc,graph,enerd);
         wallcycle_sub_stop(wcycle, ewcsBONDED);
index e1c0e5ccb25af9e36e8532c7211b486afe6acbca..ecdd223fa0e06192e6d7e1f9c77a41ff36cfd090 100644 (file)
@@ -1139,15 +1139,12 @@ void do_force_cutsVERLET(FILE *fplog,t_commrec *cr,
     }
 
     /* Compute the bonded and non-bonded energies and optionally forces */    
-    /* if we use the GPU turn off the nonbonded */
     do_force_lowlevel(fplog,step,fr,inputrec,&(top->idef),
                       cr,nrnb,wcycle,mdatoms,&(inputrec->opts),
                       x,hist,f, bSepLRF ? fr->f_twin : f,enerd,fcd,mtop,top,fr->born,
                       &(top->atomtypes),bBornRadii,box,
                       inputrec->fepvals,lambda,graph,&(top->excls),fr->mu_tot,
-                      ((nb_kernel_type == nbk8x8x8_CUDA || nb_kernel_type == nbk8x8x8_PlainC) 
-                        ? flags&~GMX_FORCE_NONBONDED : flags),
-                      &cycles_pme);
+                      flags, &cycles_pme);
 
     if(bSepLRF)
     {