Commit 0086b7bf authored by Wesley Bland's avatar Wesley Bland
Browse files

Add CVAR for initial size of RTS queue



Rather than having a static value for the initial size of the RTS queue,
have a CVAR to define it.
Signed-off-by: default avatarHuiwei Lu <huiweilu@mcs.anl.gov>
parent 01766815
......@@ -55,9 +55,9 @@ typedef struct MPID_nem_pkt_lmt_rts
}
MPID_nem_pkt_lmt_rts_t;
#define MPID_NEM_LMT_RTS_QUEUE_SIZE 1024
extern int *MPID_nem_lmt_rts_queue;
extern int MPID_nem_lmt_rts_queue_last_inserted;
extern int MPID_nem_lmt_rts_queue_size;
typedef struct MPID_nem_pkt_lmt_cts
{
......
......@@ -6,6 +6,24 @@
#include "mpid_nem_impl.h"
/*
=== BEGIN_MPI_T_CVAR_INFO_BLOCK ===
cvars:
- name : MPIR_CVAR_NEM_LMT_RTS_QUEUE_SIZE
category : CH3
type : int
default : 1024
class : device
verbosity : MPI_T_VERBOSITY_USER_BASIC
scope : MPI_T_SCOPE_ALL_EQ
description : >-
The initial size of the NEM_LMT_RTS_QUEUE used to track RTS
messages before the LMT setup.
=== END_MPI_T_CVAR_INFO_BLOCK ===
*/
#define set_request_info(rreq_, pkt_, msg_type_) \
{ \
(rreq_)->status.MPI_SOURCE = (pkt_)->match.parts.rank; \
......@@ -112,7 +130,7 @@ int MPID_nem_lmt_RndvSend(MPID_Request **sreq_p, const void * buf, int count,
* queue. It will print a message to warn the user. This should only
* affect FT and not matching so we'll consider this ok for now. */
for (i = MPID_nem_lmt_rts_queue_last_inserted + 1; ; i++) {
if (i == MPID_NEM_LMT_RTS_QUEUE_SIZE) {
if (i == MPID_nem_lmt_rts_queue_size) {
i = -1;
continue;
}
......@@ -329,7 +347,7 @@ static int pkt_CTS_handler(MPIDI_VC_t *vc, MPIDI_CH3_Pkt_t *pkt, MPIDI_msg_sz_t
for (i = MPID_nem_lmt_rts_queue_last_inserted + 1;
i != MPID_nem_lmt_rts_queue_last_inserted;
i++) {
if (i == MPID_NEM_LMT_RTS_QUEUE_SIZE) {
if (i == MPID_nem_lmt_rts_queue_size) {
i = -1;
continue;
}
......
......@@ -814,7 +814,7 @@ int MPID_nem_lmt_shm_vc_terminated(MPIDI_VC_t *vc)
/* If there is anything in the RTS queue, it needs to be cleared out. */
MPIU_THREAD_CS_ENTER(LMT,);
for (i = 0; i < MPID_NEM_LMT_RTS_QUEUE_SIZE; i++) {
for (i = 0; i < MPID_nem_lmt_rts_queue_size; i++) {
if (MPI_REQUEST_NULL != MPID_nem_lmt_rts_queue[i]) {
MPID_Request_get_ptr(MPID_nem_lmt_rts_queue[i], req);
MPIU_DBG_MSG(CH3_CHANNEL, VERBOSE, "Checking RTS message");
......
......@@ -24,6 +24,7 @@ MPID_nem_cell_ptr_t MPID_nem_prefetched_cell = 0;
unsigned short *MPID_nem_recv_seqno = 0;
int *MPID_nem_lmt_rts_queue;
int MPID_nem_lmt_rts_queue_size;
int MPID_nem_lmt_rts_queue_last_inserted = 0;
#undef FUNCNAME
......@@ -71,8 +72,9 @@ MPID_nem_mpich_init(void)
* RTS requests. If we run out of space, we'll just drop the extra
* requests. This won't cause a matching problem, it will just prevent FT
* from working for those requests that get dropped. */
MPIU_CHKPMEM_MALLOC(MPID_nem_lmt_rts_queue, int *, sizeof(int) * MPID_NEM_LMT_RTS_QUEUE_SIZE, mpi_errno, "lmt rts queue");
for (i = 0; i < MPID_NEM_LMT_RTS_QUEUE_SIZE; i++)
MPID_nem_lmt_rts_queue_size = MPIR_CVAR_NEM_LMT_RTS_QUEUE_SIZE;
MPIU_CHKPMEM_MALLOC(MPID_nem_lmt_rts_queue, int *, sizeof(int) * MPID_nem_lmt_rts_queue_size, mpi_errno, "lmt rts queue");
for (i = 0; i < MPID_nem_lmt_rts_queue_size; i++)
MPID_nem_lmt_rts_queue[i] = MPI_REQUEST_NULL;
MPIU_CHKPMEM_COMMIT();
......
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