Advanced Multi-Physics (AMP)
On-Line Documentation
AsynchronousOperator.h
Go to the documentation of this file.
1#ifndef included_AMP_AsynchronousOperator
2#define included_AMP_AsynchronousOperator
3
4#include "AMP/operators/AsynchronousOperatorParameters.h"
5#include "AMP/operators/Operator.h"
6#include "AMP/utils/AMP_MPI.h"
7
8#include <vector>
9
10
11namespace AMP::Operator {
12
13
18{
19protected:
22 std::vector<AMP_MPI::Request> d_RequestList;
23
27 void reserveRequests( size_t i );
28
32
36 std::vector<AMP_MPI::Request>::iterator beginRequests();
37
41 std::vector<AMP_MPI::Request>::iterator endRequests();
42
47
51
52
58 template<typename T>
60 {
61 T *retVal = 0;
62 if ( in.size() > 0 )
63 retVal = &( in[0] );
64 return retVal;
65 }
66
72 template<typename T>
73 const T *getBufferToAvoidDebugVectorCrashing( const std::vector<T> &in )
74 {
75 const T *retVal = 0;
76 if ( in.size() > 0 )
77 retVal = &( in[0] );
78 return retVal;
79 }
80
81
82public:
83 explicit AsynchronousOperator( std::shared_ptr<const OperatorParameters> params );
84
86
88 std::string type() const override { return "AsynchronousOperator"; }
89
98
108
117};
118} // namespace AMP::Operator
119
120
121#endif
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::shared_ptr< const Vector > const_shared_ptr
Definition Vector.h:65
A class that allows for overlapped communication.
virtual void apply(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f) override
Apply operation.
T * getBufferToAvoidDebugVectorCrashing(std::vector< T > &in)
Functions to allow std::vector to be used in MPI communications when empty.
AsynchronousOperator(std::shared_ptr< const OperatorParameters > params)
AMP_MPI::Request & getRequest(size_t i)
Return a specific MPI_Request.
std::vector< AMP_MPI::Request >::iterator beginRequests()
Return an iterator to the first MPI_Request.
virtual void applyFinish(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f)=0
Finish a communicative apply operation.
const T * getBufferToAvoidDebugVectorCrashing(const std::vector< T > &in)
Functions to allow std::vector to be used in MPI communications when empty.
std::vector< AMP_MPI::Request > d_RequestList
A list of MPI_Requests for use in derived classes.
std::vector< AMP_MPI::Request >::iterator endRequests()
Return an iterator to one past the end of the list of requests.
std::string type() const override
Return the name of the operator.
virtual void applyStart(AMP::LinearAlgebra::Vector::const_shared_ptr u, AMP::LinearAlgebra::Vector::shared_ptr f)=0
Start a communicative apply operation.
void waitForAllRequests()
Wait for all requests to complete.
void clearRequests()
Clear requests.
void reserveRequests(size_t i)
Reserve a number of MPI_Requests for use.
std::shared_ptr< AMP::Operator::Operator > shared_ptr
Definition Operator.h:29



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:41.
Comments on this page