#include <fem_lock.h>
Public Member Functions | |
FEM_lock () | |
FEM_lock (int i, femMeshModify *m) | |
This entire class is DEPRECATED! It provides locking mechanism for chunks. | |
~FEM_lock () | |
int | lock (int numNodes, int *nodes, int numElems, int *elems, int elemType=0) |
locking of the chunks is blocking and is strictly in ascending order. | |
int | unlock () |
Since at one point of time one chunk can only lock one set of chunks for one operation, one does not need to pass arguments to unlock. | |
int | lock (int chunkNo, int own) |
int | unlock (int chunkNo, int own) |
For sanity, only the owner should unlock it. | |
int | getIdx () |
FEM_lock () | |
default constructor | |
FEM_lock (int i, femMeshModify *m) | |
constructor | |
FEM_lock (femMeshModify *m) | |
constructor | |
~FEM_lock () | |
destructor | |
void | pup (PUP::er &p) |
Pup this object. | |
int | getIdx () |
Return the index of this chunk. | |
int | lock (int numNodes, int *nodes, int numElems, int *elems, int elemType=0) |
locks all chunks which contain all the following nodes and elements | |
int | unlock () |
unlock all the chunks this chunk has locked currently | |
int | lock (int chunkNo, int own) |
chunk 'own' locks the chunk 'chunkNo' | |
int | unlock (int chunkNo, int own) |
chunk 'own' unlocks the chunk 'chunkNo' | |
Private Member Functions | |
bool | existsChunk (int index) |
bool | existsChunk (int index) |
Is chunk 'index' locked by this chunk currently. | |
Private Attributes | |
int | idx |
Index of the lock (chunk). | |
int | owner |
Current owner of the lock. | |
bool | isOwner |
Is there an owner for the lock. | |
bool | isLocked |
Is the chunk locked. | |
bool | hasLocks |
Does this chunk have locks. | |
bool | isLocking |
Is this chunk locking some chunks. | |
bool | isUnlocking |
Is this chunk unlocking some chunks. | |
CkVec< int > | lockedChunks |
femMeshModify * | mmod |
CkVec< int > | lockedChunks |
The list of chunks locked by this chunk. | |
femMeshModify * | mmod |
cross-pointer to the femMeshModify object |
Definition at line 19 of file fem_lock.h.
FEM_lock::FEM_lock | ( | ) | [inline] |
Definition at line 34 of file fem_lock.h.
FEM_lock::FEM_lock | ( | int | i, | |
femMeshModify * | m | |||
) |
This entire class is DEPRECATED! It provides locking mechanism for chunks.
Definition at line 9 of file fem_lock.C.
References hasLocks, idx, isLocked, isLocking, isOwner, isUnlocking, lockedChunks, mmod, owner, and CkVec< T >::removeAll().
FEM_lock::~FEM_lock | ( | ) |
Definition at line 21 of file fem_lock.C.
References hasLocks, lockedChunks, and unlock().
FEM_lock::FEM_lock | ( | ) | [inline] |
FEM_lock::FEM_lock | ( | int | i, | |
femMeshModify * | m | |||
) |
constructor
FEM_lock::FEM_lock | ( | femMeshModify * | m | ) |
constructor
Definition at line 25 of file lock.C.
References hasLocks, idx, isLocked, isLocking, isOwner, isUnlocking, lockedChunks, mmod, owner, and CkVec< T >::removeAll().
FEM_lock::~FEM_lock | ( | ) |
destructor
Definition at line 29 of file fem_lock.C.
References lockedChunks, and CkVec< T >::size().
Referenced by lock().
locking of the chunks is blocking and is strictly in ascending order.
will only return if it gets the locks the set of nodes or elems that a chunk can ask to be locked can either be shared, ghosts or local nodes/elements.
Definition at line 39 of file fem_lock.C.
References CthYield(), CpuTopoDetails::done, FEM_Mesh::elem, existsChunk(), femMeshModify::fmMesh, femMeshModify::fmUtil, free(), FEM_MUtil::getChunkNos(), FEM_Entity::ghost, hasLocks, idx, FEM_Entity::is_valid(), isLocked, isLocking, isOwner, isUnlocking, lockedChunks, mmod, FEM_Mesh::node, CkVec< T >::push_back(), CkVec< T >::removeAll(), and CkVec< T >::size().
Referenced by FEM_Modify_Lock(), and femMeshModify::lockRemoteChunk().
int FEM_lock::unlock | ( | ) |
Since at one point of time one chunk can only lock one set of chunks for one operation, one does not need to pass arguments to unlock.
Definition at line 151 of file fem_lock.C.
References CthYield(), CpuTopoDetails::done, hasLocks, idx, isLocked, isLocking, isOwner, isUnlocking, lockedChunks, CkVec< T >::removeAll(), and CkVec< T >::size().
Referenced by FEM_Modify_Unlock(), femMeshModify::unlockRemoteChunk(), and ~FEM_lock().
Definition at line 183 of file fem_lock.C.
References CthYield(), hasLocks, intMsg::i, idx, isLocked, isOwner, isUnlocking, meshMod, and owner.
For sanity, only the owner should unlock it.
Definition at line 219 of file fem_lock.C.
References CthYield(), intMsg::i, idx, isLocked, isLocking, isOwner, meshMod, and owner.
int FEM_lock::getIdx | ( | ) | [inline] |
void FEM_lock::pup | ( | PUP::er & | p | ) |
Pup this object.
Definition at line 44 of file lock.C.
References hasLocks, idx, isLocked, isLocking, isOwner, isUnlocking, lockedChunks, and owner.
Referenced by femMeshModify::pup().
int FEM_lock::getIdx | ( | ) | [inline] |
locks all chunks which contain all the following nodes and elements
int FEM_lock::idx [private] |
Index of the lock (chunk).
Definition at line 20 of file fem_lock.h.
Referenced by FEM_lock(), getIdx(), lock(), pup(), and unlock().
int FEM_lock::owner [private] |
Current owner of the lock.
Definition at line 21 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), and unlock().
bool FEM_lock::isOwner [private] |
Is there an owner for the lock.
Definition at line 22 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), and unlock().
bool FEM_lock::isLocked [private] |
Is the chunk locked.
Definition at line 23 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), and unlock().
bool FEM_lock::hasLocks [private] |
Does this chunk have locks.
Definition at line 24 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), unlock(), and ~FEM_lock().
bool FEM_lock::isLocking [private] |
Is this chunk locking some chunks.
Definition at line 25 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), and unlock().
bool FEM_lock::isUnlocking [private] |
Is this chunk unlocking some chunks.
Definition at line 26 of file fem_lock.h.
Referenced by FEM_lock(), lock(), pup(), and unlock().
CkVec<int> FEM_lock::lockedChunks [private] |
Definition at line 27 of file fem_lock.h.
Referenced by existsChunk(), FEM_lock(), lock(), pup(), unlock(), and ~FEM_lock().
femMeshModify* FEM_lock::mmod [private] |
CkVec<int> FEM_lock::lockedChunks [private] |
femMeshModify* FEM_lock::mmod [private] |