1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
#include <assert.h>
#include <string.h>
#include "comex.h"
#include "comex_impl.h"
int comex_putv(comex_giov_t *iov, int iov_len, int proc, comex_group_t group)
{
int i;
for (i=0; i<iov_len; ++i) {
int j;
void **src = iov[i].src;
void **dst = iov[i].dst;
int bytes = iov[i].bytes;
int limit = iov[i].count;
for (j=0; j<limit; ++j) {
assert(src[j] && dst[j] && bytes && limit);
comex_put(src[j], dst[j], bytes, proc, group);
}
}
return COMEX_SUCCESS;
}
int comex_getv(comex_giov_t *iov, int iov_len, int proc, comex_group_t group)
{
int i;
for (i=0; i<iov_len; ++i) {
int j;
void **src = iov[i].src;
void **dst = iov[i].dst;
int bytes = iov[i].bytes;
int limit = iov[i].count;
for (j=0; j<limit; ++j) {
comex_get(src[j], dst[j], bytes, proc, group);
}
}
return COMEX_SUCCESS;
}
int comex_accv(int datatype, void *scale, comex_giov_t *iov,
int iov_len, int proc, comex_group_t group)
{
int i;
for (i=0; i<iov_len; ++i) {
int j;
void **src = iov[i].src;
void **dst = iov[i].dst;
int bytes = iov[i].bytes;
int limit = iov[i].count;
for (j=0; j<limit; ++j) {
comex_acc(datatype, scale, src[j], dst[j], bytes, proc, group);
}
}
return COMEX_SUCCESS;
}
int comex_nbputv(comex_giov_t *iov, int iov_len, int proc, comex_group_t group, comex_request_t* handle)
{
return comex_putv(iov, iov_len, proc, group);
}
int comex_nbgetv(comex_giov_t *iov, int iov_len, int proc, comex_group_t group, comex_request_t* handle)
{
return comex_getv(iov, iov_len, proc, group);
}
int comex_nbaccv(int datatype, void *scale, comex_giov_t *iov,
int iov_len, int proc, comex_group_t group, comex_request_t* handle)
{
return comex_accv(datatype, scale, iov, iov_len, proc, group);
}
|