Commit a9849cd1 authored by Xin Zhao's avatar Xin Zhao Committed by Pavan Balaji
Browse files

Bug-fix: always allocate target lock entry pool in win_init.



We should always allocate target lock entry pool in win_init,
even though info no_locks is set to TRUE during window creation,
this is because that info can be set to FALSE by user after
the window creation.
Signed-off-by: Pavan Balaji's avatarPavan Balaji <balaji@anl.gov>
parent 10e3c644
......@@ -374,19 +374,17 @@ static int win_init(MPI_Aint size, int disp_unit, int create_flavor, int model,
(*win_ptr)->slots[i].target_list_tail = NULL;
}
if (!(*win_ptr)->info_args.no_locks) {
MPIU_CHKPMEM_MALLOC((*win_ptr)->target_lock_entry_pool_start,
MPIDI_RMA_Target_lock_entry_t *,
sizeof(MPIDI_RMA_Target_lock_entry_t) *
MPIR_CVAR_CH3_RMA_TARGET_LOCK_ENTRY_WIN_POOL_SIZE, mpi_errno,
"RMA lock entry pool");
(*win_ptr)->target_lock_entry_pool_head = NULL;
(*win_ptr)->target_lock_entry_pool_tail = NULL;
for (i = 0; i < MPIR_CVAR_CH3_RMA_TARGET_LOCK_ENTRY_WIN_POOL_SIZE; i++) {
MPL_LL_APPEND((*win_ptr)->target_lock_entry_pool_head,
(*win_ptr)->target_lock_entry_pool_tail,
&((*win_ptr)->target_lock_entry_pool_start[i]));
}
MPIU_CHKPMEM_MALLOC((*win_ptr)->target_lock_entry_pool_start,
MPIDI_RMA_Target_lock_entry_t *,
sizeof(MPIDI_RMA_Target_lock_entry_t) *
MPIR_CVAR_CH3_RMA_TARGET_LOCK_ENTRY_WIN_POOL_SIZE, mpi_errno,
"RMA lock entry pool");
(*win_ptr)->target_lock_entry_pool_head = NULL;
(*win_ptr)->target_lock_entry_pool_tail = NULL;
for (i = 0; i < MPIR_CVAR_CH3_RMA_TARGET_LOCK_ENTRY_WIN_POOL_SIZE; i++) {
MPL_LL_APPEND((*win_ptr)->target_lock_entry_pool_head,
(*win_ptr)->target_lock_entry_pool_tail,
&((*win_ptr)->target_lock_entry_pool_start[i]));
}
/* enqueue window into the global list */
......
......@@ -228,9 +228,8 @@ int MPIDI_Win_free(MPID_Win ** win_ptr)
MPIU_Free((*win_ptr)->op_pool_start);
MPIU_Free((*win_ptr)->target_pool_start);
MPIU_Free((*win_ptr)->slots);
if ((*win_ptr)->target_lock_entry_pool_start != NULL) {
MPIU_Free((*win_ptr)->target_lock_entry_pool_start);
}
MPIU_Free((*win_ptr)->target_lock_entry_pool_start);
MPIU_Assert((*win_ptr)->current_target_lock_data_bytes == 0);
/* Free the attached buffer for windows created with MPI_Win_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