IceTCommRequest icetCommIrecv(void *buf,
                              IceTSizeType count,
                              IceTEnum datatype,
                              int src,
                              int tag)
{
    IceTCommunicator comm = icetGetCommunicator();
    icetCommCheckCount(count);
    return comm->Irecv(comm, buf, (int)count, datatype, src, tag);
}
void icetCommAllgather(const void *sendbuf,
                       IceTSizeType sendcount,
                       int type,
                       void *recvbuf)
{
    IceTCommunicator comm = icetGetCommunicator();
    icetCommCheckCount(sendcount);
    icetAddSent(sendcount, type);
    comm->Allgather(comm, sendbuf, (int)sendcount, type, recvbuf);
}
IceTCommRequest icetCommIsend(const void *buf,
                              IceTSizeType count,
                              IceTEnum datatype,
                              int dest,
                              int tag)
{
    IceTCommunicator comm = icetGetCommunicator();
    icetCommCheckCount(count);
    icetAddSent(count, datatype);
    return comm->Isend(comm, buf, (int)count, datatype, dest, tag);
}
IceTContext icetCreateContext(IceTCommunicator comm)
{
    int idx;

    for (idx = 0; idx < num_contexts; idx++) {
        if (context_list[idx].state == NULL) {
            break;
        }
    }

    if (idx >= num_contexts) {
        num_contexts += 4;
        context_list = realloc(context_list,
                               num_contexts*sizeof(struct IceTContext));
        memset(context_list + idx, 0, 4 * sizeof(struct IceTContext));
    }

    context_list[idx].communicator = comm->Duplicate(comm);

    context_list[idx].buffer = NULL;
    context_list[idx].buffer_size = 0;
    context_list[idx].buffer_offset = 0;

    context_list[idx].display_inflate_texture = 0;

    context_list[idx].state = icetStateCreate();

    icetSetContext(idx);
    icetStateSetDefaults();

    return idx;
}
void icetCommSendrecv(const void *sendbuf,
                      IceTSizeType sendcount,
                      IceTEnum sendtype,
                      int dest,
                      int sendtag,
                      void *recvbuf,
                      IceTSizeType recvcount,
                      IceTEnum recvtype,
                      int src,
                      int recvtag)
{
    IceTCommunicator comm = icetGetCommunicator();
    icetCommCheckCount(sendcount);
    icetCommCheckCount(recvcount);
    icetAddSent(sendcount, sendtype);
    comm->Sendrecv(comm, sendbuf, (int)sendcount, sendtype, dest, sendtag,
                   recvbuf, (int)recvcount, recvtype, src, recvtag);
}
Exemple #6
0
IceTContext icetCreateContext(IceTCommunicator comm)
{
    IceTContext context = malloc(sizeof(struct IceTContextStruct));

    context->magic_number = CONTEXT_MAGIC_NUMBER;

    context->communicator = comm->Duplicate(comm);

    context->state = icetStateCreate();

    icetSetContext(context);
    icetStateSetDefaults();

    return context;
}
IceTCommunicator icetCommDuplicate()
{
    IceTCommunicator comm = icetGetCommunicator();
    return comm->Duplicate(comm);
}
int icetCommRank()
{
    IceTCommunicator comm = icetGetCommunicator();
    return comm->Comm_rank(comm);
}
int icetCommSize()
{
    IceTCommunicator comm = icetGetCommunicator();
    return comm->Comm_size(comm);
}
int icetCommWaitany(int count, IceTCommRequest *array_of_requests)
{
    IceTCommunicator comm = icetGetCommunicator();
    return comm->Waitany(comm, count, array_of_requests);
}
void icetCommWait(IceTCommRequest *request)
{
    IceTCommunicator comm = icetGetCommunicator();
    comm->Wait(comm, request);
}