PPL Logo

ParFUMShadowArray Class Reference

#include <ParFUM_SA.h>

Inheritance diagram for ParFUMShadowArray:

Inheritance graph
[legend]
Collaboration diagram for ParFUMShadowArray:

Collaboration graph
[legend]

Public Member Functions

 ParFUMShadowArray (int s, int i)
 constructor
 ParFUMShadowArray (CkMigrateMessage *m)
 constructor for migration
 ~ParFUMShadowArray ()
 destructor
void pup (PUP::er &p)
 Pup to transfer this object's data.
void ckJustMigrated (void)
 This function is overloaded, it is called on this object just after migration.
int getNumChunks ()
 Get number of chunks.
int getIdx ()
 Get the index of this chunk.
FEM_MeshgetfmMesh ()
 Get the pointer to the mesh object.
void setFemMesh (FEMMeshMsg *m)
 Initialize the mesh pointer for this chunk.
void setRunningTCharm ()
void sort (int *chkList, int chkListSize)
 Sort this list of numbers in increasing order.
int lockRegion (int numElements, adaptAdj *elements, RegionID *regionID, double prio)
 This method locks all the nodes belonging to the specified elements.
void unlockRegion (RegionID regionID)
void unpendRegion (RegionID regionID)
void collectLocalNodes (int numElements, adaptAdj *elements, CkVec< int > &localNodes)
 Find all the local nodes in the connectivity of the list of elements and store it in the vector localNodes.
bool lockLocalNodes (LockRegion *region)
bool lockSharedIdxls (LockRegion *region)
 Lock the sharedidxls specified in the region.
void lockRegionForRemote (RegionID regionID, int *sharedIdxls, int numSharedIdxls, adaptAdj *elements, int numElements)
 Process a request from another chunk to lock these idxls and the nodes belonging to these elements.
void lockReply (int remoteChunk, RegionID regionID, int success, int tag, int otherSuccess)
 Collect the replies from all the remote chunks that were requested to lock regions of the mesh.
void unlockRegion (LockRegion *region)
 Free up all the local nodes, idxl and elements on remote chunk locked by this node.
void unlockLocalNodes (LockRegion *region)
void unlockSharedIdxls (LockRegion *region)
 Unlock all the shared idxl on this chunk.
void unlockForRemote (RegionID regionID)
 Unlock the local nodes and sharedIdxls locked for the remote region specified by regionID.
void unpendForRemote (RegionID regionID)
void unlockReply (int remoteChunk, RegionID regionID)
 Collect the replies to unlock requests from all the chunks that are involved in this region.
void freeRegion (LockRegion *region)
FEM_CommFindIdxlSide (int idxlType)
 Translates the sharedChk and the idxlType to the idxl side.
int IdxlAddPrimary (int localId, int sharedChk, int idxlType)
 Add this 'localId' to this idxl list and return the shared entry index.
bool IdxlAddSecondary (int localId, int sharedChk, int sharedIdx, int idxlType)
 Add this 'sharedIdx' to this idxl list.
int IdxlRemovePrimary (int localId, int sharedChk, int idxlType)
 Remove this 'localId' from this idxl list and return the shared entry index.
bool IdxlRemoveSecondary (int sharedChk, int sharedIdx, int idxlType)
 Remove the entry in this idxl list at index 'sharedIdx'.
int IdxlLookUpPrimary (int localId, int sharedChk, int idxlType)
 Lookup this 'localId' in this idxl list and return the shared entry index.
int IdxlLookUpSecondary (int sharedChk, int sharedIdx, int idxlType)
 Return the localIdx at this 'sharedIdx' on this idxl list.
adaptAdjMsgremote_bulk_edge_bisect_2D (adaptAdj &nbrElem, adaptAdj &splitElem, int new_idxl, int n1_idxl, int n2_idxl, int partitionID)
 These are entry methods for bulk adaptivity.
void remote_adaptAdj_replace (adaptAdj &elem, adaptAdj &oldElem, adaptAdj &newElem)
void remote_edgeAdj_replace (int remotePartID, adaptAdj &adj, adaptAdj &elem, adaptAdj &splitElem, int n1_idxl, int n2_idxl)
void remote_edgeAdj_add (int remotePartID, adaptAdj &adj, adaptAdj &splitElem, int n1_idxl, int n2_idxl)
void recv_split_3D (int pos, int tableID, adaptAdj &elem, adaptAdj &splitElem)
void handle_split_3D (int remotePartID, int pos, int tableID, adaptAdj &elem, RegionID lockRegionID, int n1_idxl, int n2_idxl, int n5_idxl)
void recv_splits (int tableID, int expectedSplits)
longestMsgisLongest (int elem, int elemType, double len)
void update_asterisk_3D (int remotePartID, int i, adaptAdj &elem, int numElemPairs, adaptAdj *elemPairs, RegionID lockRegionID, int n1_idxl, int n2_idxl, int n5_idxl)

Data Fields

BulkAdaptbulkAdapt
RegionID holdingLock
RegionID pendingLock

Private Attributes

int numChunks
 Total number of chunks.
int idx
 Index of this chunk (the chunk this is attached to).
TCharmtc
 The Tcharm pointer to set it even outside the thread..
CProxy_TCharm tproxy
 The proxy for the current Tcharm object.
FEM_MeshfmMesh
 cross-pointer to the fem mesh on this chunk
CkHashtableT
< CkHashtableAdaptorT
< RegionID >, LockRegion * > 
regionTable
 Deprecated: used to lock this chunk.
int regionCount

Detailed Description

Definition at line 68 of file ParFUM_SA.h.


Constructor & Destructor Documentation

ParFUMShadowArray::ParFUMShadowArray ( int  s,
int  i 
)

constructor

Definition at line 55 of file ParFUM_SA.C.

References fmMesh, holdingLock, idx, RegionID::localID, numChunks, pendingLock, and regionCount.

ParFUMShadowArray::ParFUMShadowArray ( CkMigrateMessage m  ) 

constructor for migration

Definition at line 64 of file ParFUM_SA.C.

References fmMesh, RegionID::localID, pendingLock, regionCount, and tc.

ParFUMShadowArray::~ParFUMShadowArray (  ) 

destructor

Definition at line 71 of file ParFUM_SA.C.


Member Function Documentation

void ParFUMShadowArray::pup ( PUP::er p  ) 

Pup to transfer this object's data.

Definition at line 75 of file ParFUM_SA.C.

References idx, numChunks, and tproxy.

void ParFUMShadowArray::ckJustMigrated ( void   ) 

This function is overloaded, it is called on this object just after migration.

Definition at line 82 of file ParFUM_SA.C.

References c, ArrayElement::ckJustMigrated(), FEM_globalID, fmMesh, FEM_chunk::getMesh(), idx, FEM_Mesh::setParfumSA(), TCharm::sud, tc, and tproxy.

Here is the call graph for this function:

int ParFUMShadowArray::getNumChunks (  )  [inline]

Get number of chunks.

Definition at line 103 of file ParFUM_SA.h.

References numChunks.

int ParFUMShadowArray::getIdx (  )  [inline]

Get the index of this chunk.

Definition at line 105 of file ParFUM_SA.h.

References idx.

FEM_Mesh* ParFUMShadowArray::getfmMesh (  )  [inline]

Get the pointer to the mesh object.

Definition at line 107 of file ParFUM_SA.h.

References fmMesh.

void ParFUMShadowArray::setFemMesh ( FEMMeshMsg m  ) 

Initialize the mesh pointer for this chunk.

Definition at line 91 of file ParFUM_SA.C.

References bulkAdapt, fmMesh, TCharm::getProxy(), idx, FEMMeshMsg::m, FEMMeshMsg::meshid, FEM_Mesh::setParfumSA(), FEMMeshMsg::t, tc, and tproxy.

Here is the call graph for this function:

void ParFUMShadowArray::setRunningTCharm (  )  [inline]

Definition at line 112 of file ParFUM_SA.h.

References tc.

Referenced by BulkAdapt::add_element(), and BulkAdapt::add_node().

Here is the caller graph for this function:

void ParFUMShadowArray::sort ( int chkList,
int  chkListSize 
)

Sort this list of numbers in increasing order.

Helper function that uses bubble sort to sort the indices in the given array in increasing order These lists are usually small, so bubble sort is good enough.

Definition at line 104 of file ParFUM_SA.C.

int ParFUMShadowArray::lockRegion ( int  numElements,
adaptAdj elements,
RegionID regionID,
double  prio 
)

void ParFUMShadowArray::unlockRegion ( RegionID  regionID  ) 

void ParFUMShadowArray::unpendRegion ( RegionID  regionID  ) 

void ParFUMShadowArray::collectLocalNodes ( int  numElements,
adaptAdj elements,
CkVec< int > &  localNodes 
)

Find all the local nodes in the connectivity of the list of elements and store it in the vector localNodes.

Definition at line 342 of file ParFUM_SA.C.

References conn, elem, adaptAdj::elemType, fmMesh, FEM_Mesh::getElem(), idx, FEM_Adapt_Algs::numNodes, CkVec< T >::push_back(), and uniquify().

Referenced by lockRegion().

Here is the call graph for this function:

Here is the caller graph for this function:

bool ParFUMShadowArray::lockLocalNodes ( LockRegion region  ) 

Definition at line 369 of file ParFUM_SA.C.

References RegionID::chunkID, fmMesh, CkVec< T >::length(), RegionID::localID, LockRegion::localNodes, FEM_Entity::lookup(), LockRegion::myID, and FEM_Mesh::node.

Here is the call graph for this function:

bool ParFUMShadowArray::lockSharedIdxls ( LockRegion region  ) 

Lock the sharedidxls specified in the region.

If idx < chunkID of shared idxl, lock the idxl with chunkID on this chunk If we cant lock all the idxls we need to, clean up the locked ones and return false

Definition at line 399 of file ParFUM_SA.C.

References fmMesh, IDXL_Side::getIdxlListN(), idx, IDXL_List::isLocked(), CkVec< T >::length(), list, IDXL_List::lockIdxl(), FEM_Mesh::node, FEM_Node::shared, LockRegion::sharedIdxls, and IDXL_List::unlockIdxl().

Here is the call graph for this function:

void ParFUMShadowArray::lockRegionForRemote ( RegionID  regionID,
int sharedIdxls,
int  numSharedIdxls,
adaptAdj elements,
int  numElements 
)

Process a request from another chunk to lock these idxls and the nodes belonging to these elements.

Definition at line 436 of file ParFUM_SA.C.

References RegionID::chunkID, hasGreaterPrio(), holdingLock, idx, RegionID::localID, LockRegion::myID, pendingLock, RegionID::prio, CkHashtableTslow< KEY, OBJ >::put(), regionTable, and tag.

Here is the call graph for this function:

void ParFUMShadowArray::lockReply ( int  remoteChunk,
RegionID  regionID,
int  foosuccess,
int  tag,
int  otherSuccess 
)

Collect the replies from all the remote chunks that were requested to lock regions of the mesh.

If all chunks reply that they have locked successfully, then we just wake up the thread waiting for this region to lock. If some chunks fail, we need to unlock the region before replying

Definition at line 565 of file ParFUM_SA.C.

References RegionID::chunkID, CthAwaken(), CkHashtableT< KEY, OBJ >::get(), RegionID::localID, LockRegion::numReplies, RegionID::prio, regionTable, LockRegion::sharedIdxls, CkVec< T >::size(), LockRegion::success, LockRegion::tid, and unlockRegion().

Here is the call graph for this function:

void ParFUMShadowArray::unlockRegion ( LockRegion region  ) 

Free up all the local nodes, idxl and elements on remote chunk locked by this node.

Definition at line 644 of file ParFUM_SA.C.

References idx, CkVec< T >::length(), LockRegion::myID, LockRegion::numReplies, and LockRegion::sharedIdxls.

Here is the call graph for this function:

void ParFUMShadowArray::unlockLocalNodes ( LockRegion region  ) 

void ParFUMShadowArray::unlockSharedIdxls ( LockRegion region  ) 

Unlock all the shared idxl on this chunk.

Definition at line 677 of file ParFUM_SA.C.

References CmiAbort(), fmMesh, IDXL_Side::getIdxlListN(), idx, IDXL_List::isLocked(), CkVec< T >::length(), list, FEM_Mesh::node, FEM_Node::shared, LockRegion::sharedIdxls, and IDXL_List::unlockIdxl().

Here is the call graph for this function:

void ParFUMShadowArray::unlockForRemote ( RegionID  regionID  ) 

Unlock the local nodes and sharedIdxls locked for the remote region specified by regionID.

We need to send an ack back

Definition at line 697 of file ParFUM_SA.C.

References RegionID::chunkID, CkHashtableT< KEY, OBJ >::get(), holdingLock, idx, RegionID::localID, pendingLock, RegionID::prio, regionTable, and CkHashtableTslow< KEY, OBJ >::remove().

Here is the call graph for this function:

void ParFUMShadowArray::unpendForRemote ( RegionID  regionID  ) 

Definition at line 609 of file ParFUM_SA.C.

References RegionID::chunkID, CkHashtableT< KEY, OBJ >::get(), holdingLock, idx, RegionID::localID, pendingLock, regionTable, and CkHashtableTslow< KEY, OBJ >::remove().

Here is the call graph for this function:

void ParFUMShadowArray::unlockReply ( int  remoteChunk,
RegionID  regionID 
)

Collect the replies to unlock requests from all the chunks that are involved in this region.

Once all the chunks have replied wake up the calling thread

Definition at line 719 of file ParFUM_SA.C.

References CthAwaken(), CkHashtableT< KEY, OBJ >::get(), CkVec< T >::length(), LockRegion::numReplies, regionTable, LockRegion::sharedIdxls, and LockRegion::tid.

Here is the call graph for this function:

void ParFUMShadowArray::freeRegion ( LockRegion region  ) 

FEM_Comm * ParFUMShadowArray::FindIdxlSide ( int  idxlType  ) 

Translates the sharedChk and the idxlType to the idxl side.

Helper function that translates the sharedChk and idxlType to the corresponding idxl_Side (FEM_Comm).

Definition at line 732 of file ParFUM_SA.C.

References FEM_Mesh::elem, fmMesh, FEM_Entity::ghost, FEM_Entity::ghostRecv, FEM_Entity::ghostSend, FEM_Mesh::node, and FEM_Node::shared.

Referenced by IdxlAddPrimary(), IdxlAddSecondary(), IdxlLookUpPrimary(), IdxlLookUpSecondary(), IdxlRemovePrimary(), and IdxlRemoveSecondary().

Here is the caller graph for this function:

int ParFUMShadowArray::IdxlAddPrimary ( int  localId,
int  sharedChk,
int  idxlType 
)

Add this 'localId' to this idxl list and return the shared entry index.

This operation adds an entry in the idxl list on the primary with 'sharedChk'.

The idxl list is again determined by idxlType. It retuns the index on the idxl list where it was added, which is used by the following operation. Note that here Primary does not have any relation to the global number, it is just the first chunk in the idxl pair where this entry is being added. The localId has a globalNo associated with it, so we just store the localId in the IDXL list, no change in IDXL necessary :)

Definition at line 762 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

bool ParFUMShadowArray::IdxlAddSecondary ( int  localId,
int  sharedChk,
int  sharedIdx,
int  idxlType 
)

Add this 'sharedIdx' to this idxl list.

This is pretty self-explanatory.

Add the entry 'loclaId' on the idxl list defined by 'idxltype' with 'sharedChk' at the location 'sharedIdx'. Returns success/failure

Definition at line 773 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

int ParFUMShadowArray::IdxlRemovePrimary ( int  localId,
int  sharedChk,
int  idxlType 
)

Remove this 'localId' from this idxl list and return the shared entry index.

Search for this 'localId' on this idxl list and remove this entry.

and return the index, which will be used by the following operation.

Definition at line 783 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

bool ParFUMShadowArray::IdxlRemoveSecondary ( int  sharedChk,
int  sharedIdx,
int  idxlType 
)

Remove the entry in this idxl list at index 'sharedIdx'.

Remove the entry that is at sharedIdx on the idxllist specified by sharedChk and IdxlType.

Definition at line 793 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

int ParFUMShadowArray::IdxlLookUpPrimary ( int  localId,
int  sharedChk,
int  idxlType 
)

Lookup this 'localId' in this idxl list and return the shared entry index.

Search for this localId in this Idxl list and return the entry index; Return -1 if it does not exist in this IDXL list.

Definition at line 800 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

int ParFUMShadowArray::IdxlLookUpSecondary ( int  sharedChk,
int  sharedIdx,
int  idxlType 
)

Return the localIdx at this 'sharedIdx' on this idxl list.

Return the localId at this index 'sharedIdx' on the idxl list specified by sharedChk and IdxlType.

Definition at line 810 of file ParFUM_SA.C.

References FindIdxlSide().

Here is the call graph for this function:

adaptAdjMsg * ParFUMShadowArray::remote_bulk_edge_bisect_2D ( adaptAdj nbrElem,
adaptAdj splitElem,
int  new_idxl,
int  n1_idxl,
int  n2_idxl,
int  partitionID 
)

These are entry methods for bulk adaptivity.

Definition at line 816 of file ParFUM_SA.C.

References bulkAdapt, adaptAdjMsg::elem, and BulkAdapt::remote_edge_bisect_2D().

Here is the call graph for this function:

void ParFUMShadowArray::remote_adaptAdj_replace ( adaptAdj elem,
adaptAdj oldElem,
adaptAdj newElem 
)

Definition at line 830 of file ParFUM_SA.C.

References bulkAdapt, and BulkAdapt::remote_adaptAdj_replace().

Here is the call graph for this function:

void ParFUMShadowArray::remote_edgeAdj_replace ( int  remotePartID,
adaptAdj adj,
adaptAdj elem,
adaptAdj splitElem,
int  n1_idxl,
int  n2_idxl 
)

Definition at line 835 of file ParFUM_SA.C.

References bulkAdapt, and BulkAdapt::remote_edgeAdj_replace().

Here is the call graph for this function:

void ParFUMShadowArray::remote_edgeAdj_add ( int  remotePartID,
adaptAdj adj,
adaptAdj splitElem,
int  n1_idxl,
int  n2_idxl 
)

Definition at line 844 of file ParFUM_SA.C.

References bulkAdapt, and BulkAdapt::remote_edgeAdj_add().

Here is the call graph for this function:

void ParFUMShadowArray::recv_split_3D ( int  pos,
int  tableID,
adaptAdj elem,
adaptAdj splitElem 
)

Definition at line 851 of file ParFUM_SA.C.

References bulkAdapt, and BulkAdapt::recv_split_3D().

Here is the call graph for this function:

void ParFUMShadowArray::handle_split_3D ( int  remotePartID,
int  pos,
int  tableID,
adaptAdj elem,
RegionID  lockRegionID,
int  n1_idxl,
int  n2_idxl,
int  n5_idxl 
)

Definition at line 857 of file ParFUM_SA.C.

References bulkAdapt, BulkAdapt::handle_split_3D(), and holdingLock.

Here is the call graph for this function:

void ParFUMShadowArray::recv_splits ( int  tableID,
int  expectedSplits 
)

Definition at line 866 of file ParFUM_SA.C.

References BulkAdapt::all_splits_received(), bulkAdapt, and CthYield().

Referenced by BulkAdapt::edge_bisect_3D().

Here is the call graph for this function:

Here is the caller graph for this function:

longestMsg * ParFUMShadowArray::isLongest ( int  elem,
int  elemType,
double  len 
)

Definition at line 823 of file ParFUM_SA.C.

References bulkAdapt, BulkAdapt::isLongest(), longestMsg::longest, and PUP::m.

Here is the call graph for this function:

void ParFUMShadowArray::update_asterisk_3D ( int  remotePartID,
int  i,
adaptAdj elem,
int  numElemPairs,
adaptAdj elemPairs,
RegionID  lockRegionID,
int  n1_idxl,
int  n2_idxl,
int  n5_idxl 
)

Definition at line 872 of file ParFUM_SA.C.

References bulkAdapt, holdingLock, and BulkAdapt::update_asterisk_3D().

Here is the call graph for this function:


Field Documentation

Total number of chunks.

Definition at line 71 of file ParFUM_SA.h.

Referenced by getNumChunks(), ParFUMShadowArray(), and pup().

The Tcharm pointer to set it even outside the thread..

Definition at line 75 of file ParFUM_SA.h.

Referenced by ckJustMigrated(), ParFUMShadowArray(), setFemMesh(), and setRunningTCharm().

CProxy_TCharm ParFUMShadowArray::tproxy [private]

The proxy for the current Tcharm object.

Definition at line 77 of file ParFUM_SA.h.

Referenced by ckJustMigrated(), pup(), and setFemMesh().

Deprecated: used to lock this chunk.

Definition at line 81 of file ParFUM_SA.h.

Referenced by lockRegion(), lockRegionForRemote(), lockReply(), unlockForRemote(), unlockRegion(), unlockReply(), unpendForRemote(), and unpendRegion().

Definition at line 82 of file ParFUM_SA.h.

Referenced by lockRegion(), and ParFUMShadowArray().


The documentation for this class was generated from the following files:

Generated on Mon Sep 21 08:28:28 2020 for Charm++ by  doxygen 1.5.5