#include "nb_kernel.h"
#include "smalloc.h"
#include "string2.h"
+#include "gmx_fatal.h"
/* Static data structures to find kernels */
index = (index+1) % kernel_list_hash_size;
}
- if(log && kernelinfo_ptr!=NULL)
+ if(debug && kernelinfo_ptr!=NULL)
{
- fprintf(log,
+ fprintf(debug,
"NB kernel %s() with architecture '%s' used for neighborlist with\n"
" Elec: '%s', Modifier: '%s'\n"
" Vdw: '%s', Modifier: '%s'\n"
nl->kernelptr_vf = gmx_nb_generic_kernel;
nl->kernelptr_f = gmx_nb_generic_kernel;
nl->simd_padding_width = 1;
- if(log)
+ if(debug)
{
- fprintf(log,
+ fprintf(debug,
"WARNING - Slow generic NB kernel used for neighborlist with\n"
" Elec: '%s', Modifier: '%s'\n"
" Vdw: '%s', Modifier: '%s'\n"
gmx_bool use_cpu_acceleration,
gmx_bool *bUseGPU,
int *kernel_type,
- int *ewald_excl)
+ int *ewald_excl,
+ gmx_bool bDoNonbonded)
{
gmx_bool bEmulateGPU, bGPU, bEmulateGPUEnvVarSet;
char gpu_err_str[STRLEN];
* automatically switch to emulation if non-bonded calculations are
* turned off via GMX_NO_NONBONDED - this is the simple and elegant
* way to turn off GPU initialization, data movement, and cleanup. */
- bEmulateGPU = (bEmulateGPUEnvVarSet || (getenv("GMX_NO_NONBONDED") != NULL && bGPU));
+ bEmulateGPU = (bEmulateGPUEnvVarSet || (!bDoNonbonded && bGPU));
/* Enable GPU mode when GPUs are available or GPU emulation is requested.
* The latter is useful to assess the performance one can expect by adding
{
*kernel_type = nbk8x8x8_PlainC;
- md_print_warn(cr, fp, "Emulating a GPU run on the CPU (slow)");
+ if (bDoNonbonded)
+ {
+ md_print_warn(cr, fp, "Emulating a GPU run on the CPU (slow)");
+ }
}
else if (bGPU)
{
}
}
- if (fp != NULL)
+ if (bDoNonbonded && fp != NULL)
{
if (MASTER(cr))
{
pick_nbnxn_kernel(fp, cr, fr->hwinfo, fr->use_cpu_acceleration,
&nbv->bUseGPU,
&nbv->grp[i].kernel_type,
- &nbv->grp[i].ewald_excl);
+ &nbv->grp[i].ewald_excl,
+ fr->bNonbonded);
}
else /* non-local */
{
pick_nbnxn_kernel(fp, cr, fr->hwinfo, fr->use_cpu_acceleration,
NULL,
&nbv->grp[i].kernel_type,
- &nbv->grp[i].ewald_excl);
+ &nbv->grp[i].ewald_excl,
+ fr->bNonbonded);
bHybridGPURun = TRUE;
}