1#include "DistBossServer/DistBossServer.h"
2#include "DistBossServer/WriterRpc.h"
3#include "DistBossServer/ReaderRpc.h"
4#include "RootFile/RootFileWriter.h"
5#include "RawFile/RawFileReader.h"
6#include "IRawFile/RawFileExceptions.h"
11const std::string DistBossServer::m_serverName = DistBossServer::autoServerName();
12const std::string DistBossServer::m_svc[7] = {
13 m_serverName +
"/RawEvtSvc",
14 m_serverName +
"/SimSeedSvc",
15 m_serverName +
"/RootEvtSvc",
16 m_serverName +
"/WriteDst",
17 m_serverName +
"/WriteRec",
18 m_serverName +
"/WriteTuple",
19 m_serverName +
"/WriteHist"
23std::string DistBossServer::autoServerName()
25 std::stringstream spid;
29 gethostname(hname, 64);
31 std::string name(
"/DistBoss/P");
32 name += spid.str() +
"@" + hname;
40 if ( m_optMgr.
evtMax() == 0 ) {
41 std::cout <<
"[DistBossServer] EvtMax = 0, exit now!" << std::endl;
45 std::cout <<
"[DistBossServer] Starting server: " << m_serverName << std::endl;
52 std::cout <<
"[DistBossServer] Simulation is not supported by DistBoss yet!" << std::endl;
57 std::cout <<
"[DistBossServer] Root input files are not supported by DistBoss yet!" << std::endl;
63 const std::vector<int>& outputs = m_optMgr.
outputTypes();
64 for ( std::vector<int>::const_iterator it = outputs.begin(); it != outputs.end(); ++it ) {
93 for (
unsigned int i = 0; i < m_writerRpcs.size(); ++i ) {
94 delete m_writerRpcs[i];
97 std::cout <<
"[DistBossServer] Server stopped." << std::endl;
104 DimServer::addExitHandler( m_exitHandler );
105 DimServer::addErrorHandler( m_errorHandler );
107 DimServer::start(m_serverName.c_str());
112 for (
unsigned int i = 0; i < m_writerRpcs.size(); ++i ) {
113 nClients = m_writerRpcs[i]->wait_to_end();
DistBossServer(const std::string &jobOpt)
const std::string & dstFile()
const std::vector< std::string > & inputFiles()
void clientOptsTemplate(const std::string &svrName)
const std::vector< int > & outputTypes()
const std::string & recFile()
virtual int wait_to_end()=0