Skip to content

Commit

Permalink
feat: Add freeOnDevice calls on Wave Propagation Solvers (#2610)
Browse files Browse the repository at this point in the history
* Add freeOnDevice calls

* Update LvArray submodule

* Revert "Update LvArray submodule"

This reverts commit bb15aae.

* Update LvArray submodule

* add FreeOnDevice for Array

* adding freeOnDevice for wavePropagation sovlers

* add freeOnDevice function to AcousticFirstOrderWaveEquationSEM

* udpate LvArray version

* added freeOnDevice calls to all other wave solvers

* uncrustify

---------

Co-authored-by: Stefano Frambati <[email protected]>
Co-authored-by: Jie Meng <[email protected]>
Co-authored-by: j0405284 <[email protected]>
  • Loading branch information
4 people authored Oct 7, 2024
1 parent a493b12 commit 769dd04
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,20 @@ void AcousticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLev
m_timeSourceDelay,
m_rickerOrder );
} );
elementSubRegion.faceList().freeOnDevice();
baseMesh.getElemManager().getRegion( regionIndex ).getSubRegion< CellElementSubRegion >( esr ).nodeList().freeOnDevice();
elementSubRegion.getElementCenter().freeOnDevice();
elementSubRegion.ghostRank().freeOnDevice();
elementSubRegion.localToGlobalMap().freeOnDevice();
} );

baseMesh.getNodeManager().localToGlobalMap().freeOnDevice();
baseMesh.getNodeManager().elementList().toView().freeOnDevice();
baseMesh.getFaceManager().nodeList().toView().freeOnDevice();
baseMesh.getNodeManager().referencePosition().freeOnDevice();
m_sourceCoordinates.freeOnDevice();
m_receiverCoordinates.freeOnDevice();
facesToNodes.freeOnDevice();
nodesToElements.freeOnDevice();
}

void AcousticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGroups()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,20 @@ void AcousticVTIWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & ba
m_timeSourceDelay,
m_rickerOrder );
} );
elementSubRegion.faceList().freeOnDevice();
baseMesh.getElemManager().getRegion( er ).getSubRegion< CellElementSubRegion >( esr ).nodeList().freeOnDevice();
elementSubRegion.getElementCenter().freeOnDevice();
elementSubRegion.ghostRank().freeOnDevice();
elementSubRegion.localToGlobalMap().freeOnDevice();
} );
baseMesh.getNodeManager().localToGlobalMap().freeOnDevice();
baseMesh.getNodeManager().elementList().toView().freeOnDevice();
baseMesh.getFaceManager().nodeList().toView().freeOnDevice();
baseMesh.getNodeManager().referencePosition().freeOnDevice();
m_sourceCoordinates.freeOnDevice();
m_receiverCoordinates.freeOnDevice();
facesToNodes.freeOnDevice();
nodesToElements.freeOnDevice();
}

void AcousticVTIWaveEquationSEM::addSourceToRightHandSide( integer const & cycleNumber, arrayView1d< real32 > const rhs )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,20 @@ void AcousticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseM
m_rickerOrder );
}
} );
elementSubRegion.faceList().freeOnDevice();
baseMesh.getElemManager().getRegion( er ).getSubRegion< CellElementSubRegion >( esr ).nodeList().freeOnDevice();
elementSubRegion.getElementCenter().freeOnDevice();
elementSubRegion.ghostRank().freeOnDevice();
elementSubRegion.localToGlobalMap().freeOnDevice();
} );
baseMesh.getNodeManager().localToGlobalMap().freeOnDevice();
baseMesh.getNodeManager().elementList().toView().freeOnDevice();
baseMesh.getFaceManager().nodeList().toView().freeOnDevice();
baseMesh.getNodeManager().referencePosition().freeOnDevice();
m_sourceCoordinates.freeOnDevice();
m_receiverCoordinates.freeOnDevice();
facesToNodes.freeOnDevice();
nodesToElements.freeOnDevice();
}

void AcousticWaveEquationSEM::addSourceToRightHandSide( integer const & cycleNumber, arrayView1d< real32 > const rhs )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,20 @@ void ElasticFirstOrderWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLeve
m_timeSourceDelay,
m_rickerOrder );
} );
elementSubRegion.faceList().freeOnDevice();
baseMesh.getElemManager().getRegion( regionIndex ).getSubRegion< CellElementSubRegion >( esr ).nodeList().freeOnDevice();
elementSubRegion.getElementCenter().freeOnDevice();
elementSubRegion.ghostRank().freeOnDevice();
elementSubRegion.localToGlobalMap().freeOnDevice();
} );
baseMesh.getNodeManager().localToGlobalMap().freeOnDevice();
baseMesh.getNodeManager().elementList().toView().freeOnDevice();
baseMesh.getFaceManager().nodeList().toView().freeOnDevice();
baseMesh.getNodeManager().referencePosition().freeOnDevice();
m_sourceCoordinates.freeOnDevice();
m_receiverCoordinates.freeOnDevice();
facesToNodes.freeOnDevice();
nodesToElements.freeOnDevice();
}

void ElasticFirstOrderWaveEquationSEM::initializePostInitialConditionsPreSubGroups()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,20 @@ void ElasticWaveEquationSEM::precomputeSourceAndReceiverTerm( MeshLevel & baseMe
m_sourceForce,
m_sourceMoment );
} );
elementSubRegion.faceList().freeOnDevice();
baseMesh.getElemManager().getRegion( er ).getSubRegion< CellElementSubRegion >( esr ).nodeList().freeOnDevice();
elementSubRegion.getElementCenter().freeOnDevice();
elementSubRegion.ghostRank().freeOnDevice();
elementSubRegion.localToGlobalMap().freeOnDevice();
} );
baseMesh.getNodeManager().localToGlobalMap().freeOnDevice();
baseMesh.getNodeManager().elementList().toView().freeOnDevice();
baseMesh.getFaceManager().nodeList().toView().freeOnDevice();
baseMesh.getNodeManager().referencePosition().freeOnDevice();
m_sourceCoordinates.freeOnDevice();
m_receiverCoordinates.freeOnDevice();
facesToNodes.freeOnDevice();
nodesToElements.freeOnDevice();
}

void ElasticWaveEquationSEM::addSourceToRightHandSide( integer const & cycleNumber,
Expand Down

0 comments on commit 769dd04

Please sign in to comment.