Commit b8c9f31b authored by Xin Zhao's avatar Xin Zhao
Browse files

Tracking current buffered lock data on each window

No reviewer.
parent 97022653
......@@ -33,6 +33,7 @@ static inline MPIDI_RMA_Lock_entry_t *MPIDI_CH3I_Win_lock_entry_alloc(MPID_Win *
new_ptr->next = NULL;
new_ptr->pkt = (*pkt);
new_ptr->data = NULL;
new_ptr->data_size = 0;
new_ptr->all_data_recved = 0;
}
......@@ -51,6 +52,7 @@ static inline int MPIDI_CH3I_Win_lock_entry_free(MPID_Win * win_ptr,
int mpi_errno = MPI_SUCCESS;
if (lock_entry->data != NULL) {
win_ptr->current_lock_data_bytes -= lock_entry->data_size;
MPIU_Free(lock_entry->data);
}
......
......@@ -132,6 +132,7 @@ typedef struct MPIDI_RMA_Lock_entry {
struct MPIDI_RMA_Lock_entry *next;
MPIDI_CH3_Pkt_t pkt; /* all information for this request packet */
void *data; /* for queued PUTs / ACCs / GACCs, data is copied here */
int data_size;
int all_data_recved; /* indicate if all data has been received */
} MPIDI_RMA_Lock_entry_t;
......
......@@ -353,6 +353,7 @@ extern MPIDI_RMA_Pkt_orderings_t *MPIDI_RMA_Pkt_orderings;
struct MPIDI_RMA_Lock_entry *lock_entry_pool_start; \
struct MPIDI_RMA_Lock_entry *lock_entry_pool; \
struct MPIDI_RMA_Lock_entry *lock_entry_pool_tail; \
int current_lock_data_bytes; \
#ifdef MPIDI_CH3_WIN_DECL
#define MPID_DEV_WIN_DECL \
......
......@@ -23,6 +23,18 @@ cvars:
a linked list of target elements. The distribution of ranks among
slots follows a round-robin pattern. Requires a positive value.
- name : MPIR_CVAR_CH3_RMA_LOCK_DATA_BYTES
category : CH3
type : int
default : 655360
class : none
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
description : >-
Size (in bytes) of available lock data this window can provided. If
current buffered lock data is more than this value, the process will
drop the upcoming operation data. Requires a positive calue.
=== END_MPI_T_CVAR_INFO_BLOCK ===
*/
......@@ -346,6 +358,7 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->lock_all_assert = 0;
(*win_ptr)->lock_epoch_count = 0;
(*win_ptr)->outstanding_locks = 0;
(*win_ptr)->current_lock_data_bytes = 0;
/* Initialize the info flags */
(*win_ptr)->info_args.no_locks = 0;
......
......@@ -205,7 +205,8 @@ int MPIDI_Win_free(MPID_Win ** win_ptr)
entering Win_free. */
while ((*win_ptr)->current_lock_type != MPID_LOCK_NONE ||
(*win_ptr)->at_completion_counter != 0 ||
(*win_ptr)->lock_queue != NULL) {
(*win_ptr)->lock_queue != NULL ||
(*win_ptr)->current_lock_data_bytes != 0) {
mpi_errno = wait_progress_engine();
if (mpi_errno != MPI_SUCCESS)
MPIU_ERR_POP(mpi_errno);
......@@ -239,6 +240,7 @@ int MPIDI_Win_free(MPID_Win ** win_ptr)
MPIU_Free((*win_ptr)->target_pool_start);
MPIU_Free((*win_ptr)->slots);
MPIU_Free((*win_ptr)->lock_entry_pool_start);
MPIU_Assert((*win_ptr)->current_lock_data_bytes == 0);
/* Free the attached buffer for windows created with MPI_Win_allocate() */
if ((*win_ptr)->create_flavor == MPI_WIN_FLAVOR_ALLOCATE ||
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment