---
 src/mpi/coll/bcast_osu.c                                           |    8 ++++
 src/mpi/comm/create_2level_comm.c                                  |    2 +
 src/mpi/init/finalize.c                                            |    2 +
 src/mpid/ch3/channels/common/src/memory/ptmalloc2/mvapich_malloc.c |    5 +-
 src/mpid/ch3/channels/common/src/rdma_cm/rdma_cm.c                 |    1 
 src/mpid/ch3/channels/mrail/src/gen2/ibv_param.c                   |    1 
 src/mpid/ch3/channels/mrail/src/gen2/ibv_send.c                    |    1 
 src/mpid/ch3/channels/mrail/src/gen2/rdma_iba_init.c               |    2 +
 src/mpid/ch3/channels/mrail/src/rdma/ch3_init.c                    |    4 ++
 src/mpid/ch3/channels/psm/src/mpidi_calls.c                        |   19 ++++++----
 src/mpid/ch3/channels/psm/src/psm_istart.c                         |   17 ++++++++
 src/mpid/ch3/channels/psm/src/psm_recv.c                           |    1 
 src/mpid/ch3/channels/psm/src/psmpriv.h                            |    4 +-
 src/mpid/ch3/src/ch3u_port.c                                       |    5 ++
 src/mpid/ch3/src/ch3u_rndv.c                                       |   11 ++---
 src/mpid/ch3/src/mpid_cancel_recv.c                                |    3 +
 src/mpid/ch3/src/mpid_cancel_send.c                                |    4 ++
 src/mpid/ch3/src/mpidi_pg.c                                        |    4 ++
 src/pm/mpirun/mpirun_params.c                                      |    1 
 src/pm/mpirun/mpirun_params_comp.c                                 |    2 -
 src/pm/mpirun/mpmd.c                                               |    1 
 21 files changed, 80 insertions(+), 18 deletions(-)

Index: src/mpi/coll/bcast_osu.c
===================================================================
--- src/mpi/coll/bcast_osu.c.orig	2014-05-08 18:56:55.420610957 +0200
+++ src/mpi/coll/bcast_osu.c	2014-05-08 18:56:55.453610199 +0200
@@ -29,6 +29,14 @@ int intra_shmem_Bcast_Large(
 	int root,
 	MPID_Comm *comm );
 
+int knomial_2level_Bcast(
+        void *buffer,
+        int count,
+        MPI_Datatype datatype,
+        int nbytes,
+        int root,
+        MPID_Comm *comm_ptr);
+
 #define SHMEM_BCST_THRESHOLD 1<<20
 
 extern int enable_shmem_collectives;
Index: src/mpi/comm/create_2level_comm.c
===================================================================
--- src/mpi/comm/create_2level_comm.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpi/comm/create_2level_comm.c	2014-05-08 18:56:55.454610176 +0200
@@ -34,6 +34,8 @@
 } while (0)
 #endif
 
+extern int (*PMI_Get_rank)( int * );
+
 #define MAX_SHMEM_COMM  4
 #define MAX_NUM_COMM    10000
 #define MAX_ALLOWED_COMM   250
Index: src/mpi/init/finalize.c
===================================================================
--- src/mpi/init/finalize.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpi/init/finalize.c	2014-05-08 18:56:55.455610153 +0200
@@ -21,6 +21,8 @@
 #include "mpiimpl.h"
 #include "mpi_init.h"
 
+extern void free_2level_comm (MPID_Comm* comm_ptr);
+
 /* -- Begin Profiling Symbol Block for routine MPI_Finalize */
 #if defined(HAVE_PRAGMA_WEAK)
 #pragma weak MPI_Finalize = PMPI_Finalize
Index: src/mpid/ch3/channels/common/src/memory/ptmalloc2/mvapich_malloc.c
===================================================================
--- src/mpid/ch3/channels/common/src/memory/ptmalloc2/mvapich_malloc.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/common/src/memory/ptmalloc2/mvapich_malloc.c	2014-05-08 18:56:55.456610130 +0200
@@ -218,9 +218,10 @@
 /* <_OSU_MVAPICH_> */
 #ifndef NEMESIS_BUILD
 #include "mpidi_ch3i_rdma_conf.h"
-#else
-#include "dreg.h"
+#include "ibv_param.h"
 #endif
+#include "dreg.h"
+
 #if !defined(DISABLE_PTMALLOC)
 /* </_OSU_MVAPICH_> */
 
Index: src/mpid/ch3/channels/common/src/rdma_cm/rdma_cm.c
===================================================================
--- src/mpid/ch3/channels/common/src/rdma_cm/rdma_cm.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/common/src/rdma_cm/rdma_cm.c	2014-05-08 18:56:55.471609785 +0200
@@ -23,6 +23,7 @@
 #include "vbuf.h"
 #include "rdma_cm.h"
 #include "cm.h"
+#include "dreg.h"
 
 #ifdef RDMA_CM
 
Index: src/mpid/ch3/channels/mrail/src/gen2/ibv_param.c
===================================================================
--- src/mpid/ch3/channels/mrail/src/gen2/ibv_param.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/mrail/src/gen2/ibv_param.c	2014-05-08 18:56:55.472609762 +0200
@@ -13,6 +13,7 @@
 #include "mpidi_ch3i_rdma_conf.h"
 #include <stdlib.h>
 #include <stdio.h>
+#include <ctype.h>
 #include <infiniband/verbs.h>
 #include <infiniband/umad.h>
 #include "ibv_param.h"
Index: src/mpid/ch3/channels/mrail/src/gen2/ibv_send.c
===================================================================
--- src/mpid/ch3/channels/mrail/src/gen2/ibv_send.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/mrail/src/gen2/ibv_send.c	2014-05-08 18:56:55.473609739 +0200
@@ -23,6 +23,7 @@
 #include "vbuf.h"
 #include "pmi.h"
 #include "mpiutil.h"
+#include "dreg.h"
 
 #undef DEBUG_PRINT
 #ifdef DEBUG
Index: src/mpid/ch3/channels/mrail/src/gen2/rdma_iba_init.c
===================================================================
--- src/mpid/ch3/channels/mrail/src/gen2/rdma_iba_init.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/mrail/src/gen2/rdma_iba_init.c	2014-05-08 18:56:55.473609739 +0200
@@ -751,6 +751,8 @@ fn_fail:
     goto fn_exit;
 }
 
+extern void deallocate_vbuf_region(void);
+
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3I_RDMA_finalize
 #undef FCNAME
Index: src/mpid/ch3/channels/mrail/src/rdma/ch3_init.c
===================================================================
--- src/mpid/ch3/channels/mrail/src/rdma/ch3_init.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/mrail/src/rdma/ch3_init.c	2014-05-08 18:56:55.474609716 +0200
@@ -18,6 +18,10 @@
 
 MPIDI_CH3I_Process_t MPIDI_CH3I_Process;
 
+#if defined(RDMA_CM)
+extern int rdma_cm_get_hca_type (struct MPIDI_CH3I_RDMA_Process_t *proc);
+#endif
+
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_Init
 #undef FCNAME
Index: src/mpid/ch3/channels/psm/src/mpidi_calls.c
===================================================================
--- src/mpid/ch3/channels/psm/src/mpidi_calls.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/psm/src/mpidi_calls.c	2014-05-08 19:50:01.414321529 +0200
@@ -13,6 +13,13 @@
 #include "psmpriv.h"
 #include <pthread.h>
 
+extern int psm_isendv(MPIDI_VC_t *vc, MPID_IOV *iov, int iov_n, MPID_Request *rptr);
+extern int psm_istartmsg(MPIDI_VC_t *vc, void *upkt, MPIDI_msg_sz_t pkt_sz, MPID_Request **rptr);
+extern int psm_progress_wait(int blocking);
+extern int psm_dofinalize(void);
+extern int psm_irecv(int src, int tag, int context_id, void *buf, int buflen, MPID_Request *req);
+extern psm_error_t psm_probe(int src, int tag, int context, MPI_Status *stat);
+
 /* this file has all the MPIU_CALL functions called from CH3 layer */
 
 #undef FUNCNAME
@@ -62,7 +69,7 @@ inline int MPIDI_CH3_iStartMsg(MPIDI_VC_
 
 int MPIDI_CH3_iSend(MPIDI_VC_t *vc, MPID_Request *req, void *pkt, MPIDI_msg_sz_t pkt_sz)
 {
-
+    return MPI_SUCCESS;
 }
 
 #undef FUNCNAME
@@ -72,7 +79,7 @@ int MPIDI_CH3_iSend(MPIDI_VC_t *vc, MPID
 
 int MPIDI_CH3_Connection_terminate(MPIDI_VC_t *vc)
 {
-
+    return MPI_SUCCESS;
 }
 
 #undef FUNCNAME
@@ -82,7 +89,7 @@ int MPIDI_CH3_Connection_terminate(MPIDI
 
 int MPIDI_CH3_Connect_to_root(const char *port, MPIDI_VC_t **vc)
 {
-
+    return MPI_SUCCESS;
 }
 
 #undef FUNCNAME
@@ -139,7 +146,7 @@ int MPIDI_CH3_InitCompleted()
 
 int MPIDI_CH3_PortFnsInit(MPIDI_PortFns *fns)
 {
-
+    return MPI_SUCCESS;
 }
 
 #undef FUNCNAME
@@ -149,7 +156,7 @@ int MPIDI_CH3_PortFnsInit(MPIDI_PortFns
 
 int MPIDI_CH3_Get_business_card(int myRank, char *port, int len)
 {
-
+    return MPI_SUCCESS;
 }
 
 #undef FUNCNAME
@@ -270,7 +277,7 @@ inline int MPIDI_CH3_iRecv(int rank, int
 #define FUNCNAME MPIDI_CH3_SendNonContig
 #undef FCNAME
 #define FCNAME MPIDI_QUOTE(FUNCNAME)
-int MPIDI_CH3_SendNonContig(MPIDI_VC_t *vc, MPID_Request *sreq,
+void MPIDI_CH3_SendNonContig(MPIDI_VC_t *vc, MPID_Request *sreq,
                             MPIDI_Message_match match, int blocking)
 {
     fprintf(stderr, "SHOULD NOT BE USED\n");
Index: src/mpid/ch3/channels/psm/src/psm_istart.c
===================================================================
--- src/mpid/ch3/channels/psm/src/psm_istart.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/psm/src/psm_istart.c	2014-05-08 20:03:45.837325988 +0200
@@ -12,6 +12,23 @@
 
 #include "psmpriv.h"
 
+extern int psm_1sided_putpkt(MPIDI_CH3_Pkt_put_t *pkt, MPID_IOV *iov, int iov_n,
+                             MPID_Request **rptr);
+extern int psm_1sided_accumpkt(MPIDI_CH3_Pkt_accum_t *pkt, MPID_IOV *iov, int iov_n,
+                               MPID_Request **rptr);
+extern int psm_1sided_getresppkt(MPIDI_CH3_Pkt_get_resp_t *pkt, MPID_IOV *iov, int iov_n,
+                                 MPID_Request **rptr);
+extern int psm_1sided_getpkt(MPIDI_CH3_Pkt_get_t *pkt, MPID_IOV *iov, int iov_n,
+                             MPID_Request **rptr);
+extern int psm_1sc_get_rndvrecv(MPID_Request *savreq, MPIDI_CH3_Pkt_t *pkt, int from_rank);
+extern psm_error_t psm_send_pkt(MPID_Request **rptr, MPIDI_Message_match m,
+                                int dest, void *buf, int buflen);
+extern int psm_map_error(psm_error_t psmerr);
+extern int psm_send_1sided_ctrlpkt(MPID_Request **rptr, int dest, void *buf,
+                                   int buflen, int src, int create_req);
+extern psm_error_t psm_isend_pkt(MPID_Request *req, MPIDI_Message_match m,
+                                 int dest, void *buf, int buflen);
+
 /* 
    iov[0] contains the packet information which includes tag/destrank/context_id
    to use. Extract iov[0], cast it to a packet type and use it */
Index: src/mpid/ch3/channels/psm/src/psm_recv.c
===================================================================
--- src/mpid/ch3/channels/psm/src/psm_recv.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/psm/src/psm_recv.c	2014-05-08 19:51:34.453177302 +0200
@@ -10,6 +10,7 @@
  *
  */
 
+#include <unistd.h>
 #include "psmpriv.h"
 
 #undef FUNCNAME
Index: src/mpid/ch3/channels/psm/src/psmpriv.h
===================================================================
--- src/mpid/ch3/channels/psm/src/psmpriv.h.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/channels/psm/src/psmpriv.h	2014-05-08 19:37:26.748695240 +0200
@@ -112,8 +112,8 @@ int psm_send_noncontig(MPIDI_VC_t *vc, M
 int MPIDI_CH3_iRecv(int rank, int tag, int cid, void *buf, int buflen, MPID_Request *req);
 int MPIDI_CH3_Recv(int rank, int tag, int cid, void *buf, int buflen, MPI_Status *stat, MPID_Request **req);
 
-void psm_pe_yield();
-MPID_Request *psm_create_req();
+void psm_pe_yield(void);
+MPID_Request *psm_create_req(void);
 void psm_update_mpistatus(MPI_Status *, psm_mq_status_t);
 int psm_1sided_input(MPID_Request *req, int inlen);
 
Index: src/mpid/ch3/src/ch3u_port.c
===================================================================
--- src/mpid/ch3/src/ch3u_port.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/src/ch3u_port.c	2014-05-08 18:56:55.476609670 +0200
@@ -1185,6 +1185,11 @@ static int SetupNewIntercomm( MPID_Comm
 
 /* Free new_vc. It was explicitly allocated in MPIDI_CH3_Connect_to_root. */
 /* FIXME: The free and the create routines should be in the same file */
+
+#if defined (_OSU_MVAPICH_)
+extern int MPIDI_CH3I_Check_pending_send(MPIDI_VC_t *);
+#endif
+
 #undef FUNCNAME
 #define FUNCNAME FreeNewVC
 #undef FCNAME
Index: src/mpid/ch3/src/ch3u_rndv.c
===================================================================
--- src/mpid/ch3/src/ch3u_rndv.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/src/ch3u_rndv.c	2014-05-08 18:56:55.476609670 +0200
@@ -178,6 +178,10 @@ int MPIDI_CH3_RndvSend( MPID_Request **s
     MPIDI_Request_set_msg_type((rreq_), (msg_type_));		\
 }
 
+extern int MPIDI_CH3_Rndv_transfer(MPIDI_VC_t *, MPID_Request *, MPID_Request *,
+                                   MPIDI_CH3_Pkt_rndv_clr_to_send_t *,
+                                   MPIDI_CH3_Pkt_rndv_req_to_send_t *);
+
 #undef FUNCNAME
 #define FUNCNAME MPIDI_CH3_PktHandler_RndvReqToSend
 #undef FCNAME
@@ -207,11 +211,7 @@ int MPIDI_CH3_PktHandler_RndvReqToSend(
     *buflen = sizeof(MPIDI_CH3_Pkt_t);
 #if defined(_OSU_MVAPICH_)
     MPIDI_CH3_RNDV_SET_REQ_INFO(rreq, rts_pkt);
-    extern int MPIDI_CH3_Rndv_transfer(MPIDI_VC_t *, MPID_Request *, MPID_Request *,
-                                       MPIDI_CH3_Pkt_rndv_clr_to_send_t *,
-                                       MPIDI_CH3_Pkt_rndv_req_to_send_t *);
 #endif /* defined(_OSU_MVAPICH_) */
-    
     if (found)
     {
 	MPID_Request * cts_req;
@@ -349,9 +349,6 @@ int MPIDI_CH3_PktHandler_RndvClrToSend(
 #if defined(_OSU_MVAPICH_)
     int recv_size;
     int i;
-    extern int MPIDI_CH3_Rndv_transfer(MPIDI_VC_t *, MPID_Request *, MPID_Request *,
-                                       MPIDI_CH3_Pkt_rndv_clr_to_send_t *,
-                                       MPIDI_CH3_Pkt_rndv_req_to_send_t *);
 #else
     MPIDI_CH3_Pkt_t upkt;
     MPID_Request * rts_sreq;
Index: src/mpid/ch3/src/mpid_cancel_recv.c
===================================================================
--- src/mpid/ch3/src/mpid_cancel_recv.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/src/mpid_cancel_recv.c	2014-05-08 18:56:55.477609647 +0200
@@ -16,6 +16,9 @@
  */
 
 #include "mpidimpl.h"
+#if defined(_OSU_MVAPICH_)
+#include "dreg.h"
+#endif
 
 #undef FUNCNAME
 #define FUNCNAME MPID_Cancel_recv
Index: src/mpid/ch3/src/mpid_cancel_send.c
===================================================================
--- src/mpid/ch3/src/mpid_cancel_send.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/src/mpid_cancel_send.c	2014-05-08 18:56:55.477609647 +0200
@@ -17,6 +17,10 @@
 
 #include "mpidimpl.h"
 
+#if defined(_OSU_MVAPICH_)
+#include "dreg.h"
+#endif
+
 /* FIXME: This should call a channel-provided routine to deliver the 
    cancel message, once the code decides that the request can still
    be cancelled */
Index: src/mpid/ch3/src/mpidi_pg.c
===================================================================
--- src/mpid/ch3/src/mpidi_pg.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/mpid/ch3/src/mpidi_pg.c	2014-05-08 18:56:55.478609624 +0200
@@ -27,6 +27,10 @@
 #define XRC_MSG(args...)
 #endif
 
+#ifdef _OSU_MVAPICH_
+#include "mpidi_ch3_impl.h"
+#endif
+
 #define MAX_JOBID_LEN 1024
 
 /* FIXME: These routines need a description.  What is their purpose?  Who
Index: src/pm/mpirun/mpirun_params.c
===================================================================
--- src/pm/mpirun/mpirun_params.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/pm/mpirun/mpirun_params.c	2014-05-08 18:56:55.478609624 +0200
@@ -42,6 +42,7 @@
 #define NSIG _NSIG
 #endif				/* defined(_NSIG) */
 
+extern void dpm_add_env(char *, char *);
 
 static int read_hostfile(char *hostfile_name);
 
Index: src/pm/mpirun/mpirun_params_comp.c
===================================================================
--- src/pm/mpirun/mpirun_params_comp.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/pm/mpirun/mpirun_params_comp.c	2014-05-08 18:56:55.479609601 +0200
@@ -42,7 +42,7 @@
 #define NSIG _NSIG
 #endif				/* defined(_NSIG) */
 
-
+extern void dpm_add_env(char *, char *);
 static int read_hostfile(char *hostfile_name);
 
 process *plist = NULL;
Index: src/pm/mpirun/mpmd.c
===================================================================
--- src/pm/mpirun/mpmd.c.orig	2010-09-16 21:55:56.000000000 +0200
+++ src/pm/mpirun/mpmd.c	2014-05-08 18:56:55.480609578 +0200
@@ -10,6 +10,7 @@
  *
  */
 
+#include <ctype.h>
 #include "mpmd.h"
 
 //These are used when activated mpmd
