Commit 41b98920 authored by dino's avatar dino
Browse files

Check size of the communication buffers defined in the topology files for Producers and Builders

git-svn-id: svn://gal-serv.lnl.infn.it/agata/trunk/narval_emulator@1132 170316e4-aea8-4b27-aad4-0380ec0519c9
parent 28ee968a
......@@ -28,7 +28,9 @@
#include <fstream>
#include <vector>
#define WCT_BUFSIZE (10*1024*1024) // default size (bytes) of the data buffers connecting the actors
#define WCT_BUFSIZE_MIN 1024 // Minimum size (bytes) of the data buffers connecting the actors
#define WCT_BUFSIZE (10*1024*1024) // Maximum size (bytes) of the data buffers connecting the actors
//#define WCT_THREADED // THIS IS NOW DEFINED IN ChainLocker.h
#include "commonDefs.h"
......@@ -582,11 +584,11 @@ bool topologyRead(string topo)
cout << line << endl;
string lname, lmore;
stringSplit(data, lname, lmore); // isolate the extra parts after the name of the library
stringSplit(data, lname, lmore); // isolate the extra parts after the name of the library
theActor.libName = lname;
theActor.libMore = lmore;
theActor.libConf = pChain->confDir;
theActor.sizeOut = WCT_BUFSIZE;
theActor.sizeOut = WCT_BUFSIZE; // preset size to max
if( stringEq(keyw, "BUILDER") ) {
if(nn) {
......@@ -596,6 +598,8 @@ bool topologyRead(string topo)
theActor.libType = BUILDER;
if(lmore.size() > 0)
theActor.sizeOut = atoi(lmore.c_str());
if(theActor.sizeOut < WCT_BUFSIZE_MIN) theActor.sizeOut = WCT_BUFSIZE_MIN; // not smaller than this
if(theActor.sizeOut > WCT_BUFSIZE ) theActor.sizeOut = WCT_BUFSIZE; // not bigger than this
}
else if( stringEq(keyw, "PRODUCER") ) {
if(nn) {
......@@ -604,9 +608,9 @@ bool topologyRead(string topo)
}
theActor.libType = PRODUCER;
if(lmore.size() > 0) {
unsigned int usize = atoi(lmore.c_str());
if(usize < WCT_BUFSIZE)
theActor.sizeOut = usize;
theActor.sizeOut = atoi(lmore.c_str());
if(theActor.sizeOut < WCT_BUFSIZE_MIN) theActor.sizeOut = WCT_BUFSIZE_MIN; // not smaller than this
if(theActor.sizeOut > WCT_BUFSIZE ) theActor.sizeOut = WCT_BUFSIZE; // not bigger than this
}
}
else if( stringEq(keyw, "FILTER") ) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment