diff --git a/src/mpid/ch3/include/mpidpre.h b/src/mpid/ch3/include/mpidpre.h index c2e21435593..af4ba57d0c6 100644 --- a/src/mpid/ch3/include/mpidpre.h +++ b/src/mpid/ch3/include/mpidpre.h @@ -532,6 +532,8 @@ int MPID_Init(int required, int *provided); int MPID_InitCompleted( void ); +int MPID_Allocate_vci(void); + int MPID_Finalize(void); int MPID_Abort( MPIR_Comm *comm, int mpi_errno, int exit_code, const char *error_msg ); diff --git a/src/mpid/ch3/src/mpid_init.c b/src/mpid/ch3/src/mpid_init.c index 3218c978ec7..1804f8392e0 100644 --- a/src/mpid/ch3/src/mpid_init.c +++ b/src/mpid/ch3/src/mpid_init.c @@ -265,6 +265,12 @@ int MPID_InitCompleted( void ) /* --END ERROR HANDLING-- */ } +int MPID_Allocate_vci(void) +{ + /* not supported, return 0 as failure */ + return 0; +} + /* * Initialize the process group structure by using PMI calls. * This routine initializes PMI and uses PMI calls to setup the diff --git a/src/mpid/ch4/include/mpidch4.h b/src/mpid/ch4/include/mpidch4.h index 59983db2cf0..4ea9cee59b9 100644 --- a/src/mpid/ch4/include/mpidch4.h +++ b/src/mpid/ch4/include/mpidch4.h @@ -14,6 +14,7 @@ int MPID_Init(int, int *); int MPID_InitCompleted(void); +int MPID_Allocate_vci(void); MPL_STATIC_INLINE_PREFIX int MPID_Cancel_recv(MPIR_Request *) MPL_STATIC_INLINE_SUFFIX; MPL_STATIC_INLINE_PREFIX int MPID_Cancel_send(MPIR_Request *) MPL_STATIC_INLINE_SUFFIX; int MPID_Comm_disconnect(MPIR_Comm *); diff --git a/src/mpid/ch4/src/ch4_init.c b/src/mpid/ch4/src/ch4_init.c index db7327f2abe..96787d52268 100644 --- a/src/mpid/ch4/src/ch4_init.c +++ b/src/mpid/ch4/src/ch4_init.c @@ -518,6 +518,17 @@ int MPID_InitCompleted(void) goto fn_exit; } +int MPID_Allocate_vci(void) +{ + if (MPIDI_global.n_vcis + MPIDI_global.n_reserved_vcis >= MPIDI_global.n_total_vcis) { + return 0; + } else { + MPIDI_global.n_reserved_vcis++; + /* we allocate from the back */ + return (MPIDI_global.n_total_vcis - MPIDI_global.n_reserved_vcis); + } +} + int MPID_Finalize(void) { int mpi_errno;