Beispiel #1
0
void
gmx_setup_kernels(FILE *fplog,gmx_bool bGenericKernelOnly)
{
    int i;
        
    snew(nb_kernel_list,eNR_NBKERNEL_NR);
    snew(pf_nb_kernel_list,eNR_NBKERNEL_NR);
    
    /* Note that later calls overwrite earlier, so the preferred (fastest)
     * version should be at the end. For instance, we call SSE after 3DNow.
     */
    
    for(i=0; i<eNR_NBKERNEL_NR; i++)
    {
        nb_kernel_list[i] = NULL;
        pf_nb_kernel_list[i] = NULL;
    }
    
    if (bGenericKernelOnly)
    {
        return;
    }
	
	if(fplog)
    {
	    fprintf(fplog,"Configuring nonbonded kernels...\n");
    }
	
    nb_kernel_setup(fplog,nb_kernel_list);
    
    if(getenv("GMX_NOOPTIMIZEDKERNELS") != NULL)
    {
        return;
    }

    /* Setup kernels. The last called setup routine will overwrite earlier assignments,
	 * so we should e.g. test SSE3 support _after_ SSE2 support,
     * and call e.g. Fortran setup before SSE.
	 */

    /* Setup the pairwise-force kernels, c/fortran only, no Assembly loops available */
    if(fplog)
        fprintf(fplog, "Configuring pairwise force nonbonded kernels...\n");
    pf_nb_kernel_setup(fplog,pf_nb_kernel_list);
    
#if defined(GMX_FORTRAN) && defined(GMX_DOUBLE)   
    nb_kernel_setup_f77_double(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_FORTRAN) && !defined(GMX_DOUBLE)   
    nb_kernel_setup_f77_single(fplog,nb_kernel_list);
#endif
	
#ifdef GMX_BLUEGENE
    nb_kernel_setup_bluegene(fplog,nb_kernel_list);
#endif
	
#ifdef GMX_POWER6
    nb_kernel_setup_power6(fplog,nb_kernel_list);
#endif
    
#ifdef GMX_PPC_ALTIVEC   
    nb_kernel_setup_ppc_altivec(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_IA32_SSE)
    nb_kernel_setup_ia32_sse(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_IA32_SSE2)
    nb_kernel_setup_ia32_sse2(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_X86_64_SSE)
    nb_kernel_setup_x86_64_sse(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_X86_64_SSE2)
    nb_kernel_setup_x86_64_sse2(fplog,nb_kernel_list);
#endif

#if (defined GMX_IA64_ASM && defined GMX_DOUBLE) 
    nb_kernel_setup_ia64_double(fplog,nb_kernel_list);
#endif
	
#if (defined GMX_IA64_ASM && !defined GMX_DOUBLE)
    nb_kernel_setup_ia64_single(fplog,nb_kernel_list);
#endif
	
	if(fplog)
    {
	    fprintf(fplog,"\n\n");
    }
}
Beispiel #2
0
void
gmx_setup_kernels(FILE *fplog)
{
    int i;
    
    snew(nb_kernel_list,eNR_NBKERNEL_NR);
    
    /* Note that later calls overwrite earlier, so the preferred (fastest)
     * version should be at the end. For instance, we call SSE after 3DNow.
     */
    
    for(i=0; i<eNR_NBKERNEL_NR; i++)
    {
        nb_kernel_list[i] = NULL;
    }
    
    if(getenv("GMX_NB_GENERIC") != NULL)
    {
        if(fplog)
        {
            fprintf(fplog,
                    "Found environment variable GMX_NB_GENERIC.\n"
                    "Disabling all interaction-specific nonbonded kernels.\n\n");
        }
        return;
    }
	
	if(fplog)
    {
	    fprintf(fplog,"Configuring nonbonded kernels...\n");
    }
	
    nb_kernel_setup(fplog,nb_kernel_list);
    
    if(getenv("GMX_NOOPTIMIZEDKERNELS") != NULL)
    {
        if(fplog)
            fprintf(fplog,
                    "Found environment variable GMX_NOOPTIMIZEDKERNELS.\n"
                    "Disabling all SSE/SSE2/Altivec/ia64/Power6/Bluegene specific kernels.\n\n");
        return;
    }
    
	/* Setup kernels. The last called setup routine will overwrite earlier assignments,
	 * so we should e.g. test SSE3 support _after_ SSE2 support.
	 */
#ifdef GMX_PPC_ALTIVEC   
    nb_kernel_setup_ppc_altivec(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_IA32_SSE)
    nb_kernel_setup_ia32_sse(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_IA32_SSE2)
    nb_kernel_setup_ia32_sse2(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_X86_64_SSE)
    nb_kernel_setup_x86_64_sse(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_X86_64_SSE2)
    nb_kernel_setup_x86_64_sse2(fplog,nb_kernel_list);
#endif

#if defined(GMX_SSE2) 
#  ifdef GMX_DOUBLE
	nb_kernel_setup_sse2_double(fplog,nb_kernel_list);
#  else
	nb_kernel_setup_sse2_single(fplog,nb_kernel_list);
#  endif
#endif
 
#if defined(GMX_FORTRAN) && defined(GMX_DOUBLE)   
    nb_kernel_setup_f77_double(fplog,nb_kernel_list);
#endif
	
#if defined(GMX_FORTRAN) && !defined(GMX_DOUBLE)   
    nb_kernel_setup_f77_single(fplog,nb_kernel_list);
#endif
	
#if (defined GMX_IA64_ASM && defined GMX_DOUBLE) 
    nb_kernel_setup_ia64_double(fplog,nb_kernel_list);
#endif
	
#if (defined GMX_IA64_ASM && !defined GMX_DOUBLE)
    nb_kernel_setup_ia64_single(fplog,nb_kernel_list);
#endif
	
#ifdef GMX_BLUEGENE
    nb_kernel_setup_bluegene(fplog,nb_kernel_list);
#endif
	
#ifdef GMX_POWER6
    nb_kernel_setup_power6(fplog,nb_kernel_list);
#endif
	
	
	
	if(fplog)
    {
	    fprintf(fplog,"\n\n");
    }
}