Class wasm::ContextWrapper

class wasm::ContextWrapper

Convenience wrapper around the MPI context for use in the syscalls in this file.

Public Functions

inline explicit ContextWrapper()
inline void checkMpiComm(I32 wasmPtr)
inline faabric_datatype_t *getFaasmDataType(I32 wasmPtr)
inline void writeFaasmRequestId(I32 requestPtrPtr, I32 requestId)

We use a trick here to avoid allocating extra memory. Rather than create an actual struct for the MPI_Request, we just use the pointer to hold the value of its ID

inline I32 getFaasmRequestId(I32 requestPtrPtr)

This uses the same trick, where we read the value of the pointer as the request ID.

inline faabric_info_t *getFaasmInfoType(I32 wasmPtr)
inline faabric_op_t *getFaasmOp(I32 wasmOp)
template<typename T>
inline void writeMpiResult(I32 resPtr, T result)

Public Members

WAVMWasmModule *module
Runtime::Memory *memory
MpiWorld &world
int rank