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

« back to all changes in this revision

Viewing changes to src/mpid/pamid/src/coll/gather/mpido_igather.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/gather/mpido_igather.c
 
20
 * \brief ???
 
21
 */
 
22
 
 
23
#include <mpidimpl.h>
 
24
 
 
25
int MPIDO_Igather(const void *sendbuf,
 
26
                  int sendcount,
 
27
                  MPI_Datatype sendtype,
 
28
                  void *recvbuf,
 
29
                  int recvcount,
 
30
                  MPI_Datatype recvtype,
 
31
                  int root,
 
32
                  MPID_Comm *comm_ptr,
 
33
                  MPID_Request **request)
 
34
{
 
35
   /*if (unlikely((data_size == 0) || (user_selected_type == MPID_COLL_USE_MPICH)))*/
 
36
   {
 
37
      /*
 
38
       * If the mpich mpir non-blocking collectives are enabled, return without
 
39
       * first constructing the MPID_Request. This signals to the
 
40
       * MPIR_Igather_impl() function to invoke the mpich nbc implementation
 
41
       * of MPI_Igather().
 
42
       */
 
43
      if (MPIDI_Process.mpir_nbc != 0)
 
44
       return 0;
 
45
 
 
46
      /*
 
47
       * MPIR_* nbc implementation is not enabled. Fake a non-blocking
 
48
       * MPIR_Igather() with a blocking MPIR_Gather().
 
49
       */
 
50
      if(unlikely(MPIDI_Process.verbose >= MPIDI_VERBOSE_DETAILS_ALL && comm_ptr->rank == 0))
 
51
         fprintf(stderr,"Using MPICH blocking gather algorithm\n");
 
52
 
 
53
      int mpierrno = 0;
 
54
      int rc = MPIR_Gather_impl(sendbuf, sendcount, sendtype,
 
55
                                recvbuf, recvcount, recvtype,
 
56
                                root, comm_ptr, &mpierrno);
 
57
 
 
58
      /*
 
59
       * The blocking gather has completed - create and complete a
 
60
       * MPID_Request object so the MPIR_Igather_impl() function does not
 
61
       * perform an additional igather.
 
62
       */
 
63
      MPID_Request * mpid_request = MPID_Request_create_inline();
 
64
      mpid_request->kind = MPID_COLL_REQUEST;
 
65
      *request = mpid_request;
 
66
      MPIDI_Request_complete_norelease_inline(mpid_request);
 
67
 
 
68
      return rc;
 
69
   }
 
70
 
 
71
   return 0;
 
72
}