Fix for ticket #219 MPI::Grequest is missing from C++ API. I did the initial implementation and Jeff fixed it up. Passes a new test in trunk/simple/basic/cxx/grequest.cc.
This commit was SVN r12264.
Этот коммит содержится в:
родитель
9cf3040e5f
Коммит
272f766c5f
@ -121,6 +121,7 @@ namespace MPI {
|
||||
class Group;
|
||||
class Op;
|
||||
class Request;
|
||||
class Grequest;
|
||||
class Status;
|
||||
class Info;
|
||||
class Win;
|
||||
|
@ -191,3 +191,28 @@ private:
|
||||
PMPI::Prequest pmpi_request;
|
||||
#endif
|
||||
};
|
||||
|
||||
class Grequest : public MPI::Request {
|
||||
public:
|
||||
typedef int Query_function(void *, Status&);
|
||||
typedef int Free_function(void *);
|
||||
typedef int Cancel_function(void *, bool);
|
||||
|
||||
Grequest() {}
|
||||
Grequest(const Request& req) : Request(req) {}
|
||||
Grequest(const MPI_Request &req) : Request(req) {}
|
||||
virtual ~Grequest() {}
|
||||
|
||||
Grequest& operator=(const Request& req) {
|
||||
mpi_request = req; return(*this);
|
||||
}
|
||||
|
||||
Grequest& operator=(const Grequest& req) {
|
||||
mpi_request = req.mpi_request; return(*this);
|
||||
}
|
||||
|
||||
static Grequest Start(Query_function *, Free_function *,
|
||||
Cancel_function *, void *);
|
||||
|
||||
virtual void Complete();
|
||||
};
|
||||
|
@ -330,4 +330,22 @@ inline bool MPI::Request::Get_status() const
|
||||
return OPAL_INT_TO_BOOL(flag);
|
||||
}
|
||||
|
||||
inline MPI::Grequest
|
||||
MPI::Grequest::Start(Query_function *query_fn, Free_function *free_fn,
|
||||
Cancel_function *cancel_fn, void *extra)
|
||||
{
|
||||
MPI_Request grequest = 0;
|
||||
|
||||
(void) MPI_Grequest_start((MPI_Grequest_query_function *) query_fn,
|
||||
(MPI_Grequest_free_function *) free_fn,
|
||||
(MPI_Grequest_cancel_function *) cancel_fn, extra, &grequest);
|
||||
|
||||
return(grequest);
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Grequest::Complete()
|
||||
{
|
||||
(void) MPI_Grequest_complete(mpi_request);
|
||||
}
|
||||
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user