~ubuntu-branches/ubuntu/hardy/openmpi/hardy-updates

« back to all changes in this revision

Viewing changes to ompi/mpi/f77/accumulate_f.c

  • Committer: Bazaar Package Importer
  • Author(s): Mark Hymers
  • Date: 2006-10-15 00:46:11 UTC
  • Revision ID: james.westby@ubuntu.com-20061015004611-uuhxnaxyjmuxfd5h
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
 
3
 *                         University Research and Technology
 
4
 *                         Corporation.  All rights reserved.
 
5
 * Copyright (c) 2004-2005 The University of Tennessee and The University
 
6
 *                         of Tennessee Research Foundation.  All rights
 
7
 *                         reserved.
 
8
 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 
 
9
 *                         University of Stuttgart.  All rights reserved.
 
10
 * Copyright (c) 2004-2005 The Regents of the University of California.
 
11
 *                         All rights reserved.
 
12
 * $COPYRIGHT$
 
13
 * 
 
14
 * Additional copyrights may follow
 
15
 * 
 
16
 * $HEADER$
 
17
 */
 
18
 
 
19
#include "ompi_config.h"
 
20
 
 
21
#include "ompi/mpi/f77/bindings.h"
 
22
#include "ompi/mpi/f77/constants.h"
 
23
 
 
24
 
 
25
#if OMPI_HAVE_WEAK_SYMBOLS && OMPI_PROFILE_LAYER
 
26
#pragma weak PMPI_ACCUMULATE = mpi_accumulate_f
 
27
#pragma weak pmpi_accumulate = mpi_accumulate_f
 
28
#pragma weak pmpi_accumulate_ = mpi_accumulate_f
 
29
#pragma weak pmpi_accumulate__ = mpi_accumulate_f
 
30
#elif OMPI_PROFILE_LAYER
 
31
OMPI_GENERATE_F77_BINDINGS (PMPI_ACCUMULATE,
 
32
                           pmpi_accumulate,
 
33
                           pmpi_accumulate_,
 
34
                           pmpi_accumulate__,
 
35
                           pmpi_accumulate_f,
 
36
                           (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr),
 
37
                           (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, ierr) )
 
38
#endif
 
39
 
 
40
#if OMPI_HAVE_WEAK_SYMBOLS
 
41
#pragma weak MPI_ACCUMULATE = mpi_accumulate_f
 
42
#pragma weak mpi_accumulate = mpi_accumulate_f
 
43
#pragma weak mpi_accumulate_ = mpi_accumulate_f
 
44
#pragma weak mpi_accumulate__ = mpi_accumulate_f
 
45
#endif
 
46
 
 
47
#if ! OMPI_HAVE_WEAK_SYMBOLS && ! OMPI_PROFILE_LAYER
 
48
OMPI_GENERATE_F77_BINDINGS (MPI_ACCUMULATE,
 
49
                           mpi_accumulate,
 
50
                           mpi_accumulate_,
 
51
                           mpi_accumulate__,
 
52
                           mpi_accumulate_f,
 
53
                           (char *origin_addr, MPI_Fint *origin_count, MPI_Fint *origin_datatype, MPI_Fint *target_rank, MPI_Fint *target_disp, MPI_Fint *target_count, MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win, MPI_Fint *ierr),
 
54
                           (origin_addr, origin_count, origin_datatype, target_rank, target_disp, target_count, target_datatype, op, win, ierr) )
 
55
#endif
 
56
 
 
57
 
 
58
#if OMPI_PROFILE_LAYER && ! OMPI_HAVE_WEAK_SYMBOLS
 
59
#include "ompi/mpi/f77/profile/defines.h"
 
60
#endif
 
61
 
 
62
void mpi_accumulate_f(char *origin_addr, MPI_Fint *origin_count,
 
63
                      MPI_Fint *origin_datatype, MPI_Fint *target_rank,
 
64
                      MPI_Fint *target_disp, MPI_Fint *target_count,
 
65
                      MPI_Fint *target_datatype, MPI_Fint *op, MPI_Fint *win,
 
66
                      MPI_Fint *ierr)
 
67
{
 
68
    MPI_Datatype c_origin_datatype = MPI_Type_f2c(*origin_datatype);
 
69
    MPI_Datatype c_target_datatype = MPI_Type_f2c(*target_datatype);
 
70
    MPI_Win c_win = MPI_Win_f2c(*win);
 
71
    MPI_Op c_op = MPI_Op_f2c(*op);
 
72
 
 
73
    *ierr = OMPI_INT_2_FINT(MPI_Accumulate(OMPI_ADDR(origin_addr), 
 
74
                                           OMPI_FINT_2_INT(*origin_count),
 
75
                                           c_origin_datatype, 
 
76
                                           OMPI_FINT_2_INT(*target_rank),
 
77
                                           (MPI_Aint) *target_disp,
 
78
                                           OMPI_FINT_2_INT(*target_count),
 
79
                                           c_target_datatype, c_op, c_win));
 
80
}