~ubuntu-branches/ubuntu/raring/rheolef/raring-proposed

« back to all changes in this revision

Viewing changes to skit/plib2/mpi_polymorphic_scatter_end.h

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Saramito
  • Date: 2011-03-23 11:14:26 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20110323111426-cjvhey7lxt6077ty
Tags: 5.93-1
* New upstream release (minor changes):
  - some extra warning message deleted in heap_allocator
  - graphic output with mayavi2 fixed
  - add doc refman in .info and .pdf format

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
NAME: mpi_polymorphic_scatter_end -- gather/scatter finalize (@PACKAGE@ @VERSION@)
28
28
DESCRIPTION:
29
29
  Finishes communication
30
 
  for parallel to sequential scatter context.
 
30
  for distributed to sequential scatter context.
31
31
AUTHORS:
32
32
    LMC-IMAG, 38041 Grenoble cedex 9, France
33
33
    | Pierre.Saramito@imag.fr
44
44
    Message&            to,
45
45
    const communicator& comm) const
46
46
  {
47
 
warning_macro ("mpi_scatter_end...");
48
47
    typedef typename Container::size_type size_type;
49
48
    const size_type _n_variant = N;
50
49
 
58
57
    // -----------------------------------------------------------
59
58
    // 1) wait on receives and unpack receives into local space
60
59
    // -----------------------------------------------------------
61
 
warning_macro ("mpi_scatter_end[1] wait on recv");
62
 
warning_macro ("mpi_scatter_end[1] n_data="<<from.n_data());
63
60
    y.resize (from.n_data());
64
 
warning_macro ("mpi_scatter_end[1] y.size="<<y.size()<<", y.par_size="<<y.ownership().par_size());
65
61
#define _RHEOLEF_wait_recv(z,k,unused)                                          \
66
62
    while (from.requests[k].size() != 0) {                                      \
67
63
        typedef std::pair<size_type,T##k> data_type; /* the data to be received are of type Tk */       \
89
85
            size_type  i       = from.values._stack_##k [jk].first + first_i;           \
90
86
            const T##k value   = from.values._stack_##k [jk].second;                    \
91
87
            size_type  perm_i  = from.indices[i];                                               \
92
 
            warning_macro ("recv[i_recv="<<i_recv<<",first_i="<<first_i<<",k="<<k<<",iloc="<<iloc<<"]: y["<<perm_i<<"] := from.value["<<i<<"] = "<<value);      \
93
88
            y[perm_i] = value;                                                          \
94
89
        }                                                                               \
95
90
        from.requests[k].erase (pair_ptr);                                              \
100
95
    // -----------------------------------------------------------
101
96
    // 2) wait on sends 
102
97
    // -----------------------------------------------------------
103
 
warning_macro ("mpi_scatter_end[1] wait on send");
104
98
    for (size_type k = 0; k < _n_variant; k++) {
105
99
       request_iterator iter_s_waits (to.requests[k].begin(), select2nd<size_t,mpi::request>()),
106
100
                        last_s_waits (to.requests[k].end(),   select2nd<size_t,mpi::request>());
107
101
       mpi::wait_all (iter_s_waits, last_s_waits);
108
102
    }
109
 
warning_macro ("mpi_scatter_end done");
110
103
  }
111
104
};
112
105
#endif // _RHEOLEF_HAVE_MPI