 #pragma once
#include "ThirdPartyHeadersBegin.h"
#include <mpi.h>
#include <boost/function.hpp>
#include <boost/shared_ptr.hpp>
#include "ThirdPartyHeadersEnd.h"
#include "SimpleVector.h"
namespace tecplot { namespace teciompi { class MPINonBlockingCommunicationCollection { private: class MPINonBlockingCommunication { public: MPINonBlockingCommunication() : m_other(0), m_tag(0) {} MPINonBlockingCommunication( int ___2888, int tag
 #if defined _DEBUG
, char const* sendOrReceive
 #endif
) : m_other(___2888) , m_tag(tag)
 #if defined _DEBUG
, m_sendOrReceive(sendOrReceive)
 #endif
{} virtual ~MPINonBlockingCommunication() {} virtual bool isComplete() = 0; virtual void ___4446() = 0; int m_other; int m_tag;
 #if defined _DEBUG
std::string m_sendOrReceive;
 #endif
}; template <typename T> class MPINonBlockingSendScalar : public MPINonBlockingCommunication { public: MPINonBlockingSendScalar(T const& ___4298, int dest, int tag, MPI_Comm comm); virtual ~MPINonBlockingSendScalar(); virtual bool isComplete(); virtual void ___4446(); private: bool m_complete; MPI_Request m_request; }; template <typename T> class MPINonBlockingSendScalarCopy : public MPINonBlockingCommunication { public: MPINonBlockingSendScalarCopy(T ___4298, int dest, int tag, MPI_Comm comm); virtual ~MPINonBlockingSendScalarCopy(); virtual bool isComplete(); virtual void ___4446(); private: T m_val; MPINonBlockingSendScalar<T> m_sendScalar; }; template <typename T> class MPINonBlockingReceiveScalar : public MPINonBlockingCommunication { public: MPINonBlockingReceiveScalar(T& ___4298, int ___3656, int tag, MPI_Comm comm); virtual ~MPINonBlockingReceiveScalar(); virtual bool isComplete(); virtual void ___4446(); private: T& m_val; bool m_complete; MPI_Request m_request; }; template <typename T> class MPINonBlockingSendVector : public MPINonBlockingCommunication { public: MPINonBlockingSendVector(SimpleVector<T> const& vec, int dest, int sizeTag, int vecTag, MPI_Comm comm); virtual ~MPINonBlockingSendVector(); virtual bool isComplete(); virtual void ___4446(); private: SimpleVector<T> const& m_vec; bool m_complete; MPI_Request m_sizeRequest; MPI_Request m_vecRequest; }; template <typename T> class MPINonBlockingSendVectorCopy : public MPINonBlockingCommunication { public: MPINonBlockingSendVectorCopy(SimpleVector<T> const& vec, int dest, int sizeTag, int vecTag, MPI_Comm comm); MPINonBlockingSendVectorCopy(std::vector<T> const& vec, int dest, int sizeTag, int vecTag, MPI_Comm comm); virtual ~MPINonBlockingSendVectorCopy(); virtual bool isComplete(); virtual void ___4446(); private: SimpleVector<T> m_vec; MPINonBlockingSendVector<T> m_sendVector; }; template <typename T> class MPINonBlockingReceiveVector : public MPINonBlockingCommunication { private: typedef boost::function<int(MPI_Request*, int*, MPI_Status*)> CompleteFunction; bool tryToComplete(CompleteFunction completeFunction); public: MPINonBlockingReceiveVector(SimpleVector<T>& vec, int ___3656, int sizeTag, int vecTag, MPI_Comm comm); virtual ~MPINonBlockingReceiveVector(); virtual bool isComplete(); virtual void ___4446(); private: int m_size; SimpleVector<T>& m_vec; int m_src; int m_vecTag; MPI_Comm m_comm; bool m_complete; MPI_Request m_sizeRequest; MPI_Request m_vecRequest; }; public: MPINonBlockingCommunicationCollection(MPI_Comm communicator, int numRequests = 0); template<typename T> void sendScalar(T const& ___4298, int dest, int tag); template<typename T> void sendScalarCopy(T ___4298, int dest, int tag); template<typename T> void receiveScalar(T& ___4298, int ___3656, int tag); template<typename T> void sendVector(SimpleVector<T> const& vec, int dest, int sizeTag, int vecTag); template<typename T> void sendVectorCopy(SimpleVector<T> const& vec, int dest, int sizeTag, int vecTag); template<typename T> void sendVectorCopy(std::vector<T> const& str, int dest, int sizeTag, int vecTag); void sendStringCopy(std::string const& str, int dest, int sizeTag, int vecTag); template<typename T> void receiveVector(SimpleVector<T>& vec, int ___3656, int sizeTag, int vecTag); bool isComplete(); void ___4446(); private: MPI_Comm m_communicator; std::vector<boost::shared_ptr<MPINonBlockingCommunication> > m_requests; }; }}
