ComputeMgr.C File Reference

#include "InfoStream.h"
#include "ProcessorPrivate.h"
#include "Debug.h"
#include "BOCgroup.h"
#include "ComputeMgr.decl.h"
#include "ComputeMgr.h"
#include "ProxyMgr.decl.h"
#include "ProxyMgr.h"
#include "Node.h"
#include "ComputeMap.h"
#include "PatchMap.h"
#include "PatchMap.inl"
#include "Compute.h"
#include "ComputeNonbondedUtil.h"
#include "ComputeNonbondedSelf.h"
#include "ComputeNonbondedPair.h"
#include "ComputeNonbondedCUDA.h"
#include "ComputeNonbondedMIC.h"
#include "ComputeAngles.h"
#include "ComputeDihedrals.h"
#include "ComputeImpropers.h"
#include "ComputeThole.h"
#include "ComputeAniso.h"
#include "ComputeCrossterms.h"
#include "ComputeGromacsPair.h"
#include "ComputeBonds.h"
#include "ComputeNonbondedCUDAExcl.h"
#include "ComputeFullDirect.h"
#include "ComputeGlobal.h"
#include "ComputeGlobalMsgs.h"
#include "ComputeExt.h"
#include "ComputeQM.h"
#include "ComputeGBISser.h"
#include "ComputeLCPO.h"
#include "ComputeFmmSerial.h"
#include "ComputeMsmSerial.h"
#include "ComputeMsmMsa.h"
#include "ComputeMsm.h"
#include "ComputeDPMTA.h"
#include "ComputeDPME.h"
#include "ComputeDPMEMsgs.h"
#include "ComputePme.h"
#include "ComputePmeCUDA.h"
#include "ComputeCUDAMgr.h"
#include "CudaComputeNonbonded.h"
#include "ComputePmeCUDAMgr.h"
#include "OptPme.h"
#include "ComputeEwald.h"
#include "ComputeEField.h"
#include "ComputeGridForce.h"
#include "ComputeStir.h"
#include "ComputeSphericalBC.h"
#include "ComputeCylindricalBC.h"
#include "ComputeTclBC.h"
#include "ComputeRestraints.h"
#include "ComputeConsForce.h"
#include "ComputeConsForceMsgs.h"
#include "WorkDistrib.h"
#include "LdbCoordinator.h"
#include "FreeEnergyEnums.h"
#include "FreeEnergyAssert.h"
#include "FreeEnergyGroup.h"
#include "FreeEnergyVector.h"
#include "FreeEnergyRestrain.h"
#include "FreeEnergyRMgr.h"
#include "FreeEnergyLambda.h"
#include "FreeEnergyLambdMgr.h"
#include "GlobalMasterTest.h"
#include "GlobalMasterIMD.h"
#include "GlobalMasterTcl.h"
#include "GlobalMasterSMD.h"
#include "GlobalMasterTMD.h"
#include "GlobalMasterSymmetry.h"
#include "GlobalMasterEasy.h"
#include "GlobalMasterMisc.h"
#include "GlobalMasterFreeEnergy.h"
#include "GlobalMasterColvars.h"
#include "ComputeNonbondedMICKernel.h"
#include "DeviceCUDA.h"
#include "ComputeMgr.def.h"

Go to the source code of this file.

Classes

class  NonbondedCUDASlaveMsg
class  NonbondedCUDASkipMsg
class  NonbondedMICSlaveMsg
class  CudaComputeNonbondedMsg
class  NonbondedMICSkipMsg

Defines

#define MIN_DEBUG_LEVEL   1

Functions

CudaComputeNonbondedgetCudaComputeNonbonded ()
CudaComputeNonbondedcreateCudaComputeNonbonded (ComputeID c)
void registerUserEventsForAllComputeObjs ()
void build_cuda_exclusions ()
void build_cuda_force_table ()
int isMICProcessor (int pe)

Variables

__thread DeviceCUDAdeviceCUDA


Define Documentation

#define MIN_DEBUG_LEVEL   1

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 11 of file ComputeMgr.C.


Function Documentation

void build_cuda_exclusions (  ) 

Definition at line 576 of file ComputeNonbondedCUDA.C.

References ComputeNonbondedCUDA::build_exclusions(), deviceCUDA, and DeviceCUDA::getMasterPe().

Referenced by ComputeMgr::recvBuildCudaExclusions().

00576                              {
00577   if ( deviceCUDA->getMasterPe() != CkMyPe() ) return;
00578   ComputeNonbondedCUDA::build_exclusions();
00579 }

void build_cuda_force_table (  ) 

Definition at line 405 of file ComputeNonbondedCUDA.C.

References ComputeNonbondedCUDA::build_force_table(), ComputeNonbondedCUDA::build_lj_table(), deviceCUDA, and DeviceCUDA::getMasterPe().

Referenced by ComputeMgr::recvBuildCudaForceTable().

00405                               {
00406   if ( deviceCUDA->getMasterPe() != CkMyPe() ) return;
00407   ComputeNonbondedCUDA::build_lj_table();
00408   ComputeNonbondedCUDA::build_force_table();
00409 }

CudaComputeNonbonded* createCudaComputeNonbonded ( ComputeID  c  ) 

Definition at line 363 of file ComputeMgr.C.

References ComputeCUDAMgr::createCudaComputeNonbonded(), and ComputeCUDAMgr::getComputeCUDAMgr().

CudaComputeNonbonded* getCudaComputeNonbonded (  ) 

Definition at line 359 of file ComputeMgr.C.

References ComputeCUDAMgr::getComputeCUDAMgr(), and ComputeCUDAMgr::getCudaComputeNonbonded().

Referenced by ComputeMgr::createComputes().

int isMICProcessor ( int  pe  ) 

Definition at line 1880 of file ComputeMgr.C.

References computeMgr.

01880                            {
01881   return CProxy_ComputeMgr::ckLocalBranch(CkpvAccess(BOCclass_group).computeMgr)->isMICProcessor(pe);
01882 }

void registerUserEventsForAllComputeObjs ( void   ) 

Definition at line 834 of file ComputeMgr.C.

References computeAnglesType, computeAnisoType, computeBondsType, computeConsForceType, computeConsTorqueType, computeCrosstermsType, computeCylindricalBCType, computeDihedralsType, computeEFieldType, computeEwaldType, computeExclsType, computeExtType, computeFullDirectType, computeGlobalType, computeGridForceType, computeImpropersType, computeLCPOType, computeNonbondedPairType, computeNonbondedSelfType, computePmeCUDAType, computePmeType, computeQMType, computeRestraintsType, computeSelfAnglesType, computeSelfAnisoType, computeSelfBondsType, computeSelfCrosstermsType, computeSelfDihedralsType, computeSelfExclsType, computeSelfImpropersType, computeSelfTholeType, computeSphericalBCType, computeStirType, computeTclBCType, computeTholeType, PatchMap::gridsize_a(), PatchMap::gridsize_b(), PatchMap::gridsize_c(), PatchMap::index_a(), PatchMap::index_b(), PatchMap::index_c(), NAMD_bug(), ComputeMap::numComputes(), ComputeMap::Object(), PatchMap::Object(), Lattice::offset_a(), Lattice::offset_b(), Lattice::offset_c(), ComputeMap::pid(), TRACE_COMPOBJ_IDOFFSET, ComputeMap::trans(), and ComputeMap::type().

Referenced by Node::startup().

00835 {
00836 #ifdef TRACE_COMPUTE_OBJECTS
00837     ComputeMap *map = ComputeMap::Object();
00838     PatchMap *pmap = PatchMap::Object();     
00839     char user_des[50];
00840     int p1, p2;
00841     int adim, bdim, cdim;
00842     int t1, t2;
00843     int x1, y1, z1, x2, y2, z2;
00844     int dx, dy, dz;
00845     for (int i=0; i<map->numComputes(); i++)
00846     {
00847         memset(user_des, 0, 50);
00848         switch ( map->type(i) )
00849         {
00850         case computeNonbondedSelfType:
00851             sprintf(user_des, "computeNonBondedSelfType_%d_pid_%d", i, map->pid(i,0));
00852             break;
00853         case computeLCPOType:
00854             sprintf(user_des, "computeLCPOType_%d_pid_%d", i, map->pid(i,0));
00855             break;
00856         case computeNonbondedPairType:
00857             adim = pmap->gridsize_a();
00858             bdim = pmap->gridsize_b();
00859             cdim = pmap->gridsize_c();
00860             p1 = map->pid(i, 0);
00861             t1 = map->trans(i, 0);
00862             x1 = pmap->index_a(p1) + adim * Lattice::offset_a(t1);
00863             y1 = pmap->index_b(p1) + bdim * Lattice::offset_b(t1);
00864             z1 = pmap->index_c(p1) + cdim * Lattice::offset_c(t1);
00865             p2 = map->pid(i, 1);
00866             t2 = map->trans(i, 1);
00867             x2 = pmap->index_a(p2) + adim * Lattice::offset_a(t2);
00868             y2 = pmap->index_b(p2) + bdim * Lattice::offset_b(t2);
00869             z2 = pmap->index_c(p2) + cdim * Lattice::offset_c(t2);
00870             dx = abs(x1-x2);
00871             dy = abs(y1-y2);
00872             dz = abs(z1-z2);
00873             sprintf(user_des, "computeNonBondedPairType_%d(%d,%d,%d)", i, dx,dy,dz);
00874             break;
00875 #ifdef NAMD_CUDA
00876 #ifdef BONDED_CUDA
00877         case computeBondedCUDAType:
00878             sprintf(user_des, "computeBondedCUDAType_%d", i);
00879             break;
00880 #endif
00881 #endif
00882         case computeExclsType:
00883             sprintf(user_des, "computeExclsType_%d", i);
00884             break;
00885         case computeBondsType:
00886             sprintf(user_des, "computeBondsType_%d", i);
00887             break;
00888         case computeAnglesType:
00889             sprintf(user_des, "computeAnglesType_%d", i);
00890             break;
00891         case computeDihedralsType:
00892             sprintf(user_des, "computeDihedralsType_%d", i);
00893             break;
00894         case computeImpropersType:
00895             sprintf(user_des, "computeImpropersType_%d", i);
00896             break;
00897         case computeTholeType:
00898             sprintf(user_des, "computeTholeType_%d", i);
00899             break;
00900         case computeAnisoType:
00901             sprintf(user_des, "computeAnisoType_%d", i);
00902             break;
00903         case computeCrosstermsType:
00904             sprintf(user_des, "computeCrosstermsType_%d", i);
00905             break;
00906         case computeSelfExclsType:
00907             sprintf(user_des, "computeSelfExclsType_%d", i);
00908             break;
00909         case computeSelfBondsType:
00910             sprintf(user_des, "computeSelfBondsType_%d", i);
00911             break;
00912         case computeSelfAnglesType:
00913             sprintf(user_des, "computeSelfAnglesType_%d", i);
00914             break;
00915         case computeSelfDihedralsType:
00916             sprintf(user_des, "computeSelfDihedralsType_%d", i);
00917             break;
00918         case computeSelfImpropersType:
00919             sprintf(user_des, "computeSelfImpropersType_%d", i);
00920             break;
00921         case computeSelfTholeType:
00922             sprintf(user_des, "computeSelfTholeType_%d", i);
00923             break;
00924         case computeSelfAnisoType:
00925             sprintf(user_des, "computeSelfAnisoType_%d", i);
00926             break;
00927         case computeSelfCrosstermsType:
00928             sprintf(user_des, "computeSelfCrosstermsType_%d", i);
00929             break;
00930 #ifdef DPMTA
00931         case computeDPMTAType:
00932             sprintf(user_des, "computeDPMTAType_%d", i);
00933             break;
00934 #endif
00935 #ifdef DPME
00936         case computeDPMEType:
00937             sprintf(user_des, "computeDPMEType_%d", i);
00938             break;
00939 #endif
00940         case computePmeType:
00941             sprintf(user_des, "computePMEType_%d", i);
00942             break;
00943 #ifdef NAMD_CUDA
00944         case computePmeCUDAType:
00945             sprintf(user_des, "computePMECUDAType_%d", i);
00946             break;
00947 #endif
00948         case computeEwaldType:
00949             sprintf(user_des, "computeEwaldType_%d", i);
00950             break;
00951         case computeFullDirectType:
00952             sprintf(user_des, "computeFullDirectType_%d", i);
00953             break;
00954         case computeGlobalType:
00955             sprintf(user_des, "computeGlobalType_%d", i);
00956             break;
00957         case computeStirType:
00958             sprintf(user_des, "computeStirType_%d", i);
00959             break;
00960         case computeExtType:
00961             sprintf(user_des, "computeExtType_%d", i);
00962             break;
00963         case computeQMType:
00964             sprintf(user_des, "computeQMType_%d", i);
00965             break;
00966         case computeEFieldType:
00967             sprintf(user_des, "computeEFieldType_%d", i);
00968             break;
00969             /* BEGIN gf */
00970         case computeGridForceType:
00971             sprintf(user_des, "computeGridForceType_%d", i);
00972             break;
00973             /* END gf */
00974         case computeSphericalBCType:
00975             sprintf(user_des, "computeSphericalBCType_%d", i);
00976             break;
00977         case computeCylindricalBCType:
00978             sprintf(user_des, "computeCylindricalBCType_%d", i);
00979             break;
00980         case computeTclBCType:
00981             sprintf(user_des, "computeTclBCType_%d", i);
00982             break;
00983         case computeRestraintsType:
00984             sprintf(user_des, "computeRestraintsType_%d", i);
00985             break;
00986         case computeConsForceType:
00987             sprintf(user_des, "computeConsForceType_%d", i);
00988             break;
00989         case computeConsTorqueType:
00990             sprintf(user_des, "computeConsTorqueType_%d", i);
00991             break;
00992         default:
00993             NAMD_bug("Unknown compute type in ComputeMgr::registerUserEventForAllComputeObjs().");
00994             break;
00995         }
00996         int user_des_len = strlen(user_des);
00997         char *user_des_cst = new char[user_des_len+1];
00998         memcpy(user_des_cst, user_des, user_des_len);
00999         user_des_cst[user_des_len] = 0;
01000         //Since the argument in traceRegisterUserEvent is supposed
01001         //to be a const string which will not be copied inside the
01002         //function when a new user event is created, user_des_cst 
01003         //has to be allocated in heap.
01004         int reEvenId = traceRegisterUserEvent(user_des_cst, TRACE_COMPOBJ_IDOFFSET+i);
01005         //printf("Register user event (%s) with id (%d)\n", user_des, reEvenId);
01006     }
01007 #else
01008     return;
01009 #endif
01010 }


Variable Documentation

__thread DeviceCUDA* deviceCUDA

Definition at line 18 of file DeviceCUDA.C.


Generated on Sat Sep 23 01:17:16 2017 for NAMD by  doxygen 1.4.7