~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/mpid/pamid/src/coll/alltoall/mpido_ialltoall.c

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* begin_generated_IBM_copyright_prolog                             */
 
2
/*                                                                  */
 
3
/* This is an automatically generated copyright prolog.             */
 
4
/* After initializing,  DO NOT MODIFY OR MOVE                       */
 
5
/*  --------------------------------------------------------------- */
 
6
/* Licensed Materials - Property of IBM                             */
 
7
/* Blue Gene/Q 5765-PER 5765-PRP                                    */
 
8
/*                                                                  */
 
9
/* (C) Copyright IBM Corp. 2011, 2012 All Rights Reserved           */
 
10
/* US Government Users Restricted Rights -                          */
 
11
/* Use, duplication, or disclosure restricted                       */
 
12
/* by GSA ADP Schedule Contract with IBM Corp.                      */
 
13
/*                                                                  */
 
14
/*  --------------------------------------------------------------- */
 
15
/*                                                                  */
 
16
/* end_generated_IBM_copyright_prolog                               */
 
17
/*  (C)Copyright IBM Corp.  2007, 2011  */
 
18
/**
 
19
 * \file src/coll/alltoall/mpido_ialltoall.c
 
20
 * \brief ???
 
21
 */
 
22
 
 
23
/*#define TRACE_ON*/
 
24
 
 
25
#include <mpidimpl.h>
 
26
 
 
27
int MPIDO_Ialltoall(const void *sendbuf,
 
28
                    int sendcount,
 
29
                    MPI_Datatype sendtype,
 
30
                    void *recvbuf,
 
31
                    int recvcount,
 
32
                    MPI_Datatype recvtype,
 
33
                    MPID_Comm *comm_ptr,
 
34
                    MPID_Request **request)
 
35
{
 
36
   TRACE_ERR("Entering MPIDO_Ialltoall\n");
 
37
 
 
38
   /*if (unlikely((data_size == 0) || (user_selected_type == MPID_COLL_USE_MPICH)))*/
 
39
   {
 
40
      /*
 
41
       * If the mpich mpir non-blocking collectives are enabled, return without
 
42
       * first constructing the MPID_Request. This signals to the
 
43
       * MPIR_Ialltoall_impl() function to invoke the mpich nbc implementation
 
44
       * of MPI_Ialltoall().
 
45
       */
 
46
      if (MPIDI_Process.mpir_nbc != 0)
 
47
       return 0;
 
48
 
 
49
      /*
 
50
       * MPIR_* nbc implementation is not enabled. Fake a non-blocking
 
51
       * MPIR_Ialltoall() with a blocking MPIR_Alltoall().
 
52
       */
 
53
      if(unlikely(MPIDI_Process.verbose >= MPIDI_VERBOSE_DETAILS_ALL && comm_ptr->rank == 0))
 
54
         fprintf(stderr,"Using MPICH blocking alltoall algorithm\n");
 
55
 
 
56
      int mpierrno = 0;
 
57
      int rc = MPIR_Alltoall_impl(sendbuf, sendcount, sendtype,
 
58
                                  recvbuf, recvcount, recvtype,
 
59
                                  comm_ptr, &mpierrno);
 
60
 
 
61
      /*
 
62
       * The blocking allitoall has completed - create and complete a
 
63
       * MPID_Request object so the MPIR_Ialltoall_impl() function does not
 
64
       * perform an additional ialltoall.
 
65
       */
 
66
      MPID_Request * mpid_request = MPID_Request_create_inline();
 
67
      mpid_request->kind = MPID_COLL_REQUEST;
 
68
      *request = mpid_request;
 
69
      MPIDI_Request_complete_norelease_inline(mpid_request);
 
70
 
 
71
      return rc;
 
72
   }
 
73
 
 
74
   TRACE_ERR("Leaving MPIDO_Ialltoall\n");
 
75
   return 0;
 
76
}