Core Class Reference
|
HiCR
|
HiCR::backend::pthreads::Core Class Reference
#include <core.hpp>
Public Member Functions | |
| Core (const size_t instanceCount) | |
| __INLINE__ void | insertGlobalSlot (const GlobalMemorySlot::tag_t tag, const GlobalMemorySlot::globalKey_t key, const std::shared_ptr< GlobalMemorySlot > &slot) |
| __INLINE__ std::shared_ptr< GlobalMemorySlot > | getGlobalSlot (const GlobalMemorySlot::tag_t tag, const GlobalMemorySlot::globalKey_t key) const |
| __INLINE__ void | removeGlobalSlot (const GlobalMemorySlot::tag_t tag, const GlobalMemorySlot::globalKey_t key) |
| __INLINE__ CommunicationManager::globalKeyToMemorySlotMap_t | getKeyMemorySlots (const GlobalMemorySlot::tag_t tag) const |
| __INLINE__ void | fence () |
| __INLINE__ InstanceManager::instanceList_t | getInstances () const |
| __INLINE__ std::shared_ptr< Instance > | addInstance (const pthread_t pthreadId) |
| __INLINE__ std::shared_ptr< Instance > | getInstance (const pthread_t pthreadId) const |
| __INLINE__ Instance::instanceId_t | getRootInstanceId () const |
Detailed Description
Implementation of the Pthreads core to exchange global memory slots and detect HiCR instances.
This backend uses pthread-based mutexes and barriers to prevent concurrent access violations
Constructor & Destructor Documentation
◆ Core()
|
inline |
Constructor
- Parameters
-
[in] instanceCount how many instances will be in the application
Member Function Documentation
◆ addInstance()
|
inline |
Add a new instance in the core
- Parameters
-
[in] pthreadId pthread id of the new instance
- Returns
- the newly created instance
- Note
- this function is thread-safe
◆ fence()
|
inline |
Synchronize all HiCR instances
◆ getGlobalSlot()
|
inline |
Retrieve a global memory slot
- Parameters
-
[in] tag slot tag [in] key slot key
- Returns
- shared pointer to global memory slot if present, nullptr otherwise
- Note
- this function is thread-safe
◆ getInstance()
|
inline |
Get a specific instance
- Parameters
-
[in] pthreadId pthread id of the instance to retrieve
- Returns
- the HiCR instance associated with the given pthread id
- Note
- this function is thread-safe
◆ getInstances()
|
inline |
Get all the instances registered in the core
- Returns
- a list of hicr instances
- Note
- this function is thread-safe
◆ getKeyMemorySlots()
|
inline |
Return the pair key-slots for a given tag
- Parameters
-
[in] tag
- Returns
- key-slots pair, empty map otherwise
- Note
- this function is thread-safe
◆ getRootInstanceId()
|
inline |
Getter of the root instance id
- Returns
- the root instance id
◆ insertGlobalSlot()
|
inline |
Add an element into the shared memory space
- Parameters
-
[in] tag slot tag [in] key slot key [in] slot global memory slot
- Note
- this function is thread-safe
◆ removeGlobalSlot()
|
inline |
Removes a global memory slot from the shared memory if present
- Parameters
-
[in] tag slot tag [in] key slot key
- Note
- this function is thread-safe
The documentation for this class was generated from the following file:
- /home/runner/work/HiCR/HiCR/include/hicr/backends/pthreads/core.hpp
Generated by