This section presents functions that provide the actual RDMA operations.
For hardware architectures that support these operations these functions
provide a standard interface to the operations, while for NIC architectures that
do not support RDMA operations, we provide an emulated implementation.
There are three types of NIC architectures based on how much support they
provide for RDMA operations:
Hardware support for both Get and Put operations.
Hardware support for one of the two operations, mostly for Put. For these
the other RDMA operation is emulated by using the operation that is implemented
in hardware and extra messages.
No hardware support for any RDMA operation. For these, both the RDMA operations
are emulated through messages.
There are two different sets of RDMA operations
The first set of RDMA operations return an opaque handle to the programmer,
which can only be used to verify if the operation is complete. This suits
AMPI better and closely follows the idea of separating communication
from synchronization. So, the user program needs to keep track of
synchronization.
The second set of RDMA operations do not return anything, instead they
provide a callback when the operation completes. This suits nicely the charm++
framework of sending asynchronous messages. The handler(callback) will be
automatically invoked when the operation completes.
For machine layer developer: Internally, every machine layer is free
to create a suitable data structure for this purpose. This is the reason this
has been kept opaque from the programmer.
void *CmiPut(unsinged int sourceId, unsigned int targetId, void *Saddr, void *Taadr, unsigned int size);
This function is pretty self explanatory. It puts the memory location
at Saddr on the machine specified by sourceId to Taddr on
the machine specified by targetId. The memory region being RDMA'ed is
of length size bytes.
void *CmiGet(unsinged int sourceId, unsigned int targetId, void *Saddr, void *Taadr, unsigned int size);
Similar to CmiPut except the direction of the data transfer
is opposite; from target to source.
void CmiPutCb(unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size, CmiRdmaCallbackFn fn, void *param);
Similar to CmiPut except a callback is called when the operation
completes.
void CmiGetCb(unsigned int sourceId, unsigned int targetId, void *Saddr, void *Taddr, unsigned int size, CmiRdmaCallbackFn fn, void *param);
Similar to CmiGet except a callback is called when the operation
completes.