| version 1.1288 | version 1.1289 |
|---|
| |
| /***************************************************************************** | /***************************************************************************** |
| * $Source: /home/cvs/namd/cvsroot/namd2/src/WorkDistrib.C,v $ | * $Source: /home/cvs/namd/cvsroot/namd2/src/WorkDistrib.C,v $ |
| * $Author: jim $ | * $Author: jim $ |
| * $Date: 2016/09/07 18:09:59 $ | * $Date: 2016/09/14 15:47:33 $ |
| * $Revision: 1.1288 $ | * $Revision: 1.1289 $ |
| *****************************************************************************/ | *****************************************************************************/ |
| | |
| /** \file WorkDistrib.C | /** \file WorkDistrib.C |
| |
| #include "SortAtoms.h" | #include "SortAtoms.h" |
| #include <algorithm> | #include <algorithm> |
| #include "TopoManager.h" | #include "TopoManager.h" |
| | #include "ComputePmeCUDAMgr.h" |
| | |
| | #include "DeviceCUDA.h" |
| | #ifdef NAMD_CUDA |
| | #ifdef WIN32 |
| | #define __thread __declspec(thread) |
| | #endif |
| | extern __thread DeviceCUDA *deviceCUDA; |
| | #endif |
| | |
| //#define DEBUGM | //#define DEBUGM |
| #define MIN_DEBUG_LEVEL 2 | #define MIN_DEBUG_LEVEL 2 |
| |
| int* WorkDistrib::peCompactOrdering; | int* WorkDistrib::peCompactOrdering; |
| int* WorkDistrib::peCompactOrderingIndex; | int* WorkDistrib::peCompactOrderingIndex; |
| | |
| void cuda_initialize(); | #ifdef NAMD_CUDA |
| | extern void cuda_initialize(); |
| | #endif |
| | |
| void mic_initialize(); | void mic_initialize(); |
| | |
| void WorkDistrib::peOrderingReady() { | void WorkDistrib::peOrderingReady() { |
| |
| mapComputeHomePatches(computeEwaldType); | mapComputeHomePatches(computeEwaldType); |
| } | } |
| else { | else { |
| | #ifdef NAMD_CUDA |
| | if (node->simParameters->usePMECUDA) { |
| | mapComputePatch(computePmeCUDAType); |
| | } else |
| | #endif |
| | { |
| mapComputePatch(computePmeType); | mapComputePatch(computePmeType); |
| | } |
| if ( node->simParameters->pressureProfileEwaldOn ) | if ( node->simParameters->pressureProfileEwaldOn ) |
| mapComputeHomePatches(computeEwaldType); | mapComputeHomePatches(computeEwaldType); |
| } | } |
| |
| mapComputeHomePatches(computeFmmType); | mapComputeHomePatches(computeFmmType); |
| | |
| #ifdef NAMD_CUDA | #ifdef NAMD_CUDA |
| | if (node->simParameters->useCUDA2) { |
| | mapComputeNode(computeNonbondedCUDA2Type); |
| | } else { |
| mapComputeNode(computeNonbondedCUDAType); | mapComputeNode(computeNonbondedCUDAType); |
| | } |
| mapComputeHomeTuples(computeExclsType); | mapComputeHomeTuples(computeExclsType); |
| mapComputePatch(computeSelfExclsType); | mapComputePatch(computeSelfExclsType); |
| #endif | #endif |
| |
| | |
| } | } |
| | |
| | |
| //---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
| void WorkDistrib::mapComputeNode(ComputeType type) | void WorkDistrib::mapComputeNode(ComputeType type) |
| { | { |
| |
| | |
| } | } |
| | |
| | |
| //---------------------------------------------------------------------- | //---------------------------------------------------------------------- |
| void WorkDistrib::mapComputeNonbonded(void) | void WorkDistrib::mapComputeNonbonded(void) |
| { | { |
| |
| break; | break; |
| case computeNonbondedCUDAType: | case computeNonbondedCUDAType: |
| #ifdef NAMD_CUDA | #ifdef NAMD_CUDA |
| | case computeNonbondedCUDA2Type: |
| // CkPrintf("WorkDistrib[%d]::CUDA seq=%d phase=%d\n", CkMyPe(), seq, gbisPhase); | // CkPrintf("WorkDistrib[%d]::CUDA seq=%d phase=%d\n", CkMyPe(), seq, gbisPhase); |
| //wdProxy[CkMyPe()].enqueueCUDA(msg); | //wdProxy[CkMyPe()].enqueueCUDA(msg); |
| switch ( gbisPhase ) { | switch ( gbisPhase ) { |
| |
| // CkPrintf("PME %d %d %x\n", CkMyPe(), seq, compute->priority()); | // CkPrintf("PME %d %d %x\n", CkMyPe(), seq, compute->priority()); |
| wdProxy[CkMyPe()].enqueuePme(msg); | wdProxy[CkMyPe()].enqueuePme(msg); |
| break; | break; |
| | #ifdef NAMD_CUDA |
| | case computePmeCUDAType: |
| | wdProxy[CkMyPe()].enqueuePme(msg); |
| | break; |
| | #endif |
| case optPmeType: | case optPmeType: |
| // CkPrintf("PME %d %d %x\n", CkMyPe(), seq, compute->priority()); | // CkPrintf("PME %d %d %x\n", CkMyPe(), seq, compute->priority()); |
| #ifdef NAMD_CUDA | #ifdef NAMD_CUDA |