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-2009 Cisco Systems, Inc. All rights reserved.
14 // $COPYRIGHT$
15 //
16 // Additional copyrights may follow
17 //
18 // $HEADER$
19 //
20
21 class Op {
22 public:
23
24 // construction
25 Op();
26 Op(MPI_Op i);
27 Op(const Op& op);
28 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
29 Op(const PMPI::Op& op) : pmpi_op(op) { }
30 #endif
31 // destruction
32 virtual ~Op();
33 // assignment
34 Op& operator=(const Op& op);
35 Op& operator= (const MPI_Op &i);
36 // comparison
37 inline bool operator== (const Op &a);
38 inline bool operator!= (const Op &a);
39 // conversion functions for inter-language operability
40 inline operator MPI_Op () const;
41 // inline operator MPI_Op* (); //JGS const
42 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
43 inline operator const PMPI::Op&() const { return pmpi_op; }
44 #endif
45 // Collective Communication
46 //JGS took const out
47 virtual void Init(User_function *func, bool commute);
48 virtual void Free();
49
50 virtual void Reduce_local(const void *inbuf, void *inoutbuf, int count,
51 const MPI::Datatype& datatype) const;
52 virtual bool Is_commutative(void) const;
53
54 #if ! 0 /* OMPI_ENABLE_MPI_PROFILING */
55 protected:
56 MPI_Op mpi_op;
57 #endif
58
59 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
60 private:
61 PMPI::Op pmpi_op;
62 #endif
63
64 };
65