source: proiecte/hpl/openmpi_compiled/include/openmpi/ompi/mpi/cxx/op_inln.h @ 97

Last change on this file since 97 was 97, checked in by (none), 14 years ago

Adding compiled files

File size: 3.1 KB
Line 
1// -*- c++ -*-
2//
3// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
4//                         University Research and Technology
5//                         Corporation.  All rights reserved.
6// Copyright (c) 2004-2005 The University of Tennessee and The University
7//                         of Tennessee Research Foundation.  All rights
8//                         reserved.
9// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
10//                         University of Stuttgart.  All rights reserved.
11// Copyright (c) 2004-2005 The Regents of the University of California.
12//                         All rights reserved.
13// Copyright (c) 2006      Cisco Systems, Inc.  All rights reserved.
14// $COPYRIGHT$
15//
16// Additional copyrights may follow
17//
18// $HEADER$
19//
20
21#if 0 /* OMPI_ENABLE_MPI_PROFILING */
22
23inline
24MPI::Op::Op() { }
25 
26inline
27MPI::Op::Op(const MPI::Op& o) : pmpi_op(o.pmpi_op) { }
28 
29inline
30MPI::Op::Op(MPI_Op o) : pmpi_op(o) { }
31
32inline
33MPI::Op::~Op() { }
34
35inline
36MPI::Op& MPI::Op::operator=(const MPI::Op& op) {
37  pmpi_op = op.pmpi_op; return *this;
38}
39
40// comparison
41inline bool
42MPI::Op::operator== (const MPI::Op &a) {
43  return (bool)(pmpi_op == a.pmpi_op);
44}
45
46inline bool
47MPI::Op::operator!= (const MPI::Op &a) {
48  return (bool)!(*this == a);
49}
50
51// inter-language operability
52inline MPI::Op&
53MPI::Op::operator= (const MPI_Op &i) { pmpi_op = i; return *this; }
54
55inline
56MPI::Op::operator MPI_Op () const { return pmpi_op; }
57
58//inline
59//MPI::Op::operator MPI_Op* () { return pmpi_op; }
60
61
62#else  // ============= NO PROFILING ===================================
63
64// construction
65inline
66MPI::Op::Op() : mpi_op(MPI_OP_NULL) { }
67
68inline
69MPI::Op::Op(MPI_Op i) : mpi_op(i) { }
70
71inline
72MPI::Op::Op(const MPI::Op& op)
73  : mpi_op(op.mpi_op) { }
74
75inline 
76MPI::Op::~Op() 
77{ 
78#if 0
79  mpi_op = MPI_OP_NULL;
80  op_user_function = 0;
81#endif
82} 
83
84inline MPI::Op&
85MPI::Op::operator=(const MPI::Op& op) {
86  mpi_op = op.mpi_op;
87  return *this;
88}
89
90// comparison
91inline bool
92MPI::Op::operator== (const MPI::Op &a) { return (bool)(mpi_op == a.mpi_op); }
93
94inline bool
95MPI::Op::operator!= (const MPI::Op &a) { return (bool)!(*this == a); }
96
97// inter-language operability
98inline MPI::Op&
99MPI::Op::operator= (const MPI_Op &i) { mpi_op = i; return *this; }
100
101inline
102MPI::Op::operator MPI_Op () const { return mpi_op; }
103
104//inline
105//MPI::Op::operator MPI_Op* () { return &mpi_op; }
106
107#endif
108
109// Extern this function here rather than include an internal Open MPI
110// header file (and therefore force installing the internal Open MPI
111// header file so that user apps can #include it)
112
113extern "C" void ompi_op_set_cxx_callback(MPI_Op op, MPI_User_function*);
114
115// There is a lengthy comment in ompi/mpi/cxx/intercepts.cc explaining
116// what this function is doing.  Please read it before modifying this
117// function.
118inline void
119MPI::Op::Init(MPI::User_function *func, bool commute)
120{
121    (void)MPI_Op_create((MPI_User_function*) ompi_mpi_cxx_op_intercept, 
122                        (int) commute, &mpi_op);
123    ompi_op_set_cxx_callback(mpi_op, (MPI_User_function*) func);
124}
125
126
127inline void
128MPI::Op::Free()
129{
130  (void)MPI_Op_free(&mpi_op);
131}
Note: See TracBrowser for help on using the repository browser.