|
Packit Service |
c5cf8c |
Implementation of passively synchronized RMA for shared memory
|
|
Packit Service |
c5cf8c |
machines
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Base Assumptions
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* All of the local windows are located in shared memory.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* Only basic datatypes are supported for the target.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
General Notes
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Data Structures
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* MPID_Win
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* struct MPIR_Win
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* lwin_rwmutexes[np]
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* region_mutexes[nregions]
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_Win_lock
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* if MPI_MODE_NOCHECK is not set
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* if lock_type is MPI_LOCK_SHARED, then acquire proc_rwmutexes[rank]
|
|
Packit Service |
c5cf8c |
as a reader, otherwise acquire it as a writer
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
NOTE: the read-write mutex should be implemented fairly so that
|
|
Packit Service |
c5cf8c |
writers are not starved by continual overlapping lock requests by
|
|
Packit Service |
c5cf8c |
readers.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* set process local state to indicate whether or not the rw-mutex is held
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* set process local state to indicate if the lock is shared or exclusive
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_Win_unlock
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
* release proc_rwmutex, if it is being held
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
------------------------------------------------------------------------
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPID_Accumulate
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
NOTE: When the lock is shared, we can achieve more parallelism by
|
|
Packit Service |
c5cf8c |
dividing the local window into regions. Each region would have a
|
|
Packit Service |
c5cf8c |
separate mutex to guarantee that all data elements with that region
|
|
Packit Service |
c5cf8c |
were processed atomically. Ideally, dataloops would be optimized such
|
|
Packit Service |
c5cf8c |
that a region mutex would never be acquired more than once per
|
|
Packit Service |
c5cf8c |
accumulate operation.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
NOTE: For machines where intrinsic types must be aligned on boundaries
|
|
Packit Service |
c5cf8c |
of that types size, we can ensure that a type does not cross a region
|
|
Packit Service |
c5cf8c |
boundary by aligning the region boundaries at addresses divisible by
|
|
Packit Service |
c5cf8c |
the size of the largest type and forcing all regions to contain at
|
|
Packit Service |
c5cf8c |
least as many bytes as the largest type. For all other machines,
|
|
Packit Service |
c5cf8c |
extra logic will be required to hold multiple mutexes when a type
|
|
Packit Service |
c5cf8c |
crosses a region boundary.
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
NOTE: When the lock is exclusive, slicing up the local window and
|
|
Packit Service |
c5cf8c |
optimizing the dataloops to increase region locality is unnecessary.
|