80 void Communication::sendParseInfo(
Time minBegTime,
Time maxEndTime,
int headerSize)
87 COMM_WORLD.Bcast(&Info,
sizeof(Info), MPI_PACKED, MPICommunication::SOCKET_SERVER);
91 void Communication::sendParseOpenDB(
string pathToDB)
97 cerr <<
"Path too long" << endl;
100 copy(pathToDB.begin(), pathToDB.end(), cmdPathToDB.
ofile.
path);
101 cmdPathToDB.
ofile.
path[pathToDB.size()] =
'\0';
103 COMM_WORLD.Bcast(&cmdPathToDB,
sizeof(cmdPathToDB), MPI_PACKED,
104 MPICommunication::SOCKET_SERVER);
108 Time timeStart,
Time timeEnd,
int verticalResolution,
int horizontalResolution)
118 COMM_WORLD.Bcast(&toBcast,
sizeof(toBcast), MPI_PACKED,
119 MPICommunication::SOCKET_SERVER);
124 int size = COMM_WORLD.Get_size();
128 while (ranksDone < size)
131 COMM_WORLD.Recv(&msg,
sizeof(msg), MPI_PACKED, MPI_ANY_SOURCE, MPI_ANY_TAG);
171 void Communication::sendStartFilter(
int count,
bool excludeMatches)
177 COMM_WORLD.Bcast(&toBcast,
sizeof(toBcast), MPI_PACKED,
178 MPICommunication::SOCKET_SERVER);
183 COMM_WORLD.Bcast(&filt,
sizeof(filt), MPI_PACKED, MPICommunication::SOCKET_SERVER);
186 bool Communication::basicInit(
int argc,
char** argv)
188 MPI::Init(argc, argv);
192 size = MPI::COMM_WORLD.Get_size();
195 cout <<
"The MPI version of hpcserver must be run with more than one process. "<<
196 "If you are looking for a single threaded version, you can compile hpcserver without MPI. "<<
197 "See the hpctoolkit documentation for more information."<<endl;
202 void Communication::run()
205 rank = MPI::COMM_WORLD.Get_rank();
211 void Communication::closeServer()
213 if (COMM_WORLD.Get_rank()==MPICommunication::SOCKET_SERVER)
217 COMM_WORLD.Bcast(&serverShutdown,
sizeof(serverShutdown), MPI_PACKED, MPICommunication::SOCKET_SERVER);
218 cout<<
"Server done, closing..."<<endl;
uint32_t verticalResolution
void copy(const char *dst,...)
static const int SOCKET_SERVER
virtual void writeInt(int)
static const unsigned int MAX_DB_PATH_LENGTH
uint32_t horizontalResolution
virtual void writeRawData(char *, int)
void incrementProgress(ulong tasks)
filter_header_command filt
virtual void writeLong(Long)
#define LOGTIMESTAMPEDMSG(msg)