From cf094515436514c234897d1065dd0ec8e10d6bc0 Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Wed, 13 Aug 2008 12:11:40 +0000 Subject: [PATCH] * Added time information to parallel debug server --- AMDiS/src/ParallelProblem.cc | 36 ++++++++++++++++++++++++++++++++++-- AMDiS/src/ParallelProblem.h | 12 +----------- 2 files changed, 35 insertions(+), 13 deletions(-) diff --git a/AMDiS/src/ParallelProblem.cc b/AMDiS/src/ParallelProblem.cc index f77753ef..f08a834c 100644 --- a/AMDiS/src/ParallelProblem.cc +++ b/AMDiS/src/ParallelProblem.cc @@ -1,4 +1,4 @@ - "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() ====== */ diff --git a/AMDiS/src/ParallelProblem.h b/AMDiS/src/ParallelProblem.h index 6403a557..b7ed0370 100644 --- a/AMDiS/src/ParallelProblem.h +++ b/AMDiS/src/ParallelProblem.h @@ -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) { -- GitLab