Commit cf094515 authored by Thomas Witkowski's avatar Thomas Witkowski

* Added time information to parallel debug server

parent c7be95ea
"ParallelProblem.h"
#include "ParallelProblem.h"
#include "ProblemScal.h"
#include "ProblemVec.h"
#include "ProblemInstat.h"
......@@ -116,7 +116,26 @@ namespace AMDiS {
closeTimestep(adaptInfo);
amdisGroup.Free();
};
}
void ParallelProblemBase::closeTimestep(AdaptInfo *adaptInfo)
{
if (mpiSize > 1 && doBuildGlobalSolution(adaptInfo)) {
if (debugMode && mpiRank == 0) {
// Send adaptInfo inforamtion to debug server
double sendTime = adaptInfo->getTime();
double sendTimestep = adaptInfo->getTimestep();
MPI::COMM_WORLD.Send(&sendTime, 1, MPI_DOUBLE, 0, 100);
MPI::COMM_WORLD.Send(&sendTimestep, 1, MPI_DOUBLE, 0, 100);
}
synchronizeMeshes(adaptInfo);
exchangeRankSolutions(adaptInfo);
buildGlobalSolution(adaptInfo);
}
if (timeIF_)
timeIF_->closeTimestep(adaptInfo);
}
Flag ParallelProblemBase::oneIteration(AdaptInfo *adaptInfo, Flag toDo)
{
......@@ -1746,6 +1765,19 @@ namespace AMDiS {
int mpiTag = 100;
while (true) {
/* ===== Communication with closeTimestep() ============== */
// Get current time and timestep
double recvTime = 0.0;
double recvTimestep = 0.0;
MPI::COMM_WORLD.Recv(&recvTime, 1, MPI_DOUBLE, 1, mpiTag);
MPI::COMM_WORLD.Recv(&recvTimestep, 1, MPI_DOUBLE, 1, mpiTag);
adaptInfo->setTime(recvTime);
adaptInfo->setTimestep(recvTimestep);
MeshStructure *structures = NEW MeshStructure[mpiWorldSize];
/* ===== Communication with exchangeMeshStructureCode() ====== */
......
......@@ -116,17 +116,7 @@ namespace AMDiS {
timeIF_->initTimestep(adaptInfo);
};
virtual void closeTimestep(AdaptInfo *adaptInfo)
{
if (mpiSize > 1 && doBuildGlobalSolution(adaptInfo)) {
synchronizeMeshes(adaptInfo);
exchangeRankSolutions(adaptInfo);
buildGlobalSolution(adaptInfo);
}
if (timeIF_)
timeIF_->closeTimestep(adaptInfo);
};
virtual void closeTimestep(AdaptInfo *adaptInfo);
virtual void solveInitialProblem(AdaptInfo *adaptInfo)
{
......
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