Adding some missing files into cvs
[charm.git] / examples / pose / HiSim / InputVcSelection / outputBufferIn.C
1 #include "outputBufferIn.h"
2 int outputBufferIn::selectInputVc(map<int,int> & Bufsize,map<int,int> & requested,map<int, vector <Header> > &inBuffer, const int lastOutputVc) {
3
4         int maxsize = 0,vc = NO_VC_AVAILABLE,outPort = lastOutputVc/config.switchVc;    
5
6 // We can provide some sort of QOS for particular virtual channels here
7         if(requested[outPort])
8                 return NO_VC_AVAILABLE;
9
10         for(int i=outPort*config.switchVc;i<((outPort+1)*config.switchVc);i++) {
11                 if(inBuffer[i].size()) {
12                 if(maxsize < inBuffer[i].size()) {
13                         maxsize = inBuffer[i].size();
14                         vc = i;
15                 }
16                 }
17         }
18
19         return vc;
20 }