[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-206-gfaf3fcc

mysql vizuser noreply at mpich.org
Wed May 15 20:43:05 CDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  faf3fcc019e2e626fde00732bbf0593e8dda289a (commit)
       via  c756a7d8de9fa1c4390e28407c4109450a72ae8f (commit)
       via  afa9629ee9c05239272e365be4530618809deba7 (commit)
       via  935805866050f525609866e3eaef36e2f9650b60 (commit)
       via  978d1c70e5c1c5453a6c5afb849a5c66656ffbc9 (commit)
       via  7da2069ffbe8ecd67a467a72b3c4e701a1bb6d99 (commit)
       via  1820f7c5cf91c5edbdfd256dbad663824286dcae (commit)
       via  bfa19b4415a3ab2d95cd1ad456787f788b5a9bf3 (commit)
       via  5a63aaf051c3efd62d18b632a8539eb373a5cbb0 (commit)
       via  d92aabf2eb291c603487ad9e41e8d8a35a7e0a66 (commit)
       via  662d6ff062ec050ac84d9a45295b8f53d39e2554 (commit)
      from  63e1d88fe9182bb1bc60488957624d467a68b9c8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/faf3fcc019e2e626fde00732bbf0593e8dda289a

commit faf3fcc019e2e626fde00732bbf0593e8dda289a
Author: Su Huang <suhuang at us.ibm.com>
Date:   Wed May 1 13:43:52 2013 -0400

    updates for token flow control
    
    (ibm) D190238
    (ibm) 1fe9a013d48ef38d1505dd96977fbe105b2a2b90
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>
    
    This is the 2nd commit message:
      BGQ build break fix

diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
index c063bbc..bcdf5d5 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c
@@ -47,8 +47,8 @@ MPIDI_RecvCB(pami_context_t    context,
 #if TOKEN_FLOW_CONTROL
   int          rettoks=0;
   void         *uebuf;
-  int          source;
 #endif
+  pami_task_t  source;
   if (recv == NULL)
     {
       if (msginfo->isSync)
@@ -77,6 +77,7 @@ MPIDI_RecvCB(pami_context_t    context,
   MPID_assert(msginfo_size == sizeof(MPIDI_MsgInfo));
 
   MPID_Request * rreq = NULL;
+  source=PAMIX_Endpoint_query(sender);
 
   /* -------------------- */
   /*  Match the request.  */
@@ -89,7 +90,6 @@ MPIDI_RecvCB(pami_context_t    context,
   if (TOKEN_FLOW_CONTROL_ON)
     {
       #if TOKEN_FLOW_CONTROL
-      source=PAMIX_Endpoint_query(sender);
       MPIDI_Receive_tokens(msginfo,source);
       #else
       MPID_assert_always(0);
@@ -98,17 +98,8 @@ MPIDI_RecvCB(pami_context_t    context,
 #ifndef OUT_OF_ORDER_HANDLING
   rreq = MPIDI_Recvq_FDP(rank, tag, context_id);
 #else
-  rreq = MPIDI_Recvq_FDP(rank, PAMIX_Endpoint_query(sender), tag, context_id, msginfo->MPIseqno);
+  rreq = MPIDI_Recvq_FDP(rank, source, tag, context_id, msginfo->MPIseqno);
 #endif
-  if ((TOKEN_FLOW_CONTROL_ON) && (MPIDI_MUST_RETURN_TOKENS(sender)))
-    {
-      #if TOKEN_FLOW_CONTROL
-      rettoks=MPIDI_Token_cntr[sender].rettoks;
-      MPIDI_Token_cntr[sender].rettoks=0;
-      #else
-      MPID_assert_always(0);
-      #endif
-    }
 
   /* Match not found */
   if (unlikely(rreq == NULL))
@@ -155,7 +146,7 @@ MPIDI_RecvCB(pami_context_t    context,
 #ifndef OUT_OF_ORDER_HANDLING
       rreq = MPIDI_Recvq_FDP(rank, tag, context_id);
 #else
-      rreq = MPIDI_Recvq_FDP(rank, PAMIX_Endpoint_query(sender), tag, context_id, msginfo->MPIseqno);
+      rreq = MPIDI_Recvq_FDP(rank, source, tag, context_id, msginfo->MPIseqno);
 #endif
 
       if (unlikely(rreq == NULL))
@@ -188,7 +179,8 @@ MPIDI_RecvCB(pami_context_t    context,
       if (TOKEN_FLOW_CONTROL_ON)
         {
           #if TOKEN_FLOW_CONTROL
-          MPIDI_Update_rettoks(sender);
+          MPIDI_Update_rettoks(source);
+          MPIDI_Must_return_tokens(context,source);
           #else
           MPID_assert_always(0);
           #endif
@@ -226,7 +218,7 @@ MPIDI_RecvCB(pami_context_t    context,
   /* ----------------------------- */
 
   if (unlikely(msginfo->isSync))
-    MPIDI_SyncAck_post(context, rreq, PAMIX_Endpoint_query(sender));
+    MPIDI_SyncAck_post(context, rreq, source);
 
   /* ----------------------------------------- */
   /*  Calculate message length for reception.  */
@@ -308,14 +300,13 @@ MPIDI_RecvCB(pami_context_t    context,
    MPIDI_Trace_buf[(PAMIX_Endpoint_query(sender))].R[(rreq->mpid.idx)].bufadd=rreq->mpid.userbuf;
 #endif
 
+ fn_exit_eager:
 #ifdef OUT_OF_ORDER_HANDLING
-  if (MPIDI_In_cntr[PAMIX_Endpoint_query(sender)].n_OutOfOrderMsgs > 0) {
-    MPIDI_Recvq_process_out_of_order_msgs(PAMIX_Endpoint_query(sender), context);
+  if (MPIDI_In_cntr[source].n_OutOfOrderMsgs > 0) {
+    MPIDI_Recvq_process_out_of_order_msgs(source, context);
   }
 #endif
 
- fn_exit_eager:
- MPIDI_Return_tokens(context, source, rettoks);
   /* ---------------------------------------- */
   /*  Signal that the recv has been started.  */
   /* ---------------------------------------- */
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
index 3ec4228..45a7963 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c
@@ -79,7 +79,7 @@ MPIDI_RecvRzvCB_impl(pami_context_t    context,
   rreq->status.MPI_TAG    = tag;
   rreq->status.count      = envelope->length;
   MPIDI_Request_setPeerRank_comm(rreq, rank);
-  MPIDI_Request_setPeerRank_pami(rreq, PAMIX_Endpoint_query(sender));
+  MPIDI_Request_setPeerRank_pami(rreq, source);
   MPIDI_Request_cpyPeerRequestH (rreq, msginfo);
   MPIDI_Request_setSync         (rreq, msginfo->isSync);
   MPIDI_Request_setRzv          (rreq, 1);
@@ -117,11 +117,10 @@ MPIDI_RecvRzvCB_impl(pami_context_t    context,
   MPIDI_Trace_buf[source].R[(rreq->mpid.idx)].rlen=envelope->length;
   MPIDI_Trace_buf[source].R[(rreq->mpid.idx)].sync=msginfo->isSync;
 #endif
-     if ((TOKEN_FLOW_CONTROL_ON) && (MPIDI_MUST_RETURN_TOKENS(sender)))
+     if (TOKEN_FLOW_CONTROL_ON)
        {
          #if TOKEN_FLOW_CONTROL
-         rettoks=MPIDI_Token_cntr[sender].rettoks;
-         MPIDI_Token_cntr[sender].rettoks=0;
+         MPIDI_Must_return_tokens(context,source);
          #else
          MPID_assert_always(0);
          #endif
@@ -180,9 +179,6 @@ MPIDI_RecvRzvCB_impl(pami_context_t    context,
 #endif
       MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
     }
-#if TOKEN_FLOW_CONTROL
-  MPIDI_Return_tokens(context, source, rettoks);
-#endif
   /* ---------------------------------------- */
   /*  Signal that the recv has been started.  */
   /* ---------------------------------------- */
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
index 73fd42d..14a6f2e 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_callback_short.c
@@ -80,18 +80,6 @@ MPIDI_RecvShortCB(pami_context_t    context,
 #if (MPIDI_STATISTICS)
          MPID_NSTAT(mpid_statp->earlyArrivals);
 #endif
-     if (TOKEN_FLOW_CONTROL_ON)
-       {
-         #if TOKEN_FLOW_CONTROL
-         if (MPIDI_MUST_RETURN_TOKENS(source))
-           {
-             rettoks=MPIDI_Token_cntr[source].rettoks;
-             MPIDI_Token_cntr[source].rettoks=0;
-           }
-         #else
-         MPID_assert_always(0);
-         #endif
-     }
       MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
       MPID_Request *newreq = MPIDI_Request_create2();
       MPID_assert(newreq != NULL);
@@ -154,6 +142,7 @@ MPIDI_RecvShortCB(pami_context_t    context,
         {
           #if TOKEN_FLOW_CONTROL
           MPIDI_Update_rettoks(source);
+          MPIDI_Must_return_tokens(context,source);
           #else
           MPID_assert_always(0);
           #endif
@@ -214,16 +203,15 @@ MPIDI_RecvShortCB(pami_context_t    context,
 #endif
   MPIDI_Request_complete(rreq);
 
+ fn_exit_short:
 #ifdef OUT_OF_ORDER_HANDLING
   MPIU_THREAD_CS_ENTER(MSGQUEUE,0);
-  if ((rank != MPI_ANY_SOURCE) && (MPIDI_In_cntr[source].n_OutOfOrderMsgs>0))  {
+  if (MPIDI_In_cntr[source].n_OutOfOrderMsgs>0)  {
     MPIDI_Recvq_process_out_of_order_msgs(source, context);
   }
   MPIU_THREAD_CS_EXIT(MSGQUEUE,0);
 #endif
 
- fn_exit_short:
- MPIDI_Return_tokens(context, source, rettoks);
   /* ---------------------------------------- */
   /*  Signal that the recv has been started.  */
   /* ---------------------------------------- */
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_done.c b/src/mpid/pamid/src/pt2pt/mpidi_done.c
index 0b5dd7a..c71acba 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_done.c
+++ b/src/mpid/pamid/src/pt2pt/mpidi_done.c
@@ -168,6 +168,7 @@ void MPIDI_Recvq_process_out_of_order_msgs(pami_task_t src, pami_context_t conte
                MPIDI_Token_cntr[src].unmatched--;
                MPIDI_Update_rettoks(src);
            }
+           MPIDI_Must_return_tokens(context,src);
            #else
            MPID_assert_always(0);
            #endif
diff --git a/src/mpid/pamid/src/pt2pt/mpidi_recv.h b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
index 2ca6879..8ff9f10 100644
--- a/src/mpid/pamid/src/pt2pt/mpidi_recv.h
+++ b/src/mpid/pamid/src/pt2pt/mpidi_recv.h
@@ -42,11 +42,7 @@ extern char *EagerLimit;
 #define MPIDI_Receive_tokens       MPIDI_Receive_tokens_inline
 #define MPIDI_Update_rettoks       MPIDI_Update_rettoks_inline
 #define MPIDI_Alloc_lock           MPIDI_Alloc_lock_inline
-
-#define MPIDI_MUST_RETURN_TOKENS(dd)                                          \
-    (MPIDI_Token_cntr[(dd)].rettoks                                           \
-     && (MPIDI_Token_cntr[(dd)].rettoks + MPIDI_Token_cntr[(dd)].unmatched    \
-         >= MPIDI_tfctrl_hwmark))
+#define MPIDI_Must_return_tokens   MPIDI_Must_return_tokens_inline
 
 static inline void *
 MPIDI_Return_tokens_inline(pami_context_t context, int dest, int tokens)
@@ -74,6 +70,23 @@ MPIDI_Return_tokens_inline(pami_context_t context, int dest, int tokens)
      }
 }
 
+
+static inline void *
+MPIDI_Must_return_tokens_inline(pami_context_t context,int dest) 
+{
+  int rettoks=0;  
+   
+  if  (MPIDI_Token_cntr[dest].rettoks
+       && (MPIDI_Token_cntr[dest].rettoks + MPIDI_Token_cntr[dest].unmatched
+       >= MPIDI_tfctrl_hwmark))
+  {
+       rettoks=MPIDI_Token_cntr[dest].rettoks;
+       MPIDI_Token_cntr[dest].rettoks=0;
+       MPIDI_Return_tokens_inline(context,dest,rettoks);
+
+  }
+}
+
 static inline void *
 MPIDI_Receive_tokens_inline(const MPIDI_MsgInfo *m, int dest)
     {
@@ -101,7 +114,7 @@ MPIDI_Alloc_lock_inline(void **buf,size_t size)
 #define MPIDI_Return_tokens(x,y,z)
 #define MPIDI_Receive_tokens(x,y)
 #define MPIDI_Update_rettoks(x)
-#define MPIDI_MUST_RETURN_TOKENS(x) (0)
+#define MPIDI_Must_return_tokens(x,y) (0)
 #define MPIDI_Alloc_lock(x,y)
 #endif
 
@@ -207,6 +220,7 @@ MPIDI_Recv(void          * buf,
            MPIDI_Token_cntr[(rreq->mpid.peer_pami)].unmatched--;
            MPIDI_Update_rettoks(rreq->mpid.peer_pami);
          }
+         MPIDI_Must_return_tokens(MPIDI_Context[0],(rreq->mpid.peer_pami));
          #else
          MPID_assert_always(0);
          #endif

http://git.mpich.org/mpich.git/commitdiff/c756a7d8de9fa1c4390e28407c4109450a72ae8f

commit c756a7d8de9fa1c4390e28407c4109450a72ae8f
Author: Su Huang <suhuang at us.ibm.com>
Date:   Mon Apr 29 16:41:39 2013 -0400

    32bit(2) reduce&allreduce fail MPI_LONG w/ collective_selected
    
    (ibm) D189842
    (ibm) 7Z8
    (ibm) b4718cf2b8bf3ddb7d39e2fdf7aee7b87eac8e1f
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/coll/coll_utils.c b/src/mpid/pamid/src/coll/coll_utils.c
index f4bcb0d..50a3d55 100644
--- a/src/mpid/pamid/src/coll/coll_utils.c
+++ b/src/mpid/pamid/src/coll/coll_utils.c
@@ -53,12 +53,11 @@ pami_result_t MPIDI_Pami_post_wrapper(pami_context_t context, void *cookie)
 		       (x) == MPI_UNSIGNED_CHAR || (x) == MPI_UINT8_T )
 
 /* sizeof(longlong) == sizeof(long) == sizeof(uint64) on bgq */
-#define isS_LONG(x) ( (x) == MPI_LONG || (x) == MPI_AINT ||  \
-                      (x) == MPI_OFFSET )
+#define isS_LONG(x) ( (x) == MPI_LONG || (x) == MPI_AINT )
 
 #define isUS_LONG(x) ( (x) == MPI_UNSIGNED_LONG )
 
-#define isS_LONG_LONG(x) ( (x) == MPI_INT64_T || \
+#define isS_LONG_LONG(x) ( (x) == MPI_INT64_T || (x) == MPI_OFFSET || \
                       (x) == MPI_INTEGER8 || (x) == MPI_LONG_LONG || \
                       (x) == MPI_LONG_LONG_INT )                           
 

http://git.mpich.org/mpich.git/commitdiff/afa9629ee9c05239272e365be4530618809deba7

commit afa9629ee9c05239272e365be4530618809deba7
Author: Su Huang <suhuang at us.ibm.com>
Date:   Mon Apr 29 13:55:15 2013 -0400

    32bit reduce&allreduce fail MPI_LONG w/ collective_selected
    
    (ibm) D189842
    (ibm) 7Z8
    (ibm) 017c9d99634bcfb225c4ede785709e3f3644a193
    (ibm) a42fc06e0ed99acd968fc18405199bc98e5b1190
    (ibm) 5326308445643a91cdd15ec7b402285aef9095e4
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/coll/coll_utils.c b/src/mpid/pamid/src/coll/coll_utils.c
index fcbbf95..f4bcb0d 100644
--- a/src/mpid/pamid/src/coll/coll_utils.c
+++ b/src/mpid/pamid/src/coll/coll_utils.c
@@ -53,13 +53,18 @@ pami_result_t MPIDI_Pami_post_wrapper(pami_context_t context, void *cookie)
 		       (x) == MPI_UNSIGNED_CHAR || (x) == MPI_UINT8_T )
 
 /* sizeof(longlong) == sizeof(long) == sizeof(uint64) on bgq */
-#define isS_LONG(x) ( (x) == MPI_INT64_T || (x) == MPI_LONG || \
+#define isS_LONG(x) ( (x) == MPI_LONG || (x) == MPI_AINT ||  \
+                      (x) == MPI_OFFSET )
+
+#define isUS_LONG(x) ( (x) == MPI_UNSIGNED_LONG )
+
+#define isS_LONG_LONG(x) ( (x) == MPI_INT64_T || \
                       (x) == MPI_INTEGER8 || (x) == MPI_LONG_LONG || \
-                      (x) == MPI_LONG_LONG_INT || (x) == MPI_AINT || \
-                      (x) == MPI_OFFSET)
+                      (x) == MPI_LONG_LONG_INT )                           
+
+#define isUS_LONG_LONG(x) ( (x) == MPI_UINT64_T || (x) == MPI_UNSIGNED_LONG_LONG )  
+
 
-#define isUS_LONG(x) ( (x) == MPI_UINT64_T || (x) == MPI_UNSIGNED_LONG || \
-                       (x) == MPI_UNSIGNED_LONG_LONG)
 
 #define isFLOAT(x) ( (x) == MPI_FLOAT || (x) == MPI_REAL)
 
@@ -137,8 +142,10 @@ int MPIDI_Datatype_to_pami(MPI_Datatype        dt,
       else if(isUS_CHAR(dt))        *pdt = PAMI_TYPE_UNSIGNED_CHAR;
       else if(isS_SHORT(dt))        *pdt = PAMI_TYPE_SIGNED_SHORT;
       else if(isUS_SHORT(dt))       *pdt = PAMI_TYPE_UNSIGNED_SHORT;
-      else if(isS_LONG(dt))         *pdt = PAMI_TYPE_SIGNED_LONG_LONG;
-      else if(isUS_LONG(dt))        *pdt = PAMI_TYPE_UNSIGNED_LONG_LONG;
+      else if(isS_LONG(dt))         *pdt = PAMI_TYPE_SIGNED_LONG;
+      else if(isUS_LONG(dt))        *pdt = PAMI_TYPE_UNSIGNED_LONG;
+      else if(isS_LONG_LONG(dt))    *pdt = PAMI_TYPE_SIGNED_LONG_LONG;
+      else if(isUS_LONG_LONG(dt))   *pdt = PAMI_TYPE_UNSIGNED_LONG_LONG;
       else if(isSINGLE_COMPLEX(dt)) *pdt = PAMI_TYPE_SINGLE_COMPLEX;
       else if(isDOUBLE_COMPLEX(dt)) *pdt = PAMI_TYPE_DOUBLE_COMPLEX;
       else if(isLOC_TYPE(dt))

http://git.mpich.org/mpich.git/commitdiff/935805866050f525609866e3eaef36e2f9650b60

commit 935805866050f525609866e3eaef36e2f9650b60
Author: Haizhu Liu <haizhu at us.ibm.com>
Date:   Mon Apr 22 23:31:09 2013 -0400

    second spawn reuse taskid would fail with ERROR 421
    
    (ibm) D189968
    (ibm) 4260cf9294bc75af0cb175823885f20d1d2b1ee8
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/dyntask/mpidi_port.c b/src/mpid/pamid/src/dyntask/mpidi_port.c
index 7bd2806..a90e24e 100644
--- a/src/mpid/pamid/src/dyntask/mpidi_port.c
+++ b/src/mpid/pamid/src/dyntask/mpidi_port.c
@@ -582,6 +582,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     }
 
     /* broadcast the received info to local processes */
+    TRACE_ERR("accept:broadcasting 2 ints - %d and %d\n", recv_ints[0], recv_ints[1]);
     mpi_errno = MPIR_Bcast_intra(recv_ints, 3, MPI_INT, root, comm_ptr, &errflag);
     if (mpi_errno) TRACE_ERR("MPIR_Bcast_intra returned with mpi_errno=%d\n", mpi_errno);
 
@@ -663,6 +664,7 @@ int MPIDI_Comm_connect(const char *port_name, MPID_Info *info, int root,
     mpi_errno = MPIDI_SetupNewIntercomm( comm_ptr, remote_comm_size,
 				   remote_translation, n_remote_pgs, remote_pg, *newcomm );
     (*newcomm)->mpid.world_intercomm_cntr   = comm_cntr;
+    WORLDINTCOMMCNTR = comm_cntr;
     MPIDI_add_new_tranid(comm_cntr);
 
 /*    MPIDI_Parse_connection_info(n_remote_pgs, remote_pg); */
@@ -1321,6 +1323,7 @@ int MPIDI_Comm_accept(const char *port_name, MPID_Info *info, int root,
     mpi_errno = MPIDI_SetupNewIntercomm( comm_ptr, remote_comm_size,
 				   remote_translation, n_remote_pgs, remote_pg, intercomm );
     intercomm->mpid.world_intercomm_cntr   = comm_cntr;
+    WORLDINTCOMMCNTR = comm_cntr;
     MPIDI_add_new_tranid(comm_cntr);
 
     if (mpi_errno != MPI_SUCCESS) {
@@ -1442,8 +1445,8 @@ static int MPIDI_SetupNewIntercomm( struct MPID_Comm *comm_ptr, int remote_comm_
 			 remote_translation[i].pg_rank, remote_translation[i].pg_taskid,&intercomm->vcr[i]);
 	TRACE_ERR("MPIDI_SetupNewIntercomm - pg_id=%s pg_rank=%d pg_taskid=%d intercomm->vcr[%d]->taskid=%d intercomm->vcr[%d]->pg=%x\n ", remote_pg[remote_translation[i].pg_index]->id, remote_translation[i].pg_rank, remote_translation[i].pg_taskid, i, intercomm->vcr[i]->taskid, i, intercomm->vcr[i]->pg);
 	PAMI_Endpoint_create(MPIDI_Client, remote_translation[i].pg_taskid, 0, &dest);
-	/*PAMI_Resume(MPIDI_Context[0],
-                    &dest, 1); */
+	PAMI_Resume(MPIDI_Context[0],
+                    &dest, 1);
     }
 
     MPIDI_Parse_connection_info(n_remote_pgs, remote_pg);

http://git.mpich.org/mpich.git/commitdiff/978d1c70e5c1c5453a6c5afb849a5c66656ffbc9

commit 978d1c70e5c1c5453a6c5afb849a5c66656ffbc9
Author: Sameh Sharkawi <sssharka at us.ibm.com>
Date:   Mon Apr 15 19:16:24 2013 -0400

    Correctly handling non-continuous data in vector collectives
    
    (ibm) D189791
    (ibm) 921af973d312be39763878d9478bea10187ad762
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
index 49e6aef..47e9eb4 100644
--- a/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
+++ b/src/mpid/pamid/src/coll/allgather/mpido_allgather.c
@@ -642,11 +642,17 @@ MPIDO_Allgather_simple(const void *sendbuf,
          MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
             "Fatal:  Cannot allocate pack buffer");
       }
-   }
-
    if(sendbuf == MPI_IN_PLACE)
+    {
      sbuf = PAMI_IN_PLACE;
-   else
+      size_t extent;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      MPIR_Localcopy(recvbuf + (rank*recvcount*extent), recvcount, recvtype,
+                       rcv_noncontig_buff + (rank*recv_size), recv_size,MPI_CHAR);
+    }
+  }
+
+  if(sendbuf != MPI_IN_PLACE)
    {
      MPIDI_Datatype_get_info(sendcount,
                            sendtype,
diff --git a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
index 95874b9..3fd0eb6 100644
--- a/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
+++ b/src/mpid/pamid/src/coll/allgatherv/mpido_allgatherv.c
@@ -624,6 +624,7 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
   MPI_Aint recv_true_lb  = 0;
   size_t   send_size     = 0;
   size_t   recv_size     = 0;
+  size_t   rcvtypelen    = 0;
   int snd_data_contig = 0, rcv_data_contig = 0;
   void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
   int scount=sendcount;
@@ -631,9 +632,20 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
   char *sbuf, *rbuf;
   pami_type_t stype = NULL, rtype;
   const int rank = comm_ptr->rank;
+  const int size = comm_ptr->local_size;
   const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
 
+  int recvcontinuous=0;
+  size_t totalrecvcount=0;
+  int *lrecvdispls = NULL; /* possible local displs calculated for noncontinous */
+  int *lrecvcounts  = NULL;/* possible local counts calculated for noncontinous */
+  const int *precvdispls = displs; /* pointer to displs to use as pami parmi */
+  const int *precvcounts = recvcounts; /* pointer to counts to use as pami parmi */
+  int inplace = sendbuf == MPI_IN_PLACE? 1 : 0;
+
+
   volatile unsigned allgatherv_active = 1;
+  int recvok=PAMI_SUCCESS, sendok=PAMI_SUCCESS;
   int tmp;
   const pami_metadata_t *my_md;
 
@@ -641,14 +653,14 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
    MPIDI_Datatype_get_info(1,
                           recvtype,
                           rcv_data_contig,
-                          recv_size,
+                          rcvtypelen,
                           dt_null,
                           recv_true_lb);
 
    if(MPIDI_Pamix_collsel_advise != NULL)
    {
      advisor_algorithm_t advisor_algorithms[1];
-     int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLGATHERV_INT, recv_size * recvcounts[0], advisor_algorithms, 1);
+    int num_algorithms = MPIDI_Pamix_collsel_advise(mpid->collsel_fast_query, PAMI_XFER_ALLGATHERV_INT, rcvtypelen * recvcounts[0], advisor_algorithms, 1);
      if(num_algorithms)
      {
        if(advisor_algorithms[0].algorithm_type == COLLSEL_EXTERNAL_ALGO)
@@ -660,44 +672,77 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
      }
    }
 
-   if((sendbuf != MPI_IN_PLACE) && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
+
+  if(!inplace)
    {
-     return MPIR_Allgatherv(sendbuf, sendcount, sendtype,
-                       recvbuf, recvcounts, displs, recvtype,
-                       comm_ptr, mpierrno);
-   }
-   if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
+    sendok = MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp);
+    MPIDI_Datatype_get_info(sendcount, sendtype, snd_data_contig, send_size, dt_null, send_true_lb);
+    sbuf = (char *)sendbuf + send_true_lb;
+    if(!snd_data_contig || (sendok != PAMI_SUCCESS))
    {
-     return MPIR_Allgatherv(sendbuf, sendcount, sendtype,
-                       recvbuf, recvcounts, displs, recvtype,
-                       comm_ptr, mpierrno);
-   }
-
-
-   if(sendbuf == MPI_IN_PLACE)
+      stype  = PAMI_TYPE_UNSIGNED_CHAR;
+      scount = send_size;
+      if(!snd_data_contig)
    {
-     sbuf = PAMI_IN_PLACE;
-   }
-   else
+        snd_noncontig_buff = MPIU_Malloc(send_size);
+        sbuf = snd_noncontig_buff;
+        if(snd_noncontig_buff == NULL)
    {
-      MPIDI_Datatype_get_info(sendcount,
-                              sendtype,
-                              snd_data_contig,
-                              send_size,
-                              dt_null,
-                              send_true_lb);
-       sbuf = (char *)sendbuf+send_true_lb;
+          MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+                   "Fatal:  Cannot allocate pack buffer");
    }
+        MPIR_Localcopy(sendbuf, sendcount, sendtype,
+                       snd_noncontig_buff, send_size,MPI_CHAR);
+      }
+    }
+  }
+  else
+    sbuf = PAMI_IN_PLACE;
 
+  recvok = MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp);
    rbuf = (char *)recvbuf+recv_true_lb;
-
-   if(!snd_data_contig || !rcv_data_contig)
-   {
-      return MPIR_Allgatherv(sendbuf, sendcount, sendtype,
-                       recvbuf, recvcounts, displs, recvtype,
-                       comm_ptr, mpierrno);
+  if(!rcv_data_contig || (recvok != PAMI_SUCCESS))
+  {
+    rtype = PAMI_TYPE_UNSIGNED_CHAR;
+    totalrecvcount = recvcounts[0];
+    recvcontinuous = displs[0] == 0? 1 : 0 ;
+    int i;
+    precvdispls = lrecvdispls = MPIU_Malloc(size*sizeof(int));
+    precvcounts = lrecvcounts = MPIU_Malloc(size*sizeof(int));
+    lrecvdispls[0]= 0;
+    lrecvcounts[0]= rcvtypelen * recvcounts[0];
+    for(i=1; i<size; ++i)
+    {
+      lrecvdispls[i]= rcvtypelen * totalrecvcount;
+      totalrecvcount += recvcounts[i];
+      if(displs[i] != (displs[i-1] + recvcounts[i-1]))
+        recvcontinuous = 0;
+      lrecvcounts[i]= rcvtypelen * recvcounts[i];
+    }
+    recv_size = rcvtypelen * totalrecvcount;
+    TRACE_ERR("Pack receive rcv_contig %zu, recvok %zd, totalrecvcount %zu, recvcontinuous %zu, rcvtypelen %zu, recv_size %zu\n",
+              (size_t)rcv_data_contig, (size_t)recvok, (size_t)totalrecvcount, (size_t)recvcontinuous,(size_t)rcvtypelen, (size_t)recv_size);
+
+    rcv_noncontig_buff = MPIU_Malloc(recv_size);
+    rbuf = rcv_noncontig_buff;
+    if(rcv_noncontig_buff == NULL)
+    {
+      MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+                 "Fatal:  Cannot allocate pack buffer");
+    }
+    if(inplace)
+    {
+      size_t extent;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      MPIR_Localcopy(recvbuf + displs[rank]*extent, recvcounts[rank], recvtype,
+                     rcv_noncontig_buff + precvdispls[rank], precvcounts[rank],MPI_CHAR);
+      scount = precvcounts[rank];
+      stype   = PAMI_TYPE_UNSIGNED_CHAR;
+      sbuf    = PAMI_IN_PLACE;
+    }
    }
 
+
    pami_xfer_t allgatherv;
    allgatherv.cb_done = allgatherv_cb_done;
    allgatherv.cookie = (void *)&allgatherv_active;
@@ -706,8 +751,8 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
    allgatherv.cmd.xfer_allgatherv_int.stype = stype;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
    allgatherv.cmd.xfer_allgatherv_int.rtype = rtype;
    allgatherv.cmd.xfer_allgatherv_int.stypecount = scount;
-   allgatherv.cmd.xfer_allgatherv_int.rtypecounts = (int *) recvcounts;
-   allgatherv.cmd.xfer_allgatherv_int.rdispls = (int *) displs;
+  allgatherv.cmd.xfer_allgatherv_int.rtypecounts = (int *) precvcounts;
+  allgatherv.cmd.xfer_allgatherv_int.rdispls = (int *) precvdispls;
    allgatherv.algorithm = mpid->coll_algorithm[PAMI_XFER_ALLGATHERV_INT][0][0];
    my_md = &mpid->coll_metadata[PAMI_XFER_ALLGATHERV_INT][0][0];
 
@@ -721,6 +766,36 @@ MPIDO_Allgatherv_simple(const void *sendbuf,
    TRACE_ERR("Rank %d waiting on active %d\n", rank, allgatherv_active);
    MPID_PROGRESS_WAIT_WHILE(allgatherv_active);
 
+  if(!rcv_data_contig || (recvok != PAMI_SUCCESS))
+  {
+    if(recvcontinuous)
+    {
+      MPIR_Localcopy(rcv_noncontig_buff, recv_size,MPI_CHAR,
+                     recvbuf, totalrecvcount, recvtype);
+    }
+    else
+    {
+      size_t extent;
+      int i;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      for(i=0; i<size; ++i)
+      {
+        char* scbuf = (char*)rcv_noncontig_buff+ precvdispls[i];
+        char* rcbuf = (char*)recvbuf + displs[i]*extent;
+        MPIR_Localcopy(scbuf, precvcounts[i], MPI_CHAR,
+                       rcbuf, recvcounts[i], recvtype);
+        TRACE_ERR("Pack recv src  extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)precvdispls[i],(size_t)i,(size_t)precvcounts[i],(size_t)precvdispls[i], *(int*)scbuf);
+        TRACE_ERR("Pack recv dest extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)displs[i],(size_t)i,(size_t)recvcounts[i],(size_t)displs[i], *(int*)rcbuf);
+      }
+    }
+    MPIU_Free(rcv_noncontig_buff);
+  }
+  if(!snd_data_contig)  MPIU_Free(snd_noncontig_buff);
+  if(lrecvdispls) MPIU_Free(lrecvdispls);
+  if(lrecvcounts) MPIU_Free(lrecvcounts);
+
    return MPI_SUCCESS;
 }
 
diff --git a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
index 3464c82..39a008f 100644
--- a/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
+++ b/src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c
@@ -234,6 +234,7 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
    MPIDI_Post_coll_t alltoall_post;
    int sndlen, rcvlen, snd_contig = 1, rcv_contig = 1, pamidt=1;
    int tmp;
+  const int rank = comm_ptr->rank;
 
    const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
 
@@ -286,6 +287,13 @@ int MPIDO_Alltoall_simple(const void *sendbuf,
          MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
             "Fatal:  Cannot allocate pack buffer");
       }
+    if(sendbuf == MPI_IN_PLACE)
+    {
+      size_t extent;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      MPIR_Localcopy(recvbuf + (rank*recvcount*extent), recvcount, recvtype,
+                     rcv_noncontig_buff + (rank*recv_size), recv_size,MPI_CHAR);
+    }
    }
 
    /* Alltoall is much simpler if bytes are required because we don't need to
diff --git a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
index d970069..3934877 100644
--- a/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
+++ b/src/mpid/pamid/src/coll/alltoallv/mpido_alltoallv.c
@@ -404,14 +404,33 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
 {
    TRACE_ERR("Entering MPIDO_Alltoallv_optimized\n");
    volatile unsigned active = 1;
-   int sndtypelen, rcvtypelen, snd_contig, rcv_contig;
+  int sndtypelen, rcvtypelen, snd_contig = 1, rcv_contig = 1;
    MPID_Datatype *sdt, *rdt;
    pami_type_t stype = NULL, rtype;
    MPI_Aint sdt_true_lb = 0, rdt_true_lb;
    MPIDI_Post_coll_t alltoallv_post;
-   int pamidt = 1;
+  void *snd_noncontig_buff = NULL, *rcv_noncontig_buff = NULL;
+  void *sbuf = NULL, *rbuf = NULL;
+  int recvok=PAMI_SUCCESS, sendok=PAMI_SUCCESS;
    int tmp;
    const int rank = comm_ptr->rank;
+  const int size = comm_ptr->local_size;
+
+  int sendcontinuous , recvcontinuous=0;
+  size_t recv_size=0, send_size=0;
+  size_t totalrecvcount=0;
+  int *lrecvdispls = NULL; /* possible local displs calculated for noncontinous */
+  int *lsenddispls = NULL;/* possible local displs calculated for noncontinous */
+  int *lrecvcounts  = NULL;/* possible local counts calculated for noncontinous */
+  int *lsendcounts  = NULL;/* possible local counts calculated for noncontinous */
+  const int *precvdispls = recvdispls; /* pointer to displs to use as pami parmi */
+  const int *psenddispls = senddispls; /* pointer to displs to use as pami parmi */
+  const int *precvcounts = recvcounts; /* pointer to counts to use as pami parmi */
+  const int *psendcounts = sendcounts; /* pointer to counts to use as pami parmi */
+  int inplace = sendbuf == MPI_IN_PLACE? 1 : 0;
+
+
+
 
    const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
    /* We don't pack and unpack in alltoallv as we do in alltoall because alltoallv has
@@ -420,7 +439,7 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
       will be the same on all tasks */
 
 
-
+  /* Check if collsel has MPICH algorithm as the best performing one, if so, call MPICH now w/o doing any conversions */
    MPIDI_Datatype_get_info(1, recvtype, rcv_contig, rcvtypelen, rdt, rdt_true_lb);
    if(MPIDI_Pamix_collsel_advise != NULL)
    {
@@ -437,27 +456,149 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
      }
    }
 
-   if(sendbuf != MPI_IN_PLACE && (MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp) != MPI_SUCCESS))
-      pamidt = 0;
-   if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
-      pamidt = 0;
-
-
-   if(sendbuf != MPI_IN_PLACE)
+  /* Now do checks on send data and datatypes (contig and contin) and do necessary conversions */
+  if(!inplace)
    {
+    sendok = MPIDI_Datatype_to_pami(sendtype, &stype, -1, NULL, &tmp);
      MPIDI_Datatype_get_info(1, sendtype, snd_contig, sndtypelen, sdt, sdt_true_lb);
-     if(!snd_contig) pamidt = 0;
+    sbuf = (char *)sendbuf + sdt_true_lb;
+    if(!snd_contig || (sendok != PAMI_SUCCESS))
+    {
+      stype = PAMI_TYPE_UNSIGNED_CHAR;
+      size_t totalsendcount = sendcounts[0];
+      sendcontinuous = senddispls[0] == 0? 1 : 0 ;
+      int i;
+      psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
+      psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+      lsenddispls[0]= 0;
+      lsendcounts[0]= sndtypelen * sendcounts[0];
+      for(i=1; i<size; ++i)
+      {
+        lsenddispls[i]= sndtypelen * totalsendcount;
+        totalsendcount += sendcounts[i];
+        if(senddispls[i] != (senddispls[i-1] + (sendcounts[i-1])))
+          sendcontinuous = 0;
+        lsendcounts[i]= sndtypelen * sendcounts[i];
    }
-   if(!rcv_contig) pamidt = 0;
-
-
-   if(pamidt == 0)
+      send_size = sndtypelen * totalsendcount;
+      TRACE_ERR("Pack receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, sndtypelen %zu,  send_size %zu\n",
+                (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) sndtypelen, (size_t)send_size);
+      snd_noncontig_buff = MPIU_Malloc(send_size);
+      sbuf = snd_noncontig_buff;
+      if(snd_noncontig_buff == NULL)
    {
-      return MPIR_Alltoallv(sendbuf, sendcounts, senddispls, sendtype,
-                              recvbuf, recvcounts, recvdispls, recvtype,
-                              comm_ptr, mpierrno);
-
+        MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+                   "Fatal:  Cannot allocate pack buffer");
+      }
+      if(sendcontinuous)
+      {
+        MPIR_Localcopy(sendbuf, totalsendcount, sendtype, 
+                       snd_noncontig_buff, send_size,MPI_CHAR);
+      }
+      else
+      {
+        size_t extent; 
+        MPID_Datatype_get_extent_macro(sendtype,extent);
+        for(i=0; i<size; ++i)
+        {
+          char* scbuf = (char*)sendbuf + senddispls[i]*extent;
+          char* rcbuf = (char*)snd_noncontig_buff + psenddispls[i];
+          MPIR_Localcopy(scbuf, sendcounts[i], sendtype, 
+                         rcbuf, psendcounts[i], MPI_CHAR);
+          TRACE_ERR("Pack send src  extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                    (size_t)extent, (size_t)i,(size_t)senddispls[i],(size_t)i,(size_t)sendcounts[i],(size_t)senddispls[i], *(int*)scbuf);
+          TRACE_ERR("Pack send dest             displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                    (size_t)i,(size_t)psenddispls[i],(size_t)i,(size_t)psendcounts[i],(size_t)psenddispls[i], *(int*)rcbuf);
+        }
+      }
+    }
+  }
+
+  recvok = MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp);
+  rbuf = (char *)recvbuf + rdt_true_lb;
+  if(!rcv_contig || (recvok != PAMI_SUCCESS))
+  {
+    rtype = PAMI_TYPE_UNSIGNED_CHAR;
+    totalrecvcount = recvcounts[0];
+    recvcontinuous = recvdispls[0] == 0? 1 : 0 ;
+    int i;
+    precvdispls = lrecvdispls = MPIU_Malloc(size*sizeof(int));
+    precvcounts = lrecvcounts = MPIU_Malloc(size*sizeof(int));
+    lrecvdispls[0]= 0;
+    lrecvcounts[0]= rcvtypelen * recvcounts[0];
+    for(i=1; i<size; ++i)
+    {
+      lrecvdispls[i]= rcvtypelen * totalrecvcount;
+      totalrecvcount += recvcounts[i];
+      if(recvdispls[i] != (recvdispls[i-1] + (recvcounts[i-1])))
+        recvcontinuous = 0;
+      lrecvcounts[i]= rcvtypelen * recvcounts[i];
    }   
+    recv_size = rcvtypelen * totalrecvcount;
+    TRACE_ERR("Pack receive rcv_contig %zu, recvok %zd, totalrecvcount %zu, recvcontinuous %zu, rcvtypelen %zu, recv_size %zu\n",
+              (size_t)rcv_contig, (size_t)recvok, (size_t)totalrecvcount, (size_t)recvcontinuous,(size_t)rcvtypelen, (size_t)recv_size);
+    rcv_noncontig_buff = MPIU_Malloc(recv_size);
+    rbuf = rcv_noncontig_buff;
+    if(rcv_noncontig_buff == NULL)
+    {
+      MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+                 "Fatal:  Cannot allocate pack buffer");
+    }
+    /* need to copy it now if it's used for the send buffer and then do not do in place */
+    if(inplace)
+    {
+      inplace = 0;
+      stype = PAMI_TYPE_UNSIGNED_CHAR;
+      size_t totalsendcount = recvcounts[0];
+      sendcontinuous = recvdispls[0] == 0? 1 : 0 ;
+      int i;
+      psenddispls = lsenddispls = MPIU_Malloc(size*sizeof(int));
+      psendcounts = lsendcounts = MPIU_Malloc(size*sizeof(int));
+      lsenddispls[0]= 0;
+      lsendcounts[0]= rcvtypelen * recvcounts[0];
+      for(i=1; i<size; ++i)
+      {
+        lsenddispls[i]= rcvtypelen * totalsendcount;
+        totalsendcount += recvcounts[i];
+        if(recvdispls[i] != (recvdispls[i-1] + (recvcounts[i-1])))
+          sendcontinuous = 0;
+        lsendcounts[i]= rcvtypelen * recvcounts[i];
+      }
+      send_size = rcvtypelen * totalsendcount;
+      TRACE_ERR("Pack MPI_IN_PLACE receive sndv_contig %zu, sendok %zd, totalsendcount %zu, sendcontinuous %zu, rcvtypelen %zu,  send_size %zu\n",
+                (size_t)snd_contig, (size_t)sendok, (size_t)totalsendcount, (size_t)sendcontinuous, (size_t) rcvtypelen, (size_t)send_size);
+      snd_noncontig_buff = MPIU_Malloc(send_size);
+      sbuf = snd_noncontig_buff;
+      if(snd_noncontig_buff == NULL)
+      {
+        MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
+                   "Fatal:  Cannot allocate pack buffer");
+      }
+      if(sendcontinuous)
+      {
+        MPIR_Localcopy(recvbuf, totalsendcount, recvtype, 
+                       snd_noncontig_buff, send_size,MPI_CHAR);
+      }
+      else
+      {
+        size_t extent; 
+        MPID_Datatype_get_extent_macro(recvtype,extent);
+        for(i=0; i<size; ++i)
+        {
+          char* scbuf = (char*)recvbuf + recvdispls[i]*extent;
+          char* rcbuf = (char*)snd_noncontig_buff + psenddispls[i];
+          MPIR_Localcopy(scbuf, recvcounts[i], recvtype, 
+                         rcbuf, psendcounts[i], MPI_CHAR);
+          TRACE_ERR("Pack send src  extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                    (size_t)extent, (size_t)i,(size_t)recvdispls[i],(size_t)i,(size_t)recvcounts[i],(size_t)recvdispls[i], *(int*)scbuf);
+          TRACE_ERR("Pack send dest extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                    (size_t)extent, (size_t)i,(size_t)psenddispls[i],(size_t)i,(size_t)psendcounts[i],(size_t)psenddispls[i], *(int*)rcbuf);
+        }
+      }
+    }
+  }
+
+
 
    pami_xfer_t alltoallv;
    const pami_metadata_t *my_alltoallv_md;
@@ -468,19 +609,24 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
 
    alltoallv.cb_done = cb_alltoallv;
    alltoallv.cookie = (void *)&active;
-   alltoallv.cmd.xfer_alltoallv_int.stype = stype;/* stype is ignored when sndbuf == PAMI_IN_PLACE */
-   alltoallv.cmd.xfer_alltoallv_int.sdispls = (int *) senddispls;
-   alltoallv.cmd.xfer_alltoallv_int.stypecounts = (int *) sendcounts;
-   alltoallv.cmd.xfer_alltoallv_int.sndbuf = (char *)sendbuf+sdt_true_lb;
-
-   /* We won't bother with alltoallv since MPI is always going to be ints. */
-   if(sendbuf == MPI_IN_PLACE)
+  if(inplace)
    {
+    alltoallv.cmd.xfer_alltoallv_int.stype = rtype;
+    alltoallv.cmd.xfer_alltoallv_int.sdispls = (int *) precvdispls;
+    alltoallv.cmd.xfer_alltoallv_int.stypecounts = (int *) precvcounts;
       alltoallv.cmd.xfer_alltoallv_int.sndbuf = PAMI_IN_PLACE;
    }
-   alltoallv.cmd.xfer_alltoallv_int.rcvbuf = (char *)recvbuf+rdt_true_lb;
-   alltoallv.cmd.xfer_alltoallv_int.rdispls = (int *) recvdispls;
-   alltoallv.cmd.xfer_alltoallv_int.rtypecounts = (int *) recvcounts;
+  else
+  {
+    alltoallv.cmd.xfer_alltoallv_int.stype = stype;
+    alltoallv.cmd.xfer_alltoallv_int.sdispls = (int *) psenddispls;
+    alltoallv.cmd.xfer_alltoallv_int.stypecounts = (int *) psendcounts;
+    alltoallv.cmd.xfer_alltoallv_int.sndbuf = sbuf;
+  }
+  alltoallv.cmd.xfer_alltoallv_int.rcvbuf = rbuf;
+
+  alltoallv.cmd.xfer_alltoallv_int.rdispls = (int *) precvdispls;
+  alltoallv.cmd.xfer_alltoallv_int.rtypecounts = (int *) precvcounts;
    alltoallv.cmd.xfer_alltoallv_int.rtype = rtype;
 
 
@@ -490,6 +636,38 @@ int MPIDO_Alltoallv_simple(const void *sendbuf,
    TRACE_ERR("%d waiting on active %d\n", rank, active);
    MPID_PROGRESS_WAIT_WHILE(active);
 
+  if(!rcv_contig || (recvok != PAMI_SUCCESS))
+  {
+    if(recvcontinuous)
+    {
+      MPIR_Localcopy(rcv_noncontig_buff, recv_size,MPI_CHAR,
+                     recvbuf, totalrecvcount, recvtype);
+    }
+    else
+    {
+      size_t extent; 
+      int i;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      for(i=0; i<size; ++i)
+      {
+        char* scbuf = (char*)rcv_noncontig_buff+ precvdispls[i];
+        char* rcbuf = (char*)recvbuf + recvdispls[i]*extent;
+        MPIR_Localcopy(scbuf, precvcounts[i], MPI_CHAR, 
+                       rcbuf, recvcounts[i], recvtype);
+        TRACE_ERR("Pack recv src  extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)precvdispls[i],(size_t)i,(size_t)precvcounts[i],(size_t)precvdispls[i], *(int*)scbuf);
+        TRACE_ERR("Pack recv dest extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)recvdispls[i],(size_t)i,(size_t)recvcounts[i],(size_t)recvdispls[i], *(int*)rcbuf);
+      }
+    }
+    MPIU_Free(rcv_noncontig_buff);
+  }
+  if(!snd_contig || (sendok != PAMI_SUCCESS))  MPIU_Free(snd_noncontig_buff);
+  if(lrecvdispls) MPIU_Free(lrecvdispls);
+  if(lsenddispls) MPIU_Free(lsenddispls);
+  if(lrecvcounts) MPIU_Free(lrecvcounts);
+  if(lsendcounts) MPIU_Free(lsendcounts);
+
 
    TRACE_ERR("Leaving alltoallv\n");
 
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index ac28c70..d521c1f 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -460,6 +460,13 @@ int MPIDO_Gather_simple(const void *sendbuf,
            MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
               "Fatal:  Cannot allocate pack buffer");
         }
+        if(sendbuf == MPI_IN_PLACE)
+        {
+          size_t extent;
+          MPID_Datatype_get_extent_macro(recvtype,extent);
+          MPIR_Localcopy(recvbuf + (rank*recvcount*extent), recvcount, recvtype,
+                         rcv_noncontig_buff + (rank*recv_size), recv_size,MPI_CHAR);
+        }
       }
     }
     else
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index 71caf3a..0c5f284 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -247,7 +247,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
    int send_size = 0;
    int recv_size = 0;
    int rcvlen    = 0;
-   int rcvcount  = 0;
+  int totalrecvcount  = 0;
    pami_type_t rtype = PAMI_TYPE_NULL;
    MPID_Segment segment;
    MPID_Datatype *data_ptr = NULL;
@@ -258,7 +258,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
    const int size = comm_ptr->local_size;
 
    const struct MPIDI_Comm* const mpid = &(comm_ptr->mpid);
-
+  int recvok=PAMI_SUCCESS, recvcontinuous=0;
 
    if(sendbuf != MPI_IN_PLACE)
    {
@@ -320,21 +320,25 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
    rdispls = (int*)displs;
    if(rank == root)
    {
-      if(MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp) != MPI_SUCCESS)
+    if((recvok = MPIDI_Datatype_to_pami(recvtype, &rtype, -1, NULL, &tmp)) != MPI_SUCCESS)
       {
         MPIDI_Datatype_get_info(1, recvtype, rcv_contig,
                                 rcvlen, data_ptr, recv_true_lb);
-        if (!rcv_contig)
-        {
+      totalrecvcount = recvcounts[0];
+      recvcontinuous = displs[0] == 0? 1 : 0 ;
           rcounts = (int*)MPIU_Malloc(size);
           rdispls = (int*)MPIU_Malloc(size);
-          for(i = 0; i < size; i++)
-          {
+      rdispls[0] = 0;
+      rcounts[0] = rcvlen * recvcounts[0];
+      for(i = 1; i < size; i++)
+      {
+        rdispls[i]= rcvlen * totalrecvcount;
+        totalrecvcount += recvcounts[i];
+        if(displs[i] != (displs[i-1] + recvcounts[i-1]))
+          recvcontinuous = 0;
             rcounts[i] = rcvlen * recvcounts[i];
-            rdispls[i] = rcvlen * displs[i];
-            recv_size += rcounts[i];
-            rcvcount  += recvcounts[i];
           }
+      recv_size = rcvlen * totalrecvcount;
 
           rcv_noncontig_buff = MPIU_Malloc(recv_size);
           rbuf = rcv_noncontig_buff;
@@ -344,6 +348,12 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
              MPID_Abort(NULL, MPI_ERR_NO_SPACE, 1,
                 "Fatal:  Cannot allocate pack buffer");
           }
+      if(sendbuf == MPI_IN_PLACE)
+      {
+        size_t extent;
+        MPID_Datatype_get_extent_macro(recvtype,extent);
+        MPIR_Localcopy(recvbuf + displs[rank]*extent, recvcounts[rank], recvtype,
+                     rcv_noncontig_buff + rdispls[rank], rcounts[rank],MPI_CHAR);
         }
       }
       if(sendbuf == MPI_IN_PLACE) 
@@ -391,10 +401,30 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
    TRACE_ERR("Waiting on active %d\n", gatherv_active);
    MPID_PROGRESS_WAIT_WHILE(gatherv_active);
 
-   if(!rcv_contig)
+  if(!rcv_contig || recvok != PAMI_SUCCESS)
+  {
+    if(recvcontinuous)
    {
       MPIR_Localcopy(rcv_noncontig_buff, recv_size, MPI_CHAR,
-                        recvbuf,         rcvcount,     recvtype);
+                     recvbuf,   totalrecvcount,     recvtype);
+    }
+    else
+    {
+      size_t extent;
+      MPID_Datatype_get_extent_macro(recvtype,extent);
+      for(i=0; i<size; ++i)
+      {
+        char* scbuf = (char*)rcv_noncontig_buff+ rdispls[i];
+        char* rcbuf = (char*)recvbuf + displs[i]*extent;
+        MPIR_Localcopy(scbuf, rcounts[i], MPI_CHAR,
+                       rcbuf, recvcounts[i], recvtype);
+        TRACE_ERR("Pack recv src  extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)precvdispls[i],(size_t)i,(size_t)precvcounts[i],(size_t)precvdispls[i], *(int*)scbuf);
+        TRACE_ERR("Pack recv dest extent %zu, displ[%zu]=%zu, count[%zu]=%zu buf[%zu]=%u\n",
+                  (size_t)extent, (size_t)i,(size_t)displs[i],(size_t)i,(size_t)recvcounts[i],(size_t)displs[i], *(int*)rcbuf);
+      }
+
+    }
       MPIU_Free(rcv_noncontig_buff);
       if(rank == root)
       {

http://git.mpich.org/mpich.git/commitdiff/7da2069ffbe8ecd67a467a72b3c4e701a1bb6d99

commit 7da2069ffbe8ecd67a467a72b3c4e701a1bb6d99
Author: Su Huang <suhuang at us.ibm.com>
Date:   Tue Apr 16 10:17:21 2013 -0400

    MPICH missing timer only progress engine that old PEMPI has
    
    (ibm) D189783
    (ibm) 769e26acc31c01fdda183fe86f871df73504064c
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/include/pamix.h b/src/mpid/pamid/include/pamix.h
index eedbf58..3f55400 100644
--- a/src/mpid/pamid/include/pamix.h
+++ b/src/mpid/pamid/include/pamix.h
@@ -75,6 +75,7 @@ PAMIX_Endpoint_query(pami_endpoint_t endpoint);
 
 typedef void (*pamix_progress_function) (pami_context_t context, void *cookie);
 #define PAMIX_CLIENT_ASYNC_GUARANTEE 1016
+#define ASYNC_PROGRESS_ALL  0x1111
 typedef enum
 {
   PAMIX_PROGRESS_ALL            =    0,
diff --git a/src/mpid/pamid/src/mpid_progress.c b/src/mpid/pamid/src/mpid_progress.c
index 3611b7d..53b930f 100644
--- a/src/mpid/pamid/src/mpid_progress.c
+++ b/src/mpid/pamid/src/mpid_progress.c
@@ -26,6 +26,7 @@ void
 MPIDI_Progress_init()
 {
   MPIDI_Process.async_progress.active = 0;
+  pamix_progress_t async_progress_type=0;
 
   /* In the "global" mpich lock mode the only possible progress function
    * is the "global mpich lock" trigger progress function. This progress
@@ -47,6 +48,25 @@ MPIDI_Progress_init()
     MPIDI_Process.perobj.context_post.requested;
 #endif
 
+  async_progress_type = PAMIX_PROGRESS_ALL;
+
+#ifdef __PE__
+  if (MPIDI_Process.mp_interrupts)
+  {
+      /*  PAMIX_PROGRESS_TIMER, PAMIX_PROGRESS_RECV_INTERRUPT or      */
+      /*  ASYNC_PROGRESS_ALL                                          */
+      /*  mp_interrupts=0 indicates the interrupts is disabled        */
+      /*  which is the same definition as that of PAMIX_PROGRESS_ALL. */
+      /*  ASYNC_PROGRESS_ALL is an internal variable which is defined */
+      /*  as 0x1111 and needs to be converted to corresponding pami   */
+      /*  type PAMIX_PROGRESS_ALL                                     */
+      async_progress_type = MPIDI_Process.mp_interrupts;
+      if (MPIDI_Process.mp_interrupts == ASYNC_PROGRESS_ALL)
+         async_progress_type = PAMIX_PROGRESS_ALL;
+  }
+#endif
+
+
   if (MPIDI_Process.async_progress.mode != ASYNC_PROGRESS_MODE_DISABLED)
     {
       TRACE_ERR("Async advance beginning...\n");
@@ -60,7 +80,7 @@ MPIDI_Progress_init()
                                   MPIDI_Progress_async_end,
                                   MPIDI_Progress_async_start,
                                   (void *) i);
-          PAMIX_Progress_enable(MPIDI_Context[i], PAMIX_PROGRESS_ALL);
+          PAMIX_Progress_enable(MPIDI_Context[i], async_progress_type);
         }
       TRACE_ERR("Async advance enabled\n");
     }
diff --git a/src/mpid/pamid/src/mpidi_env.c b/src/mpid/pamid/src/mpidi_env.c
index 65dc493..e80c818 100644
--- a/src/mpid/pamid/src/mpidi_env.c
+++ b/src/mpid/pamid/src/mpidi_env.c
@@ -470,6 +470,8 @@ ENV_Char__(char* name[], unsigned* val, char* string)
 
   if (  (env[0]=='y')|| (env[0]=='Y')
      || (env[0]=='p')|| (env[0]=='P') 
+     || (env[0]=='t')|| (env[0]=='T')
+     || (env[0]=='r')|| (env[0]=='R')
      || (env[0]=='F')|| (env[0]=='f'))
           *val = 1;
   /*This may seem redundant; however, 
@@ -1049,11 +1051,41 @@ MPIDI_Env_setup(int rank, int requested)
     }
     /*  MP_CSS_INTERRUPT                                                       */
     {
+      char *cp=NULL, *cp1=NULL;
+      int user_interrupts=0;
       char* names[] = {"MP_CSS_INTERRUPT", NULL};
       ENV_Char(names, &mpich_env->interrupts);
       if (mpich_env->interrupts == 1)      /* force on  */
       {
-        MPIDI_Process.mp_interrupts=1;
+        cp = getenv("MP_CSS_INTERRUPT");
+        if (*cp=='Y' || *cp=='y')
+        {
+          user_interrupts = ASYNC_PROGRESS_ALL;
+        }
+        else
+        {
+          char delimiter='+';
+          cp1 = strchr(cp,delimiter);
+          if (!cp1)  /* timer or receive  */
+          {
+             if ( (*cp == 't') || (*cp == 'T') )
+                user_interrupts = PAMIX_PROGRESS_TIMER;
+             else if ( (*cp == 'r') || (*cp == 'R') )
+                user_interrupts = PAMIX_PROGRESS_RECV_INTERRUPT;
+          }
+          else   /* timer + receive   */
+          {
+            if ((( *cp == 't' || *cp == 'T') && ( *(cp1+1) == 'r' || *(cp1+1) == 'R')) ||
+                (( *cp == 'r' || *cp == 'R') && ( *(cp1+1) == 't' || *(cp1+1) == 'T')))
+                 user_interrupts = ASYNC_PROGRESS_ALL;
+            else
+            {
+                TRACE_ERR("ERROR in MP_CSS_INTERRUPT %s(%d)\n",__FILE__,__LINE__);
+                exit(1);
+            }
+          }
+        }
+        MPIDI_Process.mp_interrupts=user_interrupts;
         MPIDI_Process.perobj.context_post.requested = 0;
         MPIDI_Process.async_progress.mode    = ASYNC_PROGRESS_MODE_TRIGGER;
 #if (MPIU_THREAD_GRANULARITY == MPIU_THREAD_GRANULARITY_PER_OBJECT)
diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index 6c9877e..315a1a7 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -268,7 +268,7 @@ int  MPIDI_Update_mpenv()
              if ((i==task_count) || (gatherer[i].x != gatherer[first].x)) {          \
                   last = i-1;                                                        \
                   if (last != task_count-1) cflag = '*';                             \
-                  if (gatherer[first].x == 1) {                                      \
+                  if (gatherer[first].x > 0) {                                       \
                     printf("Task %1c%4d-%4d:%s %s\n", cflag, first, last,            \
                            y, "YES");                                                \
                   } else if (gatherer[first].x == 0) {                               \

http://git.mpich.org/mpich.git/commitdiff/1820f7c5cf91c5edbdfd256dbad663824286dcae

commit 1820f7c5cf91c5edbdfd256dbad663824286dcae
Author: Sameh Sharkawi <sssharka at us.ibm.com>
Date:   Mon Apr 15 16:17:15 2013 -0400

    pami_tune command line changes
    
        * pami_tune's -v  flag conflicts with poe's -v flag.
        * Disable -x flag for checkpoint mode until later
    
    (ibm) D189881
    (ibm) 749763c4d0c973739c356d59d561df6feb40aad3
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/mpidi_util.c b/src/mpid/pamid/src/mpidi_util.c
index a41ad77..6c9877e 100644
--- a/src/mpid/pamid/src/mpidi_util.c
+++ b/src/mpid/pamid/src/mpidi_util.c
@@ -1290,9 +1290,7 @@ Options:\n\
                 (Default: pami_tune_results.xml)\n\n\
   -d            Diagnostics mode. Verify correctness of collective algorithms\n\
                 (Default: Disabled)\n\n\
-  -v            Verbose mode\n\
-                (Default: Disabled)\n\n\
-  -x            Checkpoint mode. Enable pami_tune checkpointing\n\
+  -p            Print the Collective Algorithm performance data to standard output\n\
                 (Default: Disabled)\n\n\
   -h            Print this help message\n\n", stdout);
 
@@ -1633,11 +1631,11 @@ static int MPIDI_collsel_process_ini_file(const char *filename, advisor_params_t
       if(params->verify == -1)
         ret = MPIDI_collsel_checkvalue(name, value, filename, &params->verify);
     }
-    else if(strcmp(name, "checkpoint") == 0)
+    /*else if(strcmp(name, "checkpoint") == 0)
     {
       if(params->checkpoint == -1)
         ret = MPIDI_collsel_checkvalue(name, value, filename, &params->checkpoint);
-    }
+    }*/
     else
     {
       fprintf(stderr, "Invalid parameter: %s in file: %s\n", name, filename);
@@ -1660,7 +1658,7 @@ static int MPIDI_collsel_process_arg(int argc, char *argv[], advisor_params_t *p
    params->verify = 0;
 
    opterr = 0;
-   while ((c = getopt (argc, argv, "c:m:g:f:o:i:v::d::x::h::")) != -1)
+   while ((c = getopt (argc, argv, "c:m:g:f:o:i:p::d::x::h::")) != -1)
    {
      switch (c)
      {
@@ -1692,11 +1690,11 @@ static int MPIDI_collsel_process_arg(int argc, char *argv[], advisor_params_t *p
        case 'd':
          params->verify = 1;
          break;
-       case 'v':
+       case 'p':
          params->verbose = 1;
          break;
        case 'x':
-         params->checkpoint = 1;
+         /*params->checkpoint = 1;*/
          break;
        case 'h':
          ret = 2;

http://git.mpich.org/mpich.git/commitdiff/bfa19b4415a3ab2d95cd1ad456787f788b5a9bf3

commit bfa19b4415a3ab2d95cd1ad456787f788b5a9bf3
Author: Michael Blocksome <blocksom at us.ibm.com>
Date:   Wed May 8 10:49:40 2013 -0500

    Check for assert only if asserts are enabled.

diff --git a/src/mpid/pamid/include/mpidimpl.h b/src/mpid/pamid/include/mpidimpl.h
index 55d676c..c9c9f14 100644
--- a/src/mpid/pamid/include/mpidimpl.h
+++ b/src/mpid/pamid/include/mpidimpl.h
@@ -171,8 +171,10 @@ static inline pami_endpoint_t MPIDI_Task_to_endpoint(pami_task_t task, size_t of
   pami_endpoint_t ep;
   pami_result_t   rc;
   rc = PAMI_Endpoint_create(MPIDI_Client, task, 0, &ep);
+#if ASSERT_LEVEL > 0
   if(rc != PAMI_SUCCESS)
     MPID_Abort (NULL, 0, 1, "MPIDI_Task_to_endpoint:  Invalid task/offset.  No endpoint found");
+#endif
   return ep;
 }
 

http://git.mpich.org/mpich.git/commitdiff/5a63aaf051c3efd62d18b632a8539eb373a5cbb0

commit 5a63aaf051c3efd62d18b632a8539eb373a5cbb0
Author: Charles Archer <archerc at us.ibm.com>
Date:   Sun Apr 14 16:05:00 2013 -0400

    Use pami_endpoint_t for root instead of incorrect pami_task_t
    
    (ibm) D189828
    (ibm) 51d29ce7faf74d2d2c8a02798cd7880e1a5f3783
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/include/mpidimpl.h b/src/mpid/pamid/include/mpidimpl.h
index aef965a..55d676c 100644
--- a/src/mpid/pamid/include/mpidimpl.h
+++ b/src/mpid/pamid/include/mpidimpl.h
@@ -165,4 +165,16 @@ int MPIDI_PG_Get_size(MPIDI_PG_t * pg);
 #define MPIDI_PG_Get_size(pg_) ((pg_)->size)
 #endif  /** DYNAMIC_TASKING **/
 
+
+static inline pami_endpoint_t MPIDI_Task_to_endpoint(pami_task_t task, size_t offset)
+{
+  pami_endpoint_t ep;
+  pami_result_t   rc;
+  rc = PAMI_Endpoint_create(MPIDI_Client, task, 0, &ep);
+  if(rc != PAMI_SUCCESS)
+    MPID_Abort (NULL, 0, 1, "MPIDI_Task_to_endpoint:  Invalid task/offset.  No endpoint found");
+  return ep;
+}
+
+
 #endif
diff --git a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
index 1c943bd..fc7a237 100644
--- a/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
+++ b/src/mpid/pamid/src/coll/bcast/mpido_bcast.c
@@ -134,7 +134,7 @@ int MPIDO_Bcast(void *buffer,
 
    bcast.cb_done = cb_bcast;
    bcast.cookie = (void *)&active;
-   bcast.cmd.xfer_broadcast.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   bcast.cmd.xfer_broadcast.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    bcast.algorithm = mpid->user_selected[PAMI_XFER_BROADCAST];
    bcast.cmd.xfer_broadcast.buf = data_buffer;
    bcast.cmd.xfer_broadcast.type = PAMI_TYPE_BYTE;
@@ -334,7 +334,7 @@ int MPIDO_Bcast_simple(void *buffer,
 
    bcast.cb_done = cb_bcast;
    bcast.cookie = (void *)&active;
-   bcast.cmd.xfer_broadcast.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   bcast.cmd.xfer_broadcast.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    bcast.algorithm = mpid->coll_algorithm[PAMI_XFER_BROADCAST][0][0];
    bcast.cmd.xfer_broadcast.buf = data_buffer;
    bcast.cmd.xfer_broadcast.type = PAMI_TYPE_BYTE;
diff --git a/src/mpid/pamid/src/coll/gather/mpido_gather.c b/src/mpid/pamid/src/coll/gather/mpido_gather.c
index 8829c2b..ac28c70 100644
--- a/src/mpid/pamid/src/coll/gather/mpido_gather.c
+++ b/src/mpid/pamid/src/coll/gather/mpido_gather.c
@@ -240,7 +240,7 @@ int MPIDO_Gather(const void *sendbuf,
 
    gather.cb_done = cb_gather;
    gather.cookie = (void *)&active;
-   gather.cmd.xfer_gather.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   gather.cmd.xfer_gather.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    if(sendbuf == MPI_IN_PLACE) 
    {
      if(unlikely(verbose))
@@ -480,7 +480,7 @@ int MPIDO_Gather_simple(const void *sendbuf,
 
    gather.cb_done = cb_gather;
    gather.cookie = (void *)&active;
-   gather.cmd.xfer_gather.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   gather.cmd.xfer_gather.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    gather.cmd.xfer_gather.stypecount = send_size;/* stypecount is ignored when sndbuf == PAMI_IN_PLACE */
    gather.cmd.xfer_gather.sndbuf = (void *)sbuf;
    if(sendbuf == MPI_IN_PLACE) 
diff --git a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
index 34b77bf..71caf3a 100644
--- a/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
+++ b/src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c
@@ -89,7 +89,7 @@ int MPIDO_Gatherv(const void *sendbuf,
 
    gatherv.cb_done = cb_gatherv;
    gatherv.cookie = (void *)&gatherv_active;
-   gatherv.cmd.xfer_gatherv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   gatherv.cmd.xfer_gatherv_int.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    gatherv.cmd.xfer_gatherv_int.rcvbuf = rbuf;
    gatherv.cmd.xfer_gatherv_int.rtype = rtype;
    gatherv.cmd.xfer_gatherv_int.rtypecounts = (int *) recvcounts;
@@ -368,7 +368,7 @@ int MPIDO_Gatherv_simple(const void *sendbuf,
 
    gatherv.cb_done = cb_gatherv;
    gatherv.cookie = (void *)&gatherv_active;
-   gatherv.cmd.xfer_gatherv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   gatherv.cmd.xfer_gatherv_int.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    gatherv.cmd.xfer_gatherv_int.rcvbuf = rbuf;
    gatherv.cmd.xfer_gatherv_int.rtype = rtype;
    gatherv.cmd.xfer_gatherv_int.rtypecounts = (int *) rcounts;
diff --git a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
index c032354..b6a7cd2 100644
--- a/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
+++ b/src/mpid/pamid/src/coll/reduce/mpido_reduce.c
@@ -142,7 +142,7 @@ int MPIDO_Reduce(const void *sendbuf,
    reduce.cmd.xfer_reduce.stypecount = count;
    reduce.cmd.xfer_reduce.rtypecount = count;
    reduce.cmd.xfer_reduce.op = pop;
-   reduce.cmd.xfer_reduce.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   reduce.cmd.xfer_reduce.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
 
 
    if(unlikely(queryreq == MPID_COLL_ALWAYS_QUERY || 
@@ -302,7 +302,7 @@ int MPIDO_Reduce_simple(const void *sendbuf,
    reduce.cmd.xfer_reduce.stypecount = count;
    reduce.cmd.xfer_reduce.rtypecount = count;
    reduce.cmd.xfer_reduce.op = pop;
-   reduce.cmd.xfer_reduce.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   reduce.cmd.xfer_reduce.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    my_reduce_md = &mpid->coll_metadata[PAMI_XFER_REDUCE][0][0];
 
    TRACE_ERR("%s reduce, context %d, algoname: %s, exflag: %d\n", MPIDI_Process.context_post.active>0?"Posting":"Invoking", 0,
diff --git a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
index 15d8366..5f3be7d 100644
--- a/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
+++ b/src/mpid/pamid/src/coll/scatter/mpido_scatter.c
@@ -209,7 +209,7 @@ int MPIDO_Scatter(const void *sendbuf,
    scatter.algorithm = my_scatter;
    scatter.cb_done = cb_scatter;
    scatter.cookie = (void *)&scatter_active;
-   scatter.cmd.xfer_scatter.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   scatter.cmd.xfer_scatter.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    scatter.cmd.xfer_scatter.sndbuf = (void *)sendbuf;
    scatter.cmd.xfer_scatter.stype = stype;
    scatter.cmd.xfer_scatter.stypecount = sendcount;
@@ -459,7 +459,7 @@ int MPIDO_Scatter_simple(const void *sendbuf,
 
    scatter.cb_done = cb_scatter;
    scatter.cookie = (void *)&scatter_active;
-   scatter.cmd.xfer_scatter.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   scatter.cmd.xfer_scatter.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
    scatter.cmd.xfer_scatter.sndbuf = (void *)sbuf;
    scatter.cmd.xfer_scatter.stype = PAMI_TYPE_BYTE;
    scatter.cmd.xfer_scatter.stypecount = send_size;
diff --git a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
index bc47e41..49ddb89 100644
--- a/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
+++ b/src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c
@@ -339,7 +339,7 @@ int MPIDO_Scatterv(const void *sendbuf,
 
    scatterv.cb_done = cb_scatterv;
    scatterv.cookie = (void *)&scatterv_active;
-   scatterv.cmd.xfer_scatterv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   scatterv.cmd.xfer_scatterv_int.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
 
    scatterv.algorithm = my_scatterv;
 
@@ -560,7 +560,7 @@ int MPIDO_Scatterv_simple(const void *sendbuf,
 
    scatterv.cb_done = cb_scatterv;
    scatterv.cookie = (void *)&scatterv_active;
-   scatterv.cmd.xfer_scatterv_int.root = MPID_VCR_GET_LPID(comm_ptr->vcr, root);
+   scatterv.cmd.xfer_scatterv_int.root = MPIDI_Task_to_endpoint(MPID_VCR_GET_LPID(comm_ptr->vcr, root), 0);
 
    scatterv.algorithm = mpid->coll_algorithm[PAMI_XFER_SCATTERV_INT][0][0];
    my_scatterv_md = &mpid->coll_metadata[PAMI_XFER_SCATTERV_INT][0][0];

http://git.mpich.org/mpich.git/commitdiff/d92aabf2eb291c603487ad9e41e8d8a35a7e0a66

commit d92aabf2eb291c603487ad9e41e8d8a35a7e0a66
Author: Sameh Sharkawi <sssharka at us.ibm.com>
Date:   Fri Apr 12 12:39:55 2013 -0400

    Need service variables for all collectives
    
    (ibm) D189833
    (ibm) 7Z8
    (ibm) 9e89a54cd839c58e0c0573b09f39e4adf6e012e3
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/comm/mpid_comm.c b/src/mpid/pamid/src/comm/mpid_comm.c
index a8be80c..201aecc 100644
--- a/src/mpid/pamid/src/comm/mpid_comm.c
+++ b/src/mpid/pamid/src/comm/mpid_comm.c
@@ -397,7 +397,7 @@ void MPIDI_Coll_comm_destroy(MPID_Comm *comm)
    }
 
 
-   if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE)
+   if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE && comm->local_size > 1)
    {
      /* Destroy the fast query object. */
      pami_extension_collsel_query_destroy pamix_collsel_query_destroy =
diff --git a/src/mpid/pamid/src/comm/mpid_selectcolls.c b/src/mpid/pamid/src/comm/mpid_selectcolls.c
index b79cc76..4569a0b 100644
--- a/src/mpid/pamid/src/comm/mpid_selectcolls.c
+++ b/src/mpid/pamid/src/comm/mpid_selectcolls.c
@@ -312,7 +312,7 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
    }
    {
       TRACE_ERR("Checking alltaoll\n");
-      char* names[] = {"PAMID_COLLECTIVE_ALLTOALL", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_ALLTOALL", "MP_S_MPI_ALLTOALL", NULL};
       MPIDI_Check_protocols(names, comm, "alltoall", PAMI_XFER_ALLTOALL);
    }
    comm->mpid.optreduce = 0;
@@ -334,17 +334,17 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
    }
    {
       TRACE_ERR("Checking alltoallv\n");
-      char* names[] = {"PAMID_COLLECTIVE_ALLTOALLV", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_ALLTOALLV", "MP_S_MPI_ALLTOALLV", NULL};
       MPIDI_Check_protocols(names, comm, "alltoallv", PAMI_XFER_ALLTOALLV_INT);
    }
    {
       TRACE_ERR("Checking gatherv\n");
-      char* names[] = {"PAMID_COLLECTIVE_GATHERV",  NULL};
+      char* names[] = {"PAMID_COLLECTIVE_GATHERV",  "MP_S_MPI_GATHERV", NULL};
       MPIDI_Check_protocols(names, comm, "gatherv", PAMI_XFER_GATHERV_INT);
    }
    {
       TRACE_ERR("Checking scan\n");
-      char* names[] = {"PAMID_COLLECTIVE_SCAN", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_SCAN", "MP_S_MPI_SCAN", NULL};
       MPIDI_Check_protocols(names, comm, "scan", PAMI_XFER_SCAN);
    }
 
@@ -368,7 +368,7 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
       }
    }
    { /* In addition to glue protocols, check for other PAMI protocols and check for PE now */
-      char* names[] = {"PAMID_COLLECTIVE_SCATTERV", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_SCATTERV", "MP_S_MPI_SCATTERV", NULL};
       MPIDI_Check_protocols(names, comm, "scatterv", PAMI_XFER_SCATTERV_INT);
    }
    
@@ -385,7 +385,7 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
       }
    }
    { /* In addition to glue protocols, check for other PAMI protocols and check for PE now */
-      char* names[] = {"PAMID_COLLECTIVE_SCATTER", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_SCATTER", "MP_S_MPI_SCATTER", NULL};
       MPIDI_Check_protocols(names, comm, "scatter", PAMI_XFER_SCATTER);
    }
 
@@ -464,13 +464,13 @@ void MPIDI_Comm_coll_envvars(MPID_Comm *comm)
       }
    }
    { /* In addition to glue protocols, check for other PAMI protocols and check for PE now */
-      char* names[] = {"PAMID_COLLECTIVE_GATHER", NULL};
+      char* names[] = {"PAMID_COLLECTIVE_GATHER", "MP_S_MPI_GATHER", NULL};
       MPIDI_Check_protocols(names, comm, "gather", PAMI_XFER_GATHER);
    }
 
    /*   If automatic collective selection is enabled and user didn't specifically overwrite
       it, then use auto coll sel.. Otherwise, go through the manual coll sel code path. */
-   if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE)
+   if(MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_NONE && MPIDI_Process.optimized.auto_select_colls != MPID_AUTO_SELECT_COLLS_TUNE && comm->local_size > 1)
    {
      /* Create a fast query object, cache it on the comm/geometry and use it in each collective */
      pami_extension_collsel_query_create pamix_collsel_query_create =

http://git.mpich.org/mpich.git/commitdiff/662d6ff062ec050ac84d9a45295b8f53d39e2554

commit 662d6ff062ec050ac84d9a45295b8f53d39e2554
Author: Haizhu Liu <haizhu at us.ibm.com>
Date:   Fri Apr 12 10:13:56 2013 -0400

    Thread level promoting w/dyn_tasking due to world exiting handler in separate thread
    
    (ibm) D189766
    (ibm) 623ef12fe24e80752c51b38db46926520e530136
    
    Signed-off-by: Michael Blocksome <blocksom at us.ibm.com>

diff --git a/src/mpid/pamid/src/mpid_init.c b/src/mpid/pamid/src/mpid_init.c
index 8925c48..e7bb3bc 100644
--- a/src/mpid/pamid/src/mpid_init.c
+++ b/src/mpid/pamid/src/mpid_init.c
@@ -1117,7 +1117,7 @@ int MPID_Init(int * argc,
   /* ----------------------------- */
   /* Initialize messager           */
   /* ----------------------------- */
-  if (MPIDI_Process.async_progress.mode == ASYNC_PROGRESS_MODE_TRIGGER)
+  if ( (MPIDI_Process.async_progress.mode == ASYNC_PROGRESS_MODE_TRIGGER) || mpidi_dynamic_tasking)
   {
     /* The 'trigger' async progress mode requires MPI_THREAD_MULTIPLE.
      * Silently promote the thread level.

-----------------------------------------------------------------------

Summary of changes:
 src/mpid/pamid/include/mpidimpl.h                  |   14 ++
 src/mpid/pamid/include/pamix.h                     |    1 +
 .../pamid/src/coll/allgather/mpido_allgather.c     |   12 +-
 .../pamid/src/coll/allgatherv/mpido_allgatherv.c   |  141 +++++++++---
 src/mpid/pamid/src/coll/alltoall/mpido_alltoall.c  |    8 +
 .../pamid/src/coll/alltoallv/mpido_alltoallv.c     |  236 +++++++++++++++++---
 src/mpid/pamid/src/coll/bcast/mpido_bcast.c        |    4 +-
 src/mpid/pamid/src/coll/coll_utils.c               |   20 +-
 src/mpid/pamid/src/coll/gather/mpido_gather.c      |   11 +-
 src/mpid/pamid/src/coll/gatherv/mpido_gatherv.c    |   58 ++++--
 src/mpid/pamid/src/coll/reduce/mpido_reduce.c      |    4 +-
 src/mpid/pamid/src/coll/scatter/mpido_scatter.c    |    4 +-
 src/mpid/pamid/src/coll/scatterv/mpido_scatterv.c  |    4 +-
 src/mpid/pamid/src/comm/mpid_comm.c                |    2 +-
 src/mpid/pamid/src/comm/mpid_selectcolls.c         |   16 +-
 src/mpid/pamid/src/dyntask/mpidi_port.c            |    7 +-
 src/mpid/pamid/src/mpid_init.c                     |    2 +-
 src/mpid/pamid/src/mpid_progress.c                 |   22 ++-
 src/mpid/pamid/src/mpidi_env.c                     |   34 +++-
 src/mpid/pamid/src/mpidi_util.c                    |   16 +-
 src/mpid/pamid/src/pt2pt/mpidi_callback_eager.c    |   29 +--
 src/mpid/pamid/src/pt2pt/mpidi_callback_rzv.c      |   10 +-
 src/mpid/pamid/src/pt2pt/mpidi_callback_short.c    |   18 +--
 src/mpid/pamid/src/pt2pt/mpidi_done.c              |    1 +
 src/mpid/pamid/src/pt2pt/mpidi_recv.h              |   26 ++-
 25 files changed, 534 insertions(+), 166 deletions(-)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list