Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ProxyMgr.C File Reference

#include "InfoStream.h"
#include "main.h"
#include "BOCgroup.h"
#include "ProxyMgr.decl.h"
#include "ProxyMgr.h"
#include "PatchMap.inl"
#include "ProxyPatch.h"
#include "ComputeMap.h"
#include "HomePatch.h"
#include <string.h>
#include "ProcessorPrivate.h"
#include "packmsg.h"
#include "Priorities.h"
#include <alloca.h>
#include <malloc.h>
#include "Debug.h"
#include "ProxyMgr.def.h"

Go to the source code of this file.

Defines

#define MIN_DEBUG_LEVEL   2
#define MAX_INTERNODE   1

Functions

 PACK_MSG (ProxyAtomsMsg, PACK(patch);PACK_RESIZE(atomIDList);)
int compLoad (const void *a, const void *b)
void processCpuLoad ()
int noInterNode (int p)

Variables

int proxySendSpanning = 0
int proxyRecvSpanning = 0
const int proxySpanDim = 9
const int inNodeProxySpanDim = 16
double * cpuloads
int * procidx = NULL
double averageLoad = 0.0


Define Documentation

#define MAX_INTERNODE   1
 

Definition at line 600 of file ProxyMgr.C.

Referenced by ProxyMgr::buildSpanningTree0().

#define MIN_DEBUG_LEVEL   2
 

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

Definition at line 33 of file ProxyMgr.C.


Function Documentation

int compLoad const void *  a,
const void *  b
[static]
 

Definition at line 636 of file ProxyMgr.C.

References cpuloads.

Referenced by processCpuLoad().

00637 {
00638   int i1 = *(int *)a;
00639   int i2 = *(int *)b;
00640   double d1 = cpuloads[i1];
00641   double d2 = cpuloads[i2];
00642   if (d1 < d2) 
00643     return 1;
00644   else if (d1 == d2) 
00645     return 0;
00646   else 
00647     return -1;
00648   // sort from high to low
00649 }

int noInterNode int  p  )  [static]
 

Definition at line 667 of file ProxyMgr.C.

References procidx.

Referenced by ProxyMgr::buildSpanningTree0().

00668 {
00669   int exclude = 0;
00670   if(CkNumPes()<1025)
00671     exclude = 5;
00672   else if(CkNumPes()<4097)
00673     exclude = 10;
00674   else if(CkNumPes()<8193)
00675     exclude = 40;
00676   else if(CkNumPes()<16385)
00677     exclude = 40;
00678   else
00679     exclude = 80;
00680   for (int i=0; i<exclude; i++) if (procidx[i] == p) return 1;
00681 //  if (cpuloads[p] > averageLoad) return 1;
00682   return 0;
00683 }

PACK_MSG ProxyAtomsMsg  ,
PACK(patch);PACK_RESIZE(atomIDList); 
 

Definition at line 41 of file ProxyMgr.C.

References ALIGN_8, ResizeArray< Elem >::begin(), Force, ProxyResultMsg::forceList, j, ProxyResultMsg::node, ProxyResultMsg::patch, ResizeArray< Elem >::size(), Vector::x, Vector::y, and Vector::z.

00052                                               {
00053 
00054   int msg_size = 0;
00055   msg_size += sizeof(msg->node);
00056   msg_size += sizeof(msg->patch);
00057 
00058   int j;
00059   for ( j = 0; j < Results::maxNumForces; ++j ) {
00060     int array_size = msg->forceList[j].size();
00061     msg_size += sizeof(array_size);
00062     msg_size += array_size * sizeof(char);    
00063     msg_size = ALIGN_8 (msg_size);
00064     Force* f = msg->forceList[j].begin();
00065     int nonzero_count = 0;
00066     for ( int i = 0; i < array_size; ++i ) {
00067       if ( f[i].x != 0. || f[i].y != 0. || f[i].z != 0. ) { ++nonzero_count; }
00068     }
00069     msg_size += nonzero_count * sizeof(Vector);
00070   }
00071 
00072   void *msg_buf = CkAllocBuffer(msg,msg_size);
00073   char *msg_cur = (char *)msg_buf;
00074 
00075   CmiMemcpy((void*)msg_cur,(void*)(&(msg->node)),sizeof(msg->node));
00076   msg_cur += sizeof(msg->node);
00077   CmiMemcpy((void*)msg_cur,(void*)(&(msg->patch)),sizeof(msg->patch));
00078   msg_cur += sizeof(msg->patch);
00079   for ( j = 0; j < Results::maxNumForces; ++j ) {
00080     int array_size = msg->forceList[j].size();
00081     *(int *) msg_cur = array_size;
00082     msg_cur += sizeof(int);
00083     char *nonzero = msg_cur;
00084     msg_cur += array_size * sizeof(char);
00085     msg_cur = (char *)ALIGN_8 (msg_cur);
00086     Vector *farr = (Vector *)msg_cur;
00087     Force* f = msg->forceList[j].begin();
00088 
00089     for ( int i = 0; i < array_size; ++i ) {
00090       if ( f[i].x != 0. || f[i].y != 0. || f[i].z != 0. ) {
00091         nonzero[i] = 1;
00092         farr->x = f[i].x;
00093         farr->y = f[i].y;
00094         farr->z = f[i].z;
00095         farr ++;
00096       } else {
00097         nonzero[i] = 0;
00098       }
00099     }
00100     msg_cur = (char *) farr;      
00101   }
00102 
00103   delete msg;
00104   return msg_buf;
00105 }

void processCpuLoad  )  [static]
 

Definition at line 651 of file ProxyMgr.C.

References averageLoad, compLoad(), cpuloads, and procidx.

Referenced by ProxyMgr::buildSpanningTree0().

00652 {
00653   int i;
00654   if (!procidx) {
00655     procidx = new int[CkNumPes()];
00656   }
00657   for (i=0; i<CkNumPes(); i++) procidx[i] = i;
00658   qsort(procidx, CkNumPes(), sizeof(int), compLoad);
00659 
00660   double averageLoad = 0.0;
00661   for (i=0; i<CkNumPes(); i++) averageLoad += cpuloads[i];
00662   averageLoad /= CkNumPes();
00663 //  iout << "buildSpanningTree1: no intermediate node on " << procidx[0] << " " << procidx[1] << endi;
00664 
00665 }


Variable Documentation

double averageLoad = 0.0 [static]
 

Definition at line 634 of file ProxyMgr.C.

Referenced by processCpuLoad().

double* cpuloads
 

Definition at line 24 of file NamdCentLB.C.

Referenced by compLoad(), CreateNamdCentLB(), and processCpuLoad().

const int inNodeProxySpanDim = 16
 

Definition at line 39 of file ProxyMgr.C.

int* procidx = NULL [static]
 

Definition at line 633 of file ProxyMgr.C.

Referenced by noInterNode(), and processCpuLoad().

int proxyRecvSpanning = 0
 

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

Definition at line 37 of file ProxyMgr.C.

Referenced by ProxyMgr::buildProxySpanningTree(), ProxyMgr::recvResults(), and ProxyMgr::setRecvSpanning().

int proxySendSpanning = 0
 

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

Definition at line 36 of file ProxyMgr.C.

Referenced by ProxyMgr::buildProxySpanningTree(), Sync::openSync(), HomePatch::positionsReady(), ProxyMgr::recvImmediateProxyAll(), ProxyMgr::recvImmediateProxyData(), ProxyMgr::recvProxyAll(), ProxyMgr::recvProxyData(), RefineOnly::RefineOnly(), RefineTorusLB::RefineTorusLB(), ProxyMgr::sendProxyAll(), ProxyMgr::sendProxyData(), ProxyMgr::setSendSpanning(), Node::startup(), and ComputeMgr::updateLocalComputes5().

const int proxySpanDim = 9
 

Definition at line 38 of file ProxyMgr.C.

Referenced by HomePatch::buildSpanningTree(), ProxyMgr::buildSpanningTree0(), and ProxyMgr::recvNodeAwareSpanningTree().


Generated on Mon Nov 23 04:59:29 2009 for NAMD by  doxygen 1.3.9.1