| 497 | } |
| 498 | |
| 499 | void seissol::initializer::MemoryManager::fixateLtsTree(struct TimeStepping& i_timeStepping, |
| 500 | struct MeshStructure*i_meshStructure, |
| 501 | unsigned* numberOfDRCopyFaces, |
| 502 | unsigned* numberOfDRInteriorFaces, |
| 503 | bool usePlasticity) { |
| 504 | // store mesh structure and the number of time clusters |
| 505 | m_meshStructure = i_meshStructure; |
| 506 | |
| 507 | // Setup tree variables |
| 508 | m_lts.addTo(m_ltsTree, usePlasticity); |
| 509 | seissolInstance.postProcessor().allocateMemory(&m_ltsTree); |
| 510 | m_ltsTree.setNumberOfTimeClusters(i_timeStepping.numberOfLocalClusters); |
| 511 | |
| 512 | /// From this point, the tree layout, variables, and buckets cannot be changed anymore |
| 513 | m_ltsTree.fixate(); |
| 514 | |
| 515 | // Set number of cells and bucket sizes in ltstree |
| 516 | for (unsigned tc = 0; tc < m_ltsTree.numChildren(); ++tc) { |
| 517 | TimeCluster& cluster = m_ltsTree.child(tc); |
| 518 | cluster.child<Ghost>().setNumberOfCells(i_meshStructure[tc].numberOfGhostCells); |
| 519 | cluster.child<Copy>().setNumberOfCells(i_meshStructure[tc].numberOfCopyCells); |
| 520 | cluster.child<Interior>().setNumberOfCells(i_meshStructure[tc].numberOfInteriorCells); |
| 521 | } |
| 522 | |
| 523 | m_ltsTree.allocateVariables(); |
| 524 | m_ltsTree.touchVariables(); |
| 525 | |
| 526 | /// Dynamic rupture tree |
| 527 | m_dynRup->addTo(m_dynRupTree); |
| 528 | |
| 529 | m_dynRupTree.setNumberOfTimeClusters(i_timeStepping.numberOfGlobalClusters); |
| 530 | m_dynRupTree.fixate(); |
| 531 | |
| 532 | for (unsigned tc = 0; tc < m_dynRupTree.numChildren(); ++tc) { |
| 533 | TimeCluster& cluster = m_dynRupTree.child(tc); |
| 534 | cluster.child<Ghost>().setNumberOfCells(0); |
| 535 | if (tc >= i_timeStepping.numberOfLocalClusters) { |
| 536 | cluster.child<Copy>().setNumberOfCells(0); |
| 537 | cluster.child<Interior>().setNumberOfCells(0); |
| 538 | } else { |
| 539 | cluster.child<Copy>().setNumberOfCells(numberOfDRCopyFaces[tc]); |
| 540 | cluster.child<Interior>().setNumberOfCells(numberOfDRInteriorFaces[tc]); |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | m_dynRupTree.allocateVariables(); |
| 545 | m_dynRupTree.touchVariables(); |
| 546 | |
| 547 | #ifdef ACL_DEVICE |
| 548 | MemoryManager::deriveRequiredScratchpadMemoryForDr(m_dynRupTree, *m_dynRup.get()); |
| 549 | m_dynRupTree.allocateScratchPads(); |
| 550 | #endif |
| 551 | } |
| 552 | |
| 553 | void seissol::initializer::MemoryManager::fixateBoundaryLtsTree() { |
| 554 | seissol::initializer::LayerMask ghostMask(Ghost); |
no test coverage detected