Пример #1
0
void dem::repositories::RepositorySTDStack::terminate() {
  logTraceIn( "terminate()" );
  
  _repositoryState.setAction( dem::records::RepositoryState::Terminate );
  
  #ifdef Parallel
  if (tarch::parallel::Node::getInstance().isGlobalMaster()) {
    tarch::parallel::NodePool::getInstance().broadcastToWorkingNodes(
      _repositoryState,
      peano::parallel::SendReceiveBufferPool::getInstance().getIterationManagementTag()
    );
  }
  peano::parallel::SendReceiveBufferPool::getInstance().terminate();
  #endif

  _gridWithCreateGrid.terminate();
  _gridWithCreateGridAndPlot.terminate();
  _gridWithTimeStep.terminate();
  _gridWithTimeStepAndPlot.terminate();
  _gridWithTimeStepOnDynamicGrid.terminate();
  _gridWithTimeStepAndPlotOnDynamicGrid.terminate();
  _gridWithTimeStepOnReluctantDynamicGrid.terminate();
  _gridWithTimeStepAndPlotOnReluctantDynamicGrid.terminate();


  logTraceOut( "terminate()" );
}
void peano::applications::poisson::multigrid::repositories::MultigridBatchJobRepositoryForSpacetreeGridFileStackImplementation::restart(
  const tarch::la::Vector<DIMENSIONS,bool>&    evenFlags,
  const tarch::la::Vector<THREE_POWER_D,int>&  traversalOrderOfNeighbours,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  domainOffset,
  int                                          domainLevel
) {
  logTraceInWith2Arguments( "restart(...)", evenFlags, traversalOrderOfNeighbours );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
  #endif
  
  assertion( _repositoryState.getAction() == MultigridBatchJobRepositoryState::Terminate );

  _vertexStack.clear();
  _cellStack.clear();

  _gridWithSetupExperiment.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetupExperimentAndPlotGrid.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetupExperimentAndPlotStartSolution.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSmoothAndComputeGalerkinCoarseGridOperator.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithPlotSolution.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);

  logTraceOut( "restart(...)" );
}
Пример #3
0
void peano::applications::heatequation::timestepping::adapters::SpacetreeGrid2PlotGrid::endIteration(
  peano::applications::heatequation::timestepping::SpacetreeGridState&  solverState
) {
  logTraceInWith1Argument( "endIteration(...)", solverState );


 
  #ifdef SharedTBB
  Vertex2IndexMapSemaphore::scoped_lock localLock(_vertex2IndexMapSemaphore);
  #elif SharedOMP
  #pragma omp critical
  #endif
 
  _vertexWriter->close();
  _cellWriter->close();
  
  _vertexTypeWriter->close();
  _vertexRefinementControlWriter->close();
  _vertexMaximumSubtreeWriter->close();
  
  #ifdef Parallel
  _cellDeltaWriter->close();
  _cellWeightWriter->close();
  #endif
  
  delete _vertexWriter;
  delete _cellWriter;
  delete _vertexTypeWriter;
  delete _vertexRefinementControlWriter;
  delete _vertexMaximumSubtreeWriter;
   #ifdef Parallel
  delete _cellDeltaWriter;
  delete _cellWeightWriter;
  #endif
  
  _vertexWriter     = 0;
  _cellWriter       = 0;
  _vertexTypeWriter = 0;
  _vertexRefinementControlWriter = 0;
  _vertexMaximumSubtreeWriter = 0;
   #ifdef Parallel
  _cellDeltaWriter = 0;
  _cellWeightWriter = 0;
  #endif
  
  std::ostringstream snapshotFileName;
  snapshotFileName << "vtk-grid-snapshot-SpacetreeGrid2PlotGrid-"
                   << _snapshotCounter
                   #ifdef Parallel
                   << "-rank" << tarch::parallel::Node::getInstance().getRank()
                   #endif
                   << ".vtk";
  _vtkWriter.writeToFile( snapshotFileName.str() );
  
  _snapshotCounter++;                  
  
  _vertex2IndexMap.clear();
 
  logTraceOut( "endIteration(...)" ); 
}
peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridFileStackImplementation::GridConstructionMovieBatchJobRepositoryForSpacetreeGridFileStackImplementation(
  peano::geometry::Geometry&                   geometry,
  int                                          blockSize,
  int                                          numberOfBlocks,
  int                                          minFillThreshold,
  int                                          maxFillThreshold,
  const std::string&                           tempFilePrefix    
):
  _geometry(geometry),
  _cellStack(blockSize,numberOfBlocks,minFillThreshold,maxFillThreshold,tempFilePrefix),
  _vertexStack(blockSize,numberOfBlocks,minFillThreshold,maxFillThreshold,tempFilePrefix),
  _solverState(),
  _gridWithPerformOneRefinement(_vertexStack,_cellStack,_geometry,_solverState),
  _gridWithPerformOneRefinementWithoutGridSnapshot(_vertexStack,_cellStack,_geometry,_solverState),

  _countPerformOneRefinementRuns(0),
  _countPerformOneRefinementWithoutGridSnapshotRuns(0),

  _measurePerformOneRefinementCPUTime(0.0),
  _measurePerformOneRefinementWithoutGridSnapshotCPUTime(0.0),

  _measurePerformOneRefinementCalendarTime(0.0),
  _measurePerformOneRefinementWithoutGridSnapshotCalendarTime(0.0),

  _repositoryState() {
  logTraceIn( "peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridFileStackImplementation(Geometry&)" );

  _repositoryState.setAction( GridConstructionMovieBatchJobRepositoryState::Terminate );

  peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(2 +3);

  logTraceOut( "peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridFileStackImplementation(Geometry&)" );
}
void peano::applications::poisson::vhhjacobi::repositories::JacobiBatchJobRepositoryForRegularGridStandardImplementation::restart(
    const tarch::la::Vector<DIMENSIONS,int>&     numberOfGridPoints,
    const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
    const tarch::la::Vector<DIMENSIONS,double>&  computationalDomainOffset,
    const tarch::la::Vector<TWO_POWER_D_TIMES_TWO_POWER_D,int>&  neighbourRanks
) {
    logTraceInWith3Arguments( "restart(...)", numberOfGridPoints, domainSize, computationalDomainOffset );
#ifdef Parallel
    assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
#endif

    assertion( _repositoryState.getAction() == JacobiBatchJobRepositoryState::Terminate );

#ifdef Parallel
    _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset,neighbourRanks);
#else
    _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset);
#endif

    _gridWithSetupExperiment.restart(domainSize,computationalDomainOffset);
    _gridWithJacobiStep.restart(domainSize,computationalDomainOffset);
    _gridWithJacobiStepAndPlotSolution.restart(domainSize,computationalDomainOffset);
    _gridWithPlotSolution.restart(domainSize,computationalDomainOffset);

    logTraceOut( "restart(...)" );
}
void peano::applications::pic::demo2::mappings::RegularGrid2PlotSolution::handleCell(
  peano::applications::pic::demo2::RegularGridVertex* const vertices,
  peano::applications::pic::demo2::RegularGridCell&  cell,
  const peano::kernel::gridinterface::VertexEnumerator&  enumerator
) {
  logTraceInWith2Arguments( "handleCell()", enumerator.toString(), cell );
  // @todo Insert your code here
	assertion( DIMENSIONS==2 || DIMENSIONS==3 );
	int vertexIndex[TWO_POWER_D];
	dfor2(i)
	    tarch::la::Vector<DIMENSIONS,double> currentVertexPosition = enumerator.getVertexPosition(i);
	    assertion1 ( _vertex2IndexMap.find(currentVertexPosition) != _vertex2IndexMap.end(), currentVertexPosition );
	    assertion1( _vertex2IndexMap[currentVertexPosition]>=0, _vertex2IndexMap[currentVertexPosition] );
	    vertexIndex[iScalar] = _vertex2IndexMap[currentVertexPosition];
	enddforx

	int cellIndex;
	if (DIMENSIONS==2) {
	  cellIndex = _cellWriter->plotQuadrangle(vertexIndex);
	}
	if (DIMENSIONS==3) {
	  cellIndex = _cellWriter->plotHexahedron(vertexIndex);
	}

	_cellPWriter->plotCell( cellIndex,cell.getP() );
  logTraceOut( "handleCell()" );
}
peano::applications::faxen::lbf::mappings::RegularGrid2MoveParticles::RegularGrid2MoveParticles() {
	logTraceIn( "RegularGrid2MoveParticles()" );

	_cellVertices = new peano::applications::faxen::lbf::RegularGridBlockVertex*[TWO_POWER_D];

	logTraceOut( "RegularGrid2MoveParticles()" );
}
void peano::applications::latticeboltzmann::blocklatticeboltzmann::repositories::BlockLatticeBoltzmannBatchJobRepositoryForRegularGridStandardImplementation::restart(
  const tarch::la::Vector<DIMENSIONS,int>&     numberOfGridPoints,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  computationalDomainOffset,
  const tarch::la::Vector<TWO_POWER_D_TIMES_TWO_POWER_D,int>&  neighbourRanks
) {
  logTraceInWith3Arguments( "restart(...)", numberOfGridPoints, domainSize, computationalDomainOffset );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
  #endif
  
  assertion( _repositoryState.getAction() == BlockLatticeBoltzmannBatchJobRepositoryState::Terminate );

  #ifdef Parallel
  _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset,neighbourRanks);
  #else
  _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset);
  #endif

  _gridWithRegularBlockSolverAdapter.restart(domainSize,computationalDomainOffset);
  _gridWithInitialiseSpacetreeGridAdapter.restart(domainSize,computationalDomainOffset);
  _gridWithBlockCCAOutputAdapter.restart(domainSize,computationalDomainOffset);
  _gridWithDynamicRefinementForSpacetreeGridAdapter.restart(domainSize,computationalDomainOffset);
  _gridWithBlockVTKOutputAdapter.restart(domainSize,computationalDomainOffset);
  _gridWithRegularBlockSolverAndVTKOutputAdapter.restart(domainSize,computationalDomainOffset);

  logTraceOut( "restart(...)" );
}
void peano::applications::latticeboltzmann::blocklatticeboltzmann::repositories::BlockLatticeBoltzmannBatchJobRepositoryForRegularGridStandardImplementation::terminate() {
  logTraceIn( "terminate(...)" );
  
  _repositoryState.setAction( BlockLatticeBoltzmannBatchJobRepositoryState::Terminate );
  
  #ifdef Parallel
  if (tarch::parallel::Node::getInstance().isMasterProcess()) {
    tarch::parallel::NodePool::getInstance().broadcastToWorkingNodes(
      _repositoryState,
      peano::kernel::parallel::SendReceiveBufferPool::getInstance().getIterationManagementTag()
    );
  }
  peano::kernel::parallel::SendReceiveBufferPool::getInstance().terminate();
  #endif
  
  _gridContainer.terminate();
  _gridWithRegularBlockSolverAdapter.terminate();
  _gridWithInitialiseSpacetreeGridAdapter.terminate();
  _gridWithBlockCCAOutputAdapter.terminate();
  _gridWithDynamicRefinementForSpacetreeGridAdapter.terminate();
  _gridWithBlockVTKOutputAdapter.terminate();
  _gridWithRegularBlockSolverAndVTKOutputAdapter.terminate();

  logTraceOut( "terminate()" );
}
Пример #10
0
void peanoclaw::repositories::RepositoryArrayStack::terminate() {
  logTraceIn( "terminate()" );
  
  _repositoryState.setAction( peanoclaw::records::RepositoryState::Terminate );
  
  #ifdef Parallel
  if (tarch::parallel::Node::getInstance().isGlobalMaster()) {
    tarch::parallel::NodePool::getInstance().broadcastToWorkingNodes(
      _repositoryState,
      peano::parallel::SendReceiveBufferPool::getInstance().getIterationManagementTag()
    );
  }
  peano::parallel::SendReceiveBufferPool::getInstance().terminate();
  #endif
  
  _gridWithInitialiseGrid.terminate();
  _gridWithInitialiseAndValidateGrid.terminate();
  _gridWithPlot.terminate();
  _gridWithPlotAndValidateGrid.terminate();
  _gridWithRemesh.terminate();
  _gridWithSolveTimestep.terminate();
  _gridWithSolveTimestepAndValidateGrid.terminate();
  _gridWithSolveTimestepAndPlot.terminate();
  _gridWithSolveTimestepAndPlotAndValidateGrid.terminate();
  _gridWithGatherCurrentSolution.terminate();
  _gridWithGatherCurrentSolutionAndValidateGrid.terminate();
  _gridWithCleanup.terminate();

 
  logTraceOut( "terminate()" );
}
Пример #11
0
peanoclaw::repositories::RepositoryArrayStack::RepositoryArrayStack(
  peano::geometry::Geometry&                   geometry,
  int                                          maximumSizeOfCellInOutStack,
  int                                          maximumSizeOfVertexInOutStack,
  int                                          maximumSizeOfVertexTemporaryStack
):
  _geometry(geometry),
  _cellStack(maximumSizeOfCellInOutStack),
  _vertexStack(maximumSizeOfVertexInOutStack,maximumSizeOfVertexTemporaryStack),
  _solverState(),
  _gridWithInitialiseGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithInitialiseAndValidateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithPlot(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithPlotAndValidateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithRemesh(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithSolveTimestep(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithSolveTimestepAndValidateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithSolveTimestepAndPlot(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithSolveTimestepAndPlotAndValidateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithGatherCurrentSolution(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithGatherCurrentSolutionAndValidateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithCleanup(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),

  _repositoryState() {
  logTraceIn( "RepositoryArrayStack(Geometry&)" );
  
  _repositoryState.setAction( peanoclaw::records::RepositoryState::Terminate );

  peano::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(peanoclaw::records::RepositoryState::NumberOfAdapters);
  #ifdef Parallel
  peano::parallel::loadbalancing::Oracle::getInstance().setNumberOfOracles(peanoclaw::records::RepositoryState::NumberOfAdapters);
  #endif
  
  logTraceOut( "RepositoryArrayStack(Geometry&)" );
}
peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation::GridConstructionMovieBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(
  peano::geometry::Geometry&                   geometry,
  int                                          initialStackSize
):
  _geometry(geometry),
  _cellStack(initialStackSize),
  _vertexStack(initialStackSize),
  _solverState(),
  _gridWithPerformOneRefinement(_vertexStack,_cellStack,_geometry,_solverState),
  _gridWithPerformOneRefinementWithoutGridSnapshot(_vertexStack,_cellStack,_geometry,_solverState),

  _countPerformOneRefinementRuns(0),
  _countPerformOneRefinementWithoutGridSnapshotRuns(0),

  _measurePerformOneRefinementCPUTime(0.0),
  _measurePerformOneRefinementWithoutGridSnapshotCPUTime(0.0),

  _measurePerformOneRefinementCalendarTime(0.0),
  _measurePerformOneRefinementWithoutGridSnapshotCalendarTime(0.0),

  _repositoryState() {
  logTraceIn( "peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(Geometry&)" );

  _repositoryState.setAction( GridConstructionMovieBatchJobRepositoryState::Terminate );

  peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(2 +3);
  
  logTraceOut( "peano::applications::puregrid::repositories::GridConstructionMovieBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(Geometry&)" );
}
Пример #13
0
void dem::repositories::RepositorySTDStack::restart(
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  domainOffset,
  int                                          domainLevel,
  const tarch::la::Vector<DIMENSIONS,int>&     positionOfCentralElementWithRespectToCoarserRemoteLevel
) {
  logTraceInWith4Arguments( "restart(...)", domainSize, domainOffset, domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isGlobalMaster());
  #endif
  
  logInfo( "restart(...)", "start node for subdomain " << domainOffset << "x" << domainSize << " on level " << domainLevel << " with master " << tarch::parallel::NodePool::getInstance().getMasterRank() );
  
  assertion( _repositoryState.getAction() == dem::records::RepositoryState::Terminate );

  _vertexStack.clear();
  _cellStack.clear();

  _gridWithCreateGrid.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithCreateGridAndPlot.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStep.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStepAndPlot.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStepOnDynamicGrid.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStepAndPlotOnDynamicGrid.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStepOnReluctantDynamicGrid.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);
  _gridWithTimeStepAndPlotOnReluctantDynamicGrid.restart(domainSize,domainOffset,domainLevel, positionOfCentralElementWithRespectToCoarserRemoteLevel);


  _solverState.restart();

  logTraceOut( "restart(...)" );
}
Пример #14
0
dem::repositories::RepositorySTDStack::RepositorySTDStack(
  peano::geometry::Geometry&                   geometry
):
  _geometry(geometry),
  _cellStack(),
  _vertexStack(),
  _solverState(),
  _gridWithCreateGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithCreateGridAndPlot(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStep(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStepAndPlot(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStepOnDynamicGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStepAndPlotOnDynamicGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStepOnReluctantDynamicGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),
  _gridWithTimeStepAndPlotOnReluctantDynamicGrid(_vertexStack,_cellStack,_geometry,_solverState,_regularGridContainer,_traversalOrderOnTopLevel),

  _repositoryState() {
  logTraceIn( "RepositorySTDStack(Geometry&)" );

  _repositoryState.setAction( dem::records::RepositoryState::Terminate );
  
  peano::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(dem::records::RepositoryState::NumberOfAdapters);
  #ifdef Parallel
  peano::parallel::loadbalancing::Oracle::getInstance().setNumberOfOracles(dem::records::RepositoryState::NumberOfAdapters);
  #endif
  
  logTraceOut( "RepositorySTDStack(Geometry&)" );
}
void peano::applications::faxen::repositories::FaxenBatchJobRepositoryForSpacetreeGridArrayStackImplementation::restart(
  const tarch::la::Vector<DIMENSIONS,bool>&    evenFlags,
  const tarch::la::Vector<THREE_POWER_D,int>&  traversalOrderOfNeighbours,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  domainOffset,
  int                                          domainLevel
) {
  logTraceInWith2Arguments( "restart(...)", evenFlags, traversalOrderOfNeighbours );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
  #endif
  
  assertion( _repositoryState.getAction() == FaxenBatchJobRepositoryState::Terminate );

  _vertexStack.clear();
  _cellStack.clear();

  _gridWithInitialize.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithInitializeAndSetBoundary.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithPlotGrid.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithControlTimeStep.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetVelocitiesBoundary.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetScenarioBoundary.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithComputeVelocitiesDerivatives.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithComputeRightHandSide.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetZeroPressureBoundary.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSetPressureBoundary.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithSORStep.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithComputeResidualNorm.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithComputeVelocities.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithPlotSolution.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);

  logTraceOut( "restart(...)" );
}
Пример #16
0
void particles::pidt::mappings::Redistribute::prepareCopyToRemoteNode(
  particles::pidt::Vertex&                      localVertex,
  int                                           toRank,
  const tarch::la::Vector<DIMENSIONS,double>&   x,
  const tarch::la::Vector<DIMENSIONS,double>&   h,
  int                                           level
) {
  logTraceInWith5Arguments( "prepareCopyToRemoteNode(...)", localVertex, toRank, x, h, level );

  const ParticleContainer  destinationParticles = MoveParticles::extractAllParticlesFromDualCellBelongingToOneRank(
    localVertex.getVertexIndex(),
    localVertex,
    toRank,
    x,
    h
  );

  ParticleHeap::getInstance().sendData(
    destinationParticles,
    toRank,
    x,
    level,
    peano::heap::ForkOrJoinCommunication
  );

  logTraceOut( "prepareCopyToRemoteNode(...)" );
}
void peano::applications::faxen::repositories::FaxenBatchJobRepositoryForSpacetreeGridArrayStackImplementation::terminate() {
  logTraceIn( "terminate(...)" );
  
  _repositoryState.setAction( FaxenBatchJobRepositoryState::Terminate );
  
  #ifdef Parallel
  if (tarch::parallel::Node::getInstance().isMasterProcess()) {
    tarch::parallel::NodePool::getInstance().broadcastToWorkingNodes(
      _repositoryState,
      peano::kernel::parallel::SendReceiveBufferPool::getInstance().getIterationManagementTag()
    );
  }
  peano::kernel::parallel::SendReceiveBufferPool::getInstance().terminate();
  #endif
  
  _gridWithInitialize.terminate();
  _gridWithInitializeAndSetBoundary.terminate();
  _gridWithPlotGrid.terminate();
  _gridWithControlTimeStep.terminate();
  _gridWithSetVelocitiesBoundary.terminate();
  _gridWithSetScenarioBoundary.terminate();
  _gridWithComputeVelocitiesDerivatives.terminate();
  _gridWithComputeRightHandSide.terminate();
  _gridWithSetZeroPressureBoundary.terminate();
  _gridWithSetPressureBoundary.terminate();
  _gridWithSORStep.terminate();
  _gridWithComputeResidualNorm.terminate();
  _gridWithComputeVelocities.terminate();
  _gridWithPlotSolution.terminate();

  logTraceOut( "terminate()" );
}
peano::applications::navierstokes::prototype1::mappings::RegularGrid2UpdateVelocity::RegularGrid2UpdateVelocity()
  : _elementType(ELEMENT_TYPE_UNDEF)
{
  logTraceIn( "RegularGrid2UpdateVelocity()" );
  // @todo Insert your code here
  logTraceOut( "RegularGrid2UpdateVelocity()" );
}
peano::applications::faxen::lbf::mappings::RegularGrid2MoveParticles::~RegularGrid2MoveParticles() {
	logTraceIn( "~RegularGrid2MoveParticles()" );

	delete[] _cellVertices;

	logTraceOut( "~RegularGrid2MoveParticles()" );
}
peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridArrayStackImplementation::PrototypeRepositoryForSpacetreeGridArrayStackImplementation(
  peano::geometry::Geometry&                   geometry,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  domainOffset,
  int                                          maximumSizeOfCellInOutStack,
  int                                          maximumSizeOfVertexInOutStack,
  int                                          maximumSizeOfVertexTemporaryStack
):
  _geometry(geometry),
  _cellStack(maximumSizeOfCellInOutStack),
  _vertexStack(maximumSizeOfVertexInOutStack, maximumSizeOfVertexTemporaryStack),
  _solverState(),




  _repositoryState() {
  logTraceIn( "peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridArrayStackImplementation(...)" );
  
  _repositoryState.setAction( PrototypeRepositoryState::Terminate );

  peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(0);
  
  logTraceOut( "peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridArrayStackImplementation(...)" );
}
Пример #21
0
void pyclaw_peano_evolveToTime(double time, peanoclaw::runners::PeanoClawLibraryRunner* runner) {
  #ifdef USE_VALGRIND
  CALLGRIND_START_INSTRUMENTATION;
  CALLGRIND_ZERO_STATS;
  #endif

  static tarch::logging::Log _log("::pyclawBindings");
  logTraceInWith1Argument("pyclaw_peano_evolveToTime", time);
  assertionMsg(runner!=0, "call pyclaw_peano_new before calling pyclaw_peano_run.");

  if(_calledFromPython) {
    _pythonState = PyGILState_Ensure();
  }

  runner->evolveToTime(time);

  if(_calledFromPython) {
    PyGILState_Release(_pythonState);
  }

  #ifdef USE_VALGRIND
  CALLGRIND_STOP_INSTRUMENTATION;
  #endif
  logTraceOut("pyclaw_peano_evolveToTime");
}
void peano::applications::navierstokes::prototype1::repositories::PrototypeRepositoryForRegularGridStandardImplementation::restart(
  const tarch::la::Vector<DIMENSIONS,int>&     numberOfGridPoints,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  computationalDomainOffset,
  const tarch::la::Vector<TWO_POWER_D_TIMES_TWO_POWER_D,int>&  neighbourRanks
) {
  logTraceInWith3Arguments( "restart(...)", numberOfGridPoints, domainSize, computationalDomainOffset );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
  #endif
  
  assertion( _repositoryState.getAction() == PrototypeRepositoryState::Terminate );

  #ifdef Parallel
  _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset,neighbourRanks);
  #else
  _gridContainer.restart( numberOfGridPoints,domainSize,computationalDomainOffset);
  #endif

  _gridWithInitialiseScenario.restart(domainSize,computationalDomainOffset);
  _gridWithMergeA.restart(domainSize,computationalDomainOffset);
  _gridWithCalculateF.restart(domainSize,computationalDomainOffset);
  _gridWithCalculatePPERHS.restart(domainSize,computationalDomainOffset);
  _gridWithGaussSeidelForEnhancedDivFree.restart(domainSize,computationalDomainOffset);
  _gridWithUpdateVelocity.restart(domainSize,computationalDomainOffset);
  _gridWithPlotSolutionVTK.restart(domainSize,computationalDomainOffset);
  _gridWithPlotRegularSolutionVTK.restart(domainSize,computationalDomainOffset);
  _gridWithUpdateScenario.restart(domainSize,computationalDomainOffset);

  logTraceOut( "restart(...)" );
}
Пример #23
0
void peano::applications::poisson::jacobitutorial::mappings::RegularGrid2PlotSolution::handleCell(
  peano::applications::poisson::jacobitutorial::RegularGridVertex* const vertices,
  peano::applications::poisson::jacobitutorial::RegularGridCell&  cell,
  const peano::kernel::gridinterface::VertexEnumerator&  enumerator
) {
  logTraceInWith2Arguments( "handleCell()", enumerator.toString(), cell );

  /**
   * --- inserted manually ---
   *
   * This is just cell plot mechanics. As the cells have no properties, it is
   * exactly the same what the grid plotter which is generated does.
   */
  tarch::multicore::Lock localLock( _outputStreamSemaphore );

  assertion( DIMENSIONS==2 || DIMENSIONS==3 );
  int vertexIndex[TWO_POWER_D];
  dfor2(i)
    tarch::la::Vector<DIMENSIONS,double> currentVertexPosition = enumerator.getVertexPosition(i);
    assertion1 ( _vertex2IndexMap.find(currentVertexPosition) != _vertex2IndexMap.end(), currentVertexPosition );
    vertexIndex[iScalar] = _vertex2IndexMap[currentVertexPosition];
  enddforx

  if (DIMENSIONS==2) {
    _cellWriter->plotQuadrangle(vertexIndex);
  }
  if (DIMENSIONS==3) {
    _cellWriter->plotHexahedron(vertexIndex);
  }

  logTraceOut( "handleCell()" );
}
void peano::applications::navierstokes::prototype1::repositories::PrototypeRepositoryForRegularGridStandardImplementation::terminate() {
  logTraceIn( "terminate(...)" );
  
  _repositoryState.setAction( PrototypeRepositoryState::Terminate );
  
  #ifdef Parallel
  if (tarch::parallel::Node::getInstance().isMasterProcess()) {
    tarch::parallel::NodePool::getInstance().broadcastToWorkingNodes(
      _repositoryState,
      peano::kernel::parallel::SendReceiveBufferPool::getInstance().getIterationManagementTag()
    );
  }
  peano::kernel::parallel::SendReceiveBufferPool::getInstance().terminate();
  #endif
  
  _gridContainer.terminate();
  _gridWithInitialiseScenario.terminate();
  _gridWithMergeA.terminate();
  _gridWithCalculateF.terminate();
  _gridWithCalculatePPERHS.terminate();
  _gridWithGaussSeidelForEnhancedDivFree.terminate();
  _gridWithUpdateVelocity.terminate();
  _gridWithPlotSolutionVTK.terminate();
  _gridWithPlotRegularSolutionVTK.terminate();
  _gridWithUpdateScenario.terminate();

  logTraceOut( "terminate()" );
}
peano::applications::poisson::vhhjacobi::repositories::JacobiBatchJobRepositoryForRegularGridStandardImplementation::JacobiBatchJobRepositoryForRegularGridStandardImplementation(
    peano::geometry::Geometry&                   geometry
):
    _geometry(geometry),
    _gridContainer(),
    _gridWithSetupExperiment(_gridContainer,_geometry, _solverState),
    _gridWithJacobiStep(_gridContainer,_geometry, _solverState),
    _gridWithJacobiStepAndPlotSolution(_gridContainer,_geometry, _solverState),
    _gridWithPlotSolution(_gridContainer,_geometry, _solverState),

    _countSetupExperimentRuns(0),
    _countJacobiStepRuns(0),
    _countJacobiStepAndPlotSolutionRuns(0),
    _countPlotSolutionRuns(0),

    _measureSetupExperimentCPUTime(0.0),
    _measureJacobiStepCPUTime(0.0),
    _measureJacobiStepAndPlotSolutionCPUTime(0.0),
    _measurePlotSolutionCPUTime(0.0),

    _measureSetupExperimentCalendarTime(0.0),
    _measureJacobiStepCalendarTime(0.0),
    _measureJacobiStepAndPlotSolutionCalendarTime(0.0),
    _measurePlotSolutionCalendarTime(0.0),

    _solverState(),
    _repositoryState() {
    logTraceIn( "peano::applications::poisson::vhhjacobi::repositories::JacobiBatchJobRepositoryForRegularGridStandardImplementation(Geometry&)" );

    _repositoryState.setAction( JacobiBatchJobRepositoryState::Terminate );

    peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(4 +3 );

    logTraceOut( "peano::applications::poisson::vhhjacobi::repositories::JacobiBatchJobRepositoryForRegularGridStandardImplementation(Geometry&)" );
}
Пример #26
0
void peanoclaw::interSubgridCommunication::GridLevelTransfer::updatePatchStateDuringMergeWithWorker(
  int localCellDescriptionIndex,
  int remoteCellDescriptionIndex
) {
  logTraceInWith1Argument("updatePatchStateDuringMergeWithWorker", localCellDescriptionIndex);

  assertion(localCellDescriptionIndex != -1);
  CellDescription& localCellDescription = CellDescriptionHeap::getInstance().getData(localCellDescriptionIndex).at(0);
  Patch localPatch(localCellDescription);

  if(remoteCellDescriptionIndex != -1) {
    CellDescription& remoteCellDescription = CellDescriptionHeap::getInstance().getData(remoteCellDescriptionIndex).at(0);

    assertion1(localCellDescriptionIndex != -1, localPatch);
    if(remoteCellDescription.getUIndex() != -1) {
      assertion1(localPatch.isVirtual() || localPatch.isLeaf(), localPatch);

      //Delete current content of patch
      DataHeap::getInstance().deleteData(localPatch.getUIndex());

      //Merge
      localCellDescription.setUIndex(remoteCellDescription.getUIndex());
    }

    CellDescriptionHeap::getInstance().deleteData(remoteCellDescriptionIndex);
  }

  logTraceOut("updatePatchStateDuringMergeWithWorker");
}
Пример #27
0
void peano::applications::heatequation::timestepping::adapters::SpacetreeGrid2PlotGrid::beginIteration(
  peano::applications::heatequation::timestepping::SpacetreeGridState&  solverState
) {
  logTraceInWith1Argument( "beginIteration(...)", solverState );


  #ifdef SharedTBB
  Vertex2IndexMapSemaphore::scoped_lock localLock(_vertex2IndexMapSemaphore);
  #elif SharedOMP
  #pragma omp critical
  #endif
  
  _vtkWriter.clear();
  
  _vertexWriter     = _vtkWriter.createVertexWriter();
  _cellWriter       = _vtkWriter.createCellWriter();
  
  #ifdef Parallel
  _cellDeltaWriter  = _vtkWriter.createCellDataWriter( "delta" ,1);
  _cellWeightWriter = _vtkWriter.createCellDataWriter( "weight" ,1);
  #endif
  
  _vertexTypeWriter               = _vtkWriter.createVertexDataWriter(peano::applications::heatequation::timestepping::SpacetreeGridSingleStepVertex::Records::getInsideOutsideDomainMapping() ,1);
  _vertexRefinementControlWriter  = _vtkWriter.createVertexDataWriter(peano::applications::heatequation::timestepping::SpacetreeGridSingleStepVertex::Records::getRefinementControlMapping() ,1);
  _vertexMaximumSubtreeWriter     = _vtkWriter.createVertexDataWriter("max-subtree" ,1);




  logTraceOut( "beginIteration(...)" );
}
peano::applications::pic::demo::repositories::PICBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation::PICBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(
  peano::geometry::Geometry&                   geometry,
  int                                          initialStackSize
):
  _geometry(geometry),
  _cellStack(initialStackSize),
  _vertexStack(initialStackSize),
  _solverState(),
  _gridWithSetupExperiment(_vertexStack,_cellStack,_geometry,_solverState),
  _gridWithSetupExperimentAndPlot(_vertexStack,_cellStack,_geometry,_solverState),

  _countSetupExperimentRuns(0),
  _countSetupExperimentAndPlotRuns(0),

  _measureSetupExperimentCPUTime(0.0),
  _measureSetupExperimentAndPlotCPUTime(0.0),

  _measureSetupExperimentCalendarTime(0.0),
  _measureSetupExperimentAndPlotCalendarTime(0.0),

  _repositoryState() {
  logTraceIn( "peano::applications::pic::demo::repositories::PICBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(Geometry&)" );

  _repositoryState.setAction( PICBatchJobRepositoryState::Terminate );

  peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(2 +3);
  
  logTraceOut( "peano::applications::pic::demo::repositories::PICBatchJobRepositoryForSpacetreeGridSTDDoubleStackImplementation(Geometry&)" );
}
void peano::applications::latticeboltzmann::blocklatticeboltzmann::repositories::BlockLatticeBoltzmannBatchJobRepositoryForSpacetreeGridSTDStackImplementation::restart(
  const tarch::la::Vector<DIMENSIONS,bool>&    evenFlags,
  const tarch::la::Vector<THREE_POWER_D,int>&  traversalOrderOfNeighbours,
  const tarch::la::Vector<DIMENSIONS,double>&  domainSize,
  const tarch::la::Vector<DIMENSIONS,double>&  domainOffset,
  int                                          domainLevel
) {
  logTraceInWith2Arguments( "restart(...)", evenFlags, traversalOrderOfNeighbours );
  #ifdef Parallel
  assertion( !tarch::parallel::Node::getInstance().isMasterProcess());
  #endif
  
  assertion( _repositoryState.getAction() == BlockLatticeBoltzmannBatchJobRepositoryState::Terminate );

  _vertexStack.clear();
  _cellStack.clear();

  _gridWithRegularBlockSolverAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithInitialiseSpacetreeGridAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithBlockCCAOutputAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithDynamicRefinementForSpacetreeGridAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithBlockVTKOutputAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);
  _gridWithRegularBlockSolverAndVTKOutputAdapter.restart(traversalOrderOfNeighbours,_solverState,domainSize,domainOffset,domainLevel);

  logTraceOut( "restart(...)" );
}
peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridFileStackImplementation::PrototypeRepositoryForSpacetreeGridFileStackImplementation(
  peano::geometry::Geometry&                   geometry,
  int                                          blockSize,
  int                                          numberOfBlocks,
  int                                          minFillThreshold,
  int                                          maxFillThreshold,
  const std::string&                           tempFilePrefix    
):
  _geometry(geometry),
  _cellStack(blockSize,numberOfBlocks,minFillThreshold,maxFillThreshold,tempFilePrefix),
  _vertexStack(blockSize,numberOfBlocks,minFillThreshold,maxFillThreshold,tempFilePrefix),
  _solverState(),




  _repositoryState() {
  logTraceIn( "peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridFileStackImplementation(Geometry&)" );

  _repositoryState.setAction( PrototypeRepositoryState::Terminate );

  peano::kernel::datatraversal::autotuning::Oracle::getInstance().setNumberOfOracles(0);

  logTraceOut( "peano::applications::navierstokes::prototype2::repositories::PrototypeRepositoryForSpacetreeGridFileStackImplementation(Geometry&)" );
}