1
1

Turn on all the non-blocking collectives provided by libnbc...

This commit was SVN r26682.
Этот коммит содержится в:
Brian Barrett 2012-06-27 18:32:57 +00:00
родитель 9d87857c25
Коммит 15a30af11f
24 изменённых файлов: 446 добавлений и 792 удалений

Просмотреть файл

@ -197,12 +197,7 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
(NULL == comm->c_coll.coll_reduce_scatter) ||
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_scan)) ||
(NULL == comm->c_coll.coll_scatter) ||
(NULL == comm->c_coll.coll_scatterv)
#if 0
/* JMS These need to be activated before the nb coll branch is
done */
||
(NULL == comm->c_coll.coll_scatterv) ||
(NULL == comm->c_coll.coll_iallgather) ||
(NULL == comm->c_coll.coll_iallgatherv) ||
(NULL == comm->c_coll.coll_iallreduce) ||
@ -219,12 +214,10 @@ int mca_coll_base_comm_select(ompi_communicator_t * comm)
((OMPI_COMM_IS_INTRA(comm)) && (NULL == comm->c_coll.coll_iscan)) ||
(NULL == comm->c_coll.coll_iscatter) ||
(NULL == comm->c_coll.coll_iscatterv)
#endif
) {
mca_coll_base_comm_unselect(comm);
return OMPI_ERR_NOT_FOUND;
}
return OMPI_SUCCESS;
}

Просмотреть файл

Просмотреть файл

@ -1 +0,0 @@
bwbarre

Просмотреть файл

@ -21,8 +21,30 @@ EXTRA_DIST =
sources = \
coll_libnbc_component.c \
coll_libnbc_not_implemented.c \
nbc.c \
nbc_ibarrier.c
nbc.h \
nbc_internal.h \
libdict/dict.h \
libdict/dict_private.h \
libdict/dict.c \
libdict/hb_tree.h \
libdict/hb_tree.c \
nbc_iallgather.c \
nbc_iallgatherv.c \
nbc_iallreduce.c \
nbc_ialltoall.c \
nbc_ialltoallv.c \
nbc_ibarrier.c \
nbc_ibcast.c \
nbc_ibcast_inter.c \
nbc_igather.c \
nbc_igatherv.c \
nbc_ireduce.c \
nbc_ireduce_scatter.c \
nbc_iscan.c \
nbc_iscatter.c \
nbc_iscatterv.c
# Make the output library in this directory, and name it either
# mca_<type>_<name>.la (for DSO builds) or libmca_<type>_<name>.la

Просмотреть файл

@ -113,8 +113,115 @@ typedef ompi_coll_libnbc_request_t NBC_Handle;
int NBC_Init_comm(MPI_Comm comm, ompi_coll_libnbc_module_t *module);
int NBC_Progress(NBC_Handle *handle);
int ompi_coll_libnbc_iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iallreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoallw(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t **sdtypes,
void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t **rdtypes,
struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ibarrier(struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iexscan(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype,
int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype,
MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce_scatter_block(void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm,
ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iscatterv(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iallgather_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iallgatherv_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iallreduce_inter(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoall_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoallv_inter(void* sendbuf, int *sendcounts, int *sdispls,
MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ialltoallw_inter(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t **sdtypes,
void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t **rdtypes,
struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_igather_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_igatherv_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype,
int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce_inter(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce_scatter_inter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype,
MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_ireduce_scatter_block_inter(void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm,
ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iscatter_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
int ompi_coll_libnbc_iscatterv_inter(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module);
END_C_DECLS

Просмотреть файл

@ -23,7 +23,7 @@
#include "mpi.h"
#include "ompi/mca/coll/coll.h"
#include "ompi/communicator/communicator.h"
/*
* Public string showing the coll ompi_libnbc component version number
@ -156,9 +156,43 @@ libnbc_comm_query(struct ompi_communicator_t *comm,
*priority = libnbc_priority;
module->super.coll_module_enable = libnbc_module_enable;
module->super.coll_ibarrier = ompi_coll_libnbc_ibarrier;
if (OMPI_COMM_IS_INTER(comm)) {
module->super.coll_iallgather = ompi_coll_libnbc_iallgather_inter;
module->super.coll_iallgatherv = ompi_coll_libnbc_iallgatherv_inter;
module->super.coll_iallreduce = ompi_coll_libnbc_iallreduce_inter;
module->super.coll_ialltoall = ompi_coll_libnbc_ialltoall_inter;
module->super.coll_ialltoallv = ompi_coll_libnbc_ialltoallv_inter;
module->super.coll_ialltoallw = ompi_coll_libnbc_ialltoallw_inter;
module->super.coll_ibarrier = ompi_coll_libnbc_ibarrier_inter;
module->super.coll_ibcast = ompi_coll_libnbc_ibcast_inter;
module->super.coll_iexscan = NULL;
module->super.coll_igather = ompi_coll_libnbc_igather_inter;
module->super.coll_igatherv = ompi_coll_libnbc_igatherv_inter;
module->super.coll_ireduce = ompi_coll_libnbc_ireduce_inter;
module->super.coll_ireduce_scatter = ompi_coll_libnbc_ireduce_scatter_inter;
module->super.coll_ireduce_scatter_block = ompi_coll_libnbc_ireduce_scatter_block_inter;
module->super.coll_iscan = NULL;
module->super.coll_iscatter = ompi_coll_libnbc_iscatter_inter;
module->super.coll_iscatterv = ompi_coll_libnbc_iscatterv_inter;
} else {
module->super.coll_iallgather = ompi_coll_libnbc_iallgather;
module->super.coll_iallgatherv = ompi_coll_libnbc_iallgatherv;
module->super.coll_iallreduce = ompi_coll_libnbc_iallreduce;
module->super.coll_ialltoall = ompi_coll_libnbc_ialltoall;
module->super.coll_ialltoallv = ompi_coll_libnbc_ialltoallv;
module->super.coll_ialltoallw = ompi_coll_libnbc_ialltoallw;
module->super.coll_ibarrier = ompi_coll_libnbc_ibarrier;
module->super.coll_ibcast = ompi_coll_libnbc_ibcast;
module->super.coll_iexscan = ompi_coll_libnbc_iexscan;
module->super.coll_igather = ompi_coll_libnbc_igather;
module->super.coll_igatherv = ompi_coll_libnbc_igatherv;
module->super.coll_ireduce = ompi_coll_libnbc_ireduce;
module->super.coll_ireduce_scatter = ompi_coll_libnbc_ireduce_scatter;
module->super.coll_ireduce_scatter_block = ompi_coll_libnbc_ireduce_scatter_block;
module->super.coll_iscan = ompi_coll_libnbc_iscan;
module->super.coll_iscatter = ompi_coll_libnbc_iscatter;
module->super.coll_iscatterv = ompi_coll_libnbc_iscatterv;
}
module->super.ft_event = NULL;
if (OMPI_SUCCESS != NBC_Init_comm(comm, module)) {

Просмотреть файл

@ -0,0 +1,160 @@
#include "ompi_config.h"
#include "coll_libnbc.h"
#include "ompi/constants.h"
int
ompi_coll_libnbc_ialltoallw(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t **sdtypes,
void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t **rdtypes,
struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_iexscan(void *sbuf, void *rbuf, int count, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ireduce_scatter_block(void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm,
ompi_request_t **request, struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_iallgather_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_iallgatherv_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_iallreduce_inter(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ialltoall_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ialltoallv_inter(void* sendbuf, int *sendcounts, int *sdispls,
MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ialltoallw_inter(void *sbuf, int *scounts, int *sdisps, struct ompi_datatype_t **sdtypes,
void *rbuf, int *rcounts, int *rdisps, struct ompi_datatype_t **rdtypes,
struct ompi_communicator_t *comm, ompi_request_t **request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ibarrier_inter(struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_igather_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_igatherv_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype,
int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ireduce_inter(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ireduce_scatter_inter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype,
MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_ireduce_scatter_block_inter(void *sbuf, void *rbuf, int rcount, struct ompi_datatype_t *dtype,
struct ompi_op_t *op, struct ompi_communicator_t *comm,
ompi_request_t **request, struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int ompi_coll_libnbc_iscatter_inter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}
int
ompi_coll_libnbc_iscatterv_inter(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
return OMPI_ERR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -20,23 +20,6 @@ extern "C" {
****** external NBC functions are defined here *******
*******************************************************/
/* external function prototypes */
int NBC_Ibarrier(MPI_Comm comm, NBC_Handle* handle);
int NBC_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Ialltoallv(void* sendbuf, int *sendcounts, int *sdispls, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle* handle);
int NBC_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Iscatterv(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle);
int NBC_Iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle);
int NBC_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle);
int NBC_Ireduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, NBC_Handle* handle);
int NBC_Iallreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle);
int NBC_Iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle);
int NBC_Ireduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle);
/* TODO: some hacks */
int NBC_Operation(void *buf3, void *buf1, void *buf2, MPI_Op op, MPI_Datatype type, int count);

Просмотреть файл

@ -29,16 +29,14 @@ int NBC_Allgather_args_compare(NBC_Allgather_args *a, NBC_Allgather_args *b, voi
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iallgather=PNBC_Iallgather
#define NBC_Iallgather PNBC_Iallgather
#endif
/* simple linear MPI_Iallgather
* the algorithm uses p-1 rounds
* each node sends the packet it received last round (or has in round 0) to it's right neighbor (modulo p)
* each node receives from it's left (modulo p) neighbor */
int NBC_Iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle) {
int ompi_coll_libnbc_iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, r;
MPI_Aint rcvext, sndext;
NBC_Schedule *schedule;
@ -46,10 +44,13 @@ int NBC_Iallgather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* re
#ifdef NBC_CACHE_SCHEDULE
NBC_Allgather_args *args, *found, search;
#endif
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -215,43 +216,3 @@ static inline int a2a_sched_diss(int rank, int p, MPI_Aint sndext, MPI_Aint rcve
return NBC_OK;
}
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iallgather,NBC_IALLGATHER,(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IALLGATHER = nbc_iallgather_f
#pragma weak nbc_iallgather = nbc_iallgather_f
#pragma weak nbc_iallgather_ = nbc_iallgather_f
#pragma weak nbc_iallgather__ = nbc_iallgather_f
#pragma weak PNBC_IALLGATHER = nbc_iallgather_f
#pragma weak pnbc_iallgather = nbc_iallgather_f
#pragma weak pnbc_iallgather_ = nbc_iallgather_f
#pragma weak pnbc_iallgather__ = nbc_iallgather_f
void nbc_iallgather_f(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iallgather,NBC_IALLGATHER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iallgather,NBC_IALLGATHER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iallgather(sendbuf, *sendcount, stype, recvbuf, *recvcount, rtype, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -14,11 +14,6 @@
* ot the recvcounts array may change, so a comparison of the address
* would not be sufficient ... we simply do not cache it */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iallgatherv=PNBC_Iallgatherv
#define NBC_Iallgatherv PNBC_Iallgatherv
#endif
/* simple linear MPI_Iallgatherv
* the algorithm uses p-1 rounds
* first round:
@ -27,15 +22,21 @@
* second round:
* each node sends to node (rank+2)%p sendcount elements
* each node receives from node (rank-2)%p recvcounts[(rank+2)%p] elements */
int NBC_Iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle) {
int ompi_coll_libnbc_iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, r, speer, rpeer;
MPI_Aint rcvext, sndext;
NBC_Schedule *schedule;
char *rbuf, inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -81,44 +82,3 @@ int NBC_Iallgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* r
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iallgatherv,NBC_IALLGATHERV,(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IALLGATHERV = nbc_iallgatherv_f
#pragma weak nbc_iallgatherv = nbc_iallgatherv_f
#pragma weak nbc_iallgatherv_ = nbc_iallgatherv_f
#pragma weak nbc_iallgatherv__ = nbc_iallgatherv_f
#pragma weak PNBC_IALLGATHERV = nbc_iallgatherv_f
#pragma weak pnbc_iallgatherv = nbc_iallgatherv_f
#pragma weak pnbc_iallgatherv_ = nbc_iallgatherv_f
#pragma weak pnbc_iallgatherv__ = nbc_iallgatherv_f
void nbc_iallgatherv_f(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iallgatherv,NBC_IALLGATHERV)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iallgatherv,NBC_IALLGATHERV)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iallgatherv(sendbuf, *sendcount, stype, recvbuf, recvcounts, displs, rtype, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -15,31 +15,6 @@ static inline int allred_sched_diss(int rank, int p, int count, MPI_Datatype dat
static inline int allred_sched_chain(int rank, int p, int count, MPI_Datatype datatype, void *sendbuf, void *recvbuf, MPI_Op op, int size, int ext, NBC_Schedule *schedule, NBC_Handle *handle, int fragsize);
static inline int allred_sched_ring(int rank, int p, int count, MPI_Datatype datatype, void *sendbuf, void *recvbuf, MPI_Op op, int size, int ext, NBC_Schedule *schedule, NBC_Handle *handle);
// DCMF allreduce is actually not non-blocking!!!
#ifdef USE_DCMF
#undef USE_DCMF
#endif
#ifdef USE_DCMF
#error "DCMF allreduce is not nonblocking and thus disabled"
#include <dcmf_globalcollectives.h>
static int initialized=0;
static void cbfunc(void *clientdata, DCMF_Error_t *error) {
//printf("in allreduce callback!\n");
*(unsigned*)clientdata=2;
}
DCMF_Protocol_t allred_reg;
DCMF_Request_t allred_req;
static void init_dcmf_allred() {
DCMF_GlobalAllreduce_Configuration_t allred_config;
allred_config.protocol = DCMF_DEFAULT_GLOBALALLREDUCE_PROTOCOL;
DCMF_GlobalAllreduce_register(&allred_reg, &allred_config);
initialized=1;
}
#endif
#ifdef NBC_CACHE_SCHEDULE
/* tree comparison function for schedule cache */
int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, void *param) {
@ -58,12 +33,10 @@ int NBC_Allreduce_args_compare(NBC_Allreduce_args *a, NBC_Allreduce_args *b, voi
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iallreduce=PNBC_Iallreduce
#define NBC_Iallreduce PNBC_Iallreduce
#endif
int NBC_Iallreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_iallreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, size;
MPI_Aint ext;
NBC_Schedule *schedule;
@ -72,74 +45,13 @@ int NBC_Iallreduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatyp
#endif
enum { NBC_ARED_BINOMIAL, NBC_ARED_RING } alg;
char inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
#ifdef USE_DCMF
int ws, s;
MPI_Comm_size(comm, &s);
MPI_Comm_size(MPI_COMM_WORLD, &ws);
if(s != ws) {
printf("DCMF only works on MPI_COMM_WORLD (or dups of it) for now -- fallback needs to be implemented :-)\n");
return NBC_NOT_IMPLEMENTED;
}
if(!initialized) init_dcmf_allred();
handle->dcmf_hndl = (NBC_DCMF_Handle*)malloc(sizeof(NBC_DCMF_Handle));
handle->dcmf_hndl->done=0;
handle->dcmf_hndl->type=DCMF_TYPE_ALLREDUCE;
DCMF_Callback_t callback={ cbfunc, &handle->dcmf_hndl->done };
DCMF_Dt dt;
switch(datatype) {
case MPI_UNSIGNED_LONG_LONG:
dt = DCMF_UNSIGNED_LONG_LONG;
break;
case MPI_LONG_LONG:
dt = DCMF_SIGNED_LONG_LONG;
break;
case MPI_UNSIGNED:
dt = DCMF_UNSIGNED_INT;
break;
case MPI_INT:
dt = DCMF_SIGNED_INT;
break;
case MPI_UNSIGNED_LONG: // we assume it's the same as integer!!!
dt = DCMF_UNSIGNED_INT;
assert(sizeof(unsigned int) == sizeof(unsigned long));
break;
case MPI_LONG: // we assume it's the same as integer !!!
dt = DCMF_SIGNED_INT;
assert(sizeof(int) == sizeof(long));
break;
case MPI_DOUBLE:
dt = DCMF_DOUBLE;
break;
default:
printf("Datatype not supported\n");
return NBC_NOT_IMPLEMENTED;
break;
}
DCMF_Op dop;
switch(op) {
case MPI_SUM:
dop = DCMF_SUM;
break;
default:
printf("Operations not supported\n");
return NBC_NOT_IMPLEMENTED;
break;
}
int r;
MPI_Comm_rank(comm, &r);
printf("[%i] LibNBC starting allreduce\n", r);
DCMF_GlobalAllreduce(&allred_reg, &allred_req, callback, DCMF_MATCH_CONSISTENCY, -1 /* root?? */, (char*)sendbuf, (char*)recvbuf, count, dt, dop);
printf("[%i] LibNBC after allreduce\n", r);
#else
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -218,7 +130,6 @@ printf("[%i] LibNBC after allreduce\n", r);
res = NBC_Start(handle, schedule);
if(res != NBC_OK) { free(handle->tmpbuf); printf("Error in NBC_Start() (%i)\n", res); return res; }
#endif
/* tmpbuf is freed with the handle */
return NBC_OK;
@ -439,8 +350,7 @@ static inline int allred_sched_ring(int r, int p, int count, MPI_Datatype dataty
int i; /* runner */
int segsize, *segsizes, *segoffsets; /* segment sizes and offsets per segment (number of segments == number of nodes */
int speer, rpeer; /* send and recvpeer */
int res;
if(count == 0) return NBC_OK;
{
@ -459,7 +369,7 @@ static inline int allred_sched_ring(int r, int p, int count, MPI_Datatype dataty
mycount = 0;
}
if(i) segoffsets[i] = segoffsets[i-1] + segsizes[i-1];
//if(!r) printf("count: %i, (%i) size: %i, offset: %i\n", count, i, segsizes[i], segoffsets[i]);
/*if(!r) printf("count: %i, (%i) size: %i, offset: %i\n", count, i, segsizes[i], segoffsets[i]); */
}
}
@ -577,16 +487,12 @@ static inline int allred_sched_ring(int r, int p, int count, MPI_Datatype dataty
/* first message come out of sendbuf */
if(round == 0) {
NBC_Sched_send((char*)sendbuf+soffset, false, segsizes[selement], datatype, speer, schedule);
//printf("[%i] round %i - sending %i\n", r, round, selement);
} else {
NBC_Sched_send((char*)recvbuf+soffset, false, segsizes[selement], datatype, speer, schedule);
//printf("[%i] round %i - sending %i\n", r, round, selement);
}
NBC_Sched_recv((char*)recvbuf+roffset, false, segsizes[relement], datatype, rpeer, schedule);
//printf("[%i] round %i - receiving %i\n", r, round, relement);
NBC_Sched_barrier(schedule);
//printf("[%i] round %i - reducing %i\n", r, round, relement);
NBC_Sched_op((char*)recvbuf+roffset, false, (char*)sendbuf+roffset, false, (char*)recvbuf+roffset, false, segsizes[relement], datatype, op, schedule);
NBC_Sched_barrier(schedule);
@ -599,7 +505,6 @@ static inline int allred_sched_ring(int r, int p, int count, MPI_Datatype dataty
int relement = (r-round + 2*p /*2*p avoids negative mod*/)%p; /* the element that I receive from my neighbor */
int roffset = segoffsets[relement]*ext;
//printf("[%i] round %i receiving %i sending %i\n", r, round, relement, selement);
NBC_Sched_send((char*)recvbuf+soffset, false, segsizes[selement], datatype, speer, schedule);
NBC_Sched_recv((char*)recvbuf+roffset, false, segsizes[relement], datatype, rpeer, schedule);
NBC_Sched_barrier(schedule);
@ -607,49 +512,5 @@ static inline int allred_sched_ring(int r, int p, int count, MPI_Datatype dataty
} while (round < 2*p-2);
}
//NBC_PRINT_SCHED(*schedule);
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iallreduce,NBC_IALLREDUCE,(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IALLREDUCE = nbc_iallreduce_f
#pragma weak nbc_iallreduce = nbc_iallreduce_f
#pragma weak nbc_iallreduce_ = nbc_iallreduce_f
#pragma weak nbc_iallreduce__ = nbc_iallreduce_f
#pragma weak PNBC_IALLREDUCE = nbc_iallreduce_f
#pragma weak pnbc_iallreduce = nbc_iallreduce_f
#pragma weak pnbc_iallreduce_ = nbc_iallreduce_f
#pragma weak pnbc_iallreduce__ = nbc_iallreduce_f
void nbc_iallreduce_f(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iallreduce,NBC_IALLREDUCE)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iallreduce,NBC_IALLREDUCE)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype dtype;
MPI_Comm comm;
MPI_Op op;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
dtype = MPI_Type_f2c(*datatype);
comm = MPI_Comm_f2c(*fcomm);
op = MPI_Op_f2c(*fop);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iallreduce(sendbuf, recvbuf, *count, dtype, op, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -33,13 +33,11 @@ int NBC_Alltoall_args_compare(NBC_Alltoall_args *a, NBC_Alltoall_args *b, void *
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Ialltoall=PNBC_Ialltoall
#define NBC_Ialltoall PNBC_Ialltoall
#endif
/* simple linear MPI_Ialltoall the (simple) algorithm just sends to all nodes */
int NBC_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle *handle) {
int ompi_coll_libnbc_ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, a2asize, sndsize, datasize;
NBC_Schedule *schedule;
MPI_Aint rcvext, sndext;
@ -48,10 +46,13 @@ int NBC_Ialltoall(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* rec
#endif
char *rbuf, *sbuf, inplace;
enum {NBC_A2A_LINEAR, NBC_A2A_PAIRWISE, NBC_A2A_DISS} alg;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -314,45 +315,3 @@ static inline int a2a_sched_diss(int rank, int p, MPI_Aint sndext, MPI_Aint rcve
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_ialltoall,NBC_IALLTOALL,(void *sendbuf, int *sendcount, int *sendtype,
void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IALLTOALL = nbc_ialltoall_f
#pragma weak nbc_ialltoall = nbc_ialltoall_f
#pragma weak nbc_ialltoall_ = nbc_ialltoall_f
#pragma weak nbc_ialltoall__ = nbc_ialltoall_f
#pragma weak PNBC_IALLTOALL = nbc_ialltoall_f
#pragma weak pnbc_ialltoall = nbc_ialltoall_f
#pragma weak pnbc_ialltoall_ = nbc_ialltoall_f
#pragma weak pnbc_ialltoall__ = nbc_ialltoall_f
void nbc_ialltoall_f(void *sendbuf, int *sendcount, int *sendtype,
void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_ialltoall,NBC_IALLTOALL)(void *sendbuf, int *sendcount, int *sendtype,
void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_ialltoall,NBC_IALLTOALL)(void *sendbuf, int *sendcount, int *sendtype,
void *recvbuf, int *recvcount, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Ialltoall(sendbuf, *sendcount, stype, recvbuf, *recvcount, rtype, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -14,24 +14,23 @@
* ot the recvcounts array may change, so a comparison of the address
* would not be sufficient ... we simply do not cache it */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Ialltoallv=PNBC_Ialltoallv
#define NBC_Ialltoallv PNBC_Ialltoallv
#endif
/* simple linear Alltoallv */
int NBC_Ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls,
MPI_Datatype recvtype, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *rdispls,
MPI_Datatype recvtype, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, i;
MPI_Aint sndext, rcvext;
NBC_Schedule *schedule;
char *rbuf, *sbuf, inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -84,46 +83,3 @@ int NBC_Ialltoallv(void* sendbuf, int *sendcounts, int *sdispls,
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_ialltoallv,NBC_IALLTOALLV,(void *sendbuf, int *sendcounts, int *sdispls, int *sendtype,
void *recvbuf, int *recvcounts, int *rdispls, int *recvtype, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IALLTOALLV = nbc_ialltoallv_f
#pragma weak nbc_ialltoallv = nbc_ialltoallv_f
#pragma weak nbc_ialltoallv_ = nbc_ialltoallv_f
#pragma weak nbc_ialltoallv__ = nbc_ialltoallv_f
#pragma weak PNBC_IALLTOALLV = nbc_ialltoallv_f
#pragma weak pnbc_ialltoallv = nbc_ialltoallv_f
#pragma weak pnbc_ialltoallv_ = nbc_ialltoallv_f
#pragma weak pnbc_ialltoallv__ = nbc_ialltoallv_f
void nbc_ialltoallv_f(void *sendbuf, int *sendcounts, int *sdispls, int *sendtype,
void *recvbuf, int *recvcounts, int *rdispls, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_ialltoallv,NBC_IALLTOALLV)(void *sendbuf, int *sendcounts, int *sdispls, int *sendtype,
void *recvbuf, int *recvcounts, int *rdispls, int *recvtype, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_ialltoallv,NBC_IALLTOALLV)(void *sendbuf, int *sendcounts, int *sdispls, int *sendtype,
void *recvbuf, int *recvcounts, int *rdispls, int *recvtype, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Ialltoallv(sendbuf, sendcounts, sdispls, stype, recvbuf, recvcounts, rdispls, rtype, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -31,20 +31,21 @@ int NBC_Bcast_args_compare(NBC_Bcast_args *a, NBC_Bcast_args *b, void *param) {
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Ibcast=PNBC_Ibcast
#define NBC_Ibcast PNBC_Ibcast
#endif
int NBC_Ibcast(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_ibcast(void *buffer, int count, MPI_Datatype datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module)
{
int rank, p, res, size, segsize;
NBC_Schedule *schedule;
#ifdef NBC_CACHE_SCHEDULE
NBC_Bcast_args *args, *found, search;
#endif
enum { NBC_BCAST_LINEAR, NBC_BCAST_BINOMIAL, NBC_BCAST_CHAIN } alg;
res = NBC_Init_handle(handle, comm);
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -248,40 +249,3 @@ static inline int bcast_sched_chain(int rank, int p, int root, NBC_Schedule *sch
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_ibcast,NBC_IBCAST,(void *buf, int *count, int *datatype, int *root, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IBCAST = nbc_ibcast_f
#pragma weak nbc_ibcast = nbc_ibcast_f
#pragma weak nbc_ibcast_ = nbc_ibcast_f
#pragma weak nbc_ibcast__ = nbc_ibcast_f
#pragma weak PNBC_IBCAST = nbc_ibcast_f
#pragma weak pnbc_ibcast = nbc_ibcast_f
#pragma weak pnbc_ibcast_ = nbc_ibcast_f
#pragma weak pnbc_ibcast__ = nbc_ibcast_f
void nbc_ibcast_f(void *buf, int *count, int *datatype, int *root, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_ibcast,NBC_IBCAST)(void *buf, int *count, int *datatype, int *root, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_ibcast,NBC_IBCAST)(void *buf, int *count, int *datatype, int *root, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype dtype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
dtype = MPI_Type_f2c(*datatype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Ibcast(buf, *count, dtype, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -10,15 +10,16 @@
*/
#include "nbc_internal.h"
#ifdef __cplusplus
extern "C" {
#endif
int NBC_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, MPI_Comm comm, NBC_Handle* handle) {
int rank, p, res, size, segsize, peer;
int ompi_coll_libnbc_ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, size, peer;
NBC_Schedule *schedule;
res = NBC_Init_handle(handle, comm);
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -40,7 +41,7 @@ int NBC_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, M
int remsize;
res = MPI_Comm_remote_size(comm, &remsize);
if(MPI_SUCCESS != res) { printf("MPI_Comm_remote_size() failed\n", res); return res; }
if(MPI_SUCCESS != res) { printf("MPI_Comm_remote_size() failed\n"); return res; }
for (peer=0;peer<remsize;peer++) {
/* send msg to peer */
@ -62,7 +63,3 @@ int NBC_Ibcast_inter(void *buffer, int count, MPI_Datatype datatype, int root, M
return NBC_OK;
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -30,12 +30,9 @@ int NBC_Gather_args_compare(NBC_Gather_args *a, NBC_Gather_args *b, void *param)
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Igather=PNBC_Igather
#define NBC_Igather PNBC_Igather
#endif
int NBC_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount,
MPI_Datatype recvtype, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, i;
MPI_Aint rcvext;
NBC_Schedule *schedule;
@ -43,10 +40,13 @@ int NBC_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvb
#ifdef NBC_CACHE_SCHEDULE
NBC_Gather_args *args, *found, search;
#endif
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -129,41 +129,3 @@ int NBC_Igather(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvb
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_igather,NBC_IGATHER,(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IGATHER = nbc_igather_f
#pragma weak nbc_igather = nbc_igather_f
#pragma weak nbc_igather_ = nbc_igather_f
#pragma weak nbc_igather__ = nbc_igather_f
#pragma weak PNBC_IGATHER = nbc_igather_f
#pragma weak pnbc_igather = nbc_igather_f
#pragma weak pnbc_igather_ = nbc_igather_f
#pragma weak pnbc_igather__ = nbc_igather_f
void nbc_igather_f(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#else
/* Fortran bindings */
void NBC_F77_FUNC_(nbc_igather,NBC_IGATHER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_igather,NBC_IGATHER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Igather(sendbuf, *sendcount, stype, recvbuf, *recvcount, rtype, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -14,19 +14,22 @@
* ot the recvcounts array may change, so a comparison of the address
* would not be sufficient ... we simply do not cache it */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Igatherv=PNBC_Igatherv
#define NBC_Igatherv PNBC_Igatherv
#endif
int NBC_Igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype,
int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, i;
MPI_Aint rcvext;
NBC_Schedule *schedule;
char *rbuf, inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -73,46 +76,3 @@ int NBC_Igatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recv
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_igatherv,NBC_IGATHERV,(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *root, int *fcomm,
int *fhandle, int *ierr));
#pragma weak NBC_IGATHERV = nbc_igatherv_f
#pragma weak nbc_igatherv = nbc_igatherv_f
#pragma weak nbc_igatherv_ = nbc_igatherv_f
#pragma weak nbc_igatherv__ = nbc_igatherv_f
#pragma weak PNBC_IGATHERV = nbc_igatherv_f
#pragma weak pnbc_igatherv = nbc_igatherv_f
#pragma weak pnbc_igatherv_ = nbc_igatherv_f
#pragma weak pnbc_igatherv__ = nbc_igatherv_f
void nbc_igatherv_f(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *root, int *fcomm,
int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_igatherv,NBC_IGATHERV)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *root, int *fcomm,
int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_igatherv,NBC_IGATHERV)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcounts, int *displs, int *recvtype, int *root, int *fcomm,
int *fhandle, int *ierr) {
#endif
MPI_Datatype rtype, stype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Igatherv(sendbuf, *sendcount, stype, recvbuf, recvcounts, displs, rtype, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -28,7 +28,7 @@
* still in the cache and second, the tmpbuf used by the schedule must
* be attached to the handle that uses this schedule !!!!
* I.E., THIS IS EXPERIMENTAL AND MIGHT NOT WORK */
/* #define NBC_CACHE_SCHEDULE */
#define NBC_CACHE_SCHEDULE
#define NBC_SCHED_DICT_UPPER 1024 /* max. number of dict entries */
#define NBC_SCHED_DICT_LOWER 512 /* nuber of dict entries after wipe, if SCHED_DICT_UPPER is reached */

Просмотреть файл

@ -32,13 +32,10 @@ int NBC_Reduce_args_compare(NBC_Reduce_args *a, NBC_Reduce_args *b, void *param)
}
#endif
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Ireduce=PNBC_Ireduce
#define NBC_Ireduce PNBC_Ireduce
#endif
/* the non-blocking reduce */
int NBC_Ireduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_ireduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
MPI_Op op, int root, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, segsize, size;
MPI_Aint ext;
NBC_Schedule *schedule;
@ -47,10 +44,13 @@ int NBC_Ireduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,
NBC_Reduce_args *args, *found, search;
#endif
enum { NBC_RED_BINOMIAL, NBC_RED_CHAIN } alg;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -291,43 +291,3 @@ static inline int red_sched_chain(int rank, int p, int root, void *sendbuf, void
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_ireduce,NBC_IREDUCE,(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *root, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IREDUCE = nbc_ireduce_f
#pragma weak nbc_ireduce = nbc_ireduce_f
#pragma weak nbc_ireduce_ = nbc_ireduce_f
#pragma weak nbc_ireduce__ = nbc_ireduce_f
#pragma weak PNBC_IREDUCE = nbc_ireduce_f
#pragma weak pnbc_ireduce = nbc_ireduce_f
#pragma weak pnbc_ireduce_ = nbc_ireduce_f
#pragma weak pnbc_ireduce__ = nbc_ireduce_f
void nbc_ireduce_f(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *root, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_ireduce,NBC_IREDUCE)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *root, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_ireduce,NBC_IREDUCE)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *root, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype dtype;
MPI_Comm comm;
MPI_Op op;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
dtype = MPI_Type_f2c(*datatype);
comm = MPI_Comm_f2c(*fcomm);
op = MPI_Op_f2c(*fop);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Ireduce(sendbuf, recvbuf, *count, dtype, op, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -27,19 +27,20 @@
*
*/
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Ireduce_scatter=PNBC_Ireduce_scatter
#define NBC_Ireduce_scatter PNBC_Ireduce_scatter
#endif
int NBC_Ireduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_ireduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datatype datatype,
MPI_Op op, struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int peer, rank, maxr, p, r, res, count, offset, firstred;
MPI_Aint ext;
char *redbuf, *sbuf, inplace;
NBC_Schedule *schedule;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -143,43 +144,3 @@ int NBC_Ireduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts, MPI_Datat
/* tmpbuf is freed with the handle */
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_ireduce_scatter,NBC_IREDUCE_SCATTER,(void *sendbuf, void *recvbuf, int *recvcounts, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_IREDUCE_SCATTER = nbc_ireduce_scatter_f
#pragma weak nbc_ireduce_scatter = nbc_ireduce_scatter_f
#pragma weak nbc_ireduce_scatter_ = nbc_ireduce_scatter_f
#pragma weak nbc_ireduce_scatter__ = nbc_ireduce_scatter_f
#pragma weak PNBC_IREDUCE_SCATTER = nbc_ireduce_scatter_f
#pragma weak pnbc_ireduce_scatter = nbc_ireduce_scatter_f
#pragma weak pnbc_ireduce_scatter_ = nbc_ireduce_scatter_f
#pragma weak pnbc_ireduce_scatter__ = nbc_ireduce_scatter_f
void nbc_ireduce_scatter_f(void *sendbuf, void *recvbuf, int *recvcounts, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_ireduce_scatter,NBC_IREDUCE_SCATTER)(void *sendbuf, void *recvbuf, int *recvcounts, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_ireduce_scatter,NBC_IREDUCE_SCATTER)(void *sendbuf, void *recvbuf, int *recvcounts, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype dtype;
MPI_Comm comm;
MPI_Op op;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
dtype = MPI_Type_f2c(*datatype);
comm = MPI_Comm_f2c(*fcomm);
op = MPI_Op_f2c(*fop);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Ireduce_scatter(sendbuf, recvbuf, recvcounts, dtype, op, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -35,11 +35,9 @@ int NBC_Scan_args_compare(NBC_Scan_args *a, NBC_Scan_args *b, void *param) {
* 3. all but rank p-1 do sends to it's right neigbor and exits
*
*/
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iscan=PNBC_Iscan
#define NBC_Iscan PNBC_Iscan
#endif
int NBC_Iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MPI_Op op,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res;
MPI_Aint ext;
NBC_Schedule *schedule;
@ -47,10 +45,13 @@ int NBC_Iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MP
NBC_Scan_args *args, *found, search;
#endif
char inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -132,43 +133,3 @@ int NBC_Iscan(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype, MP
/* tmpbuf is freed with the handle */
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iscan,NBC_ISCAN,(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_ISCAN = nbc_iscan_f
#pragma weak nbc_iscan = nbc_iscan_f
#pragma weak nbc_iscan_ = nbc_iscan_f
#pragma weak nbc_iscan__ = nbc_iscan_f
#pragma weak PNBC_ISCAN = nbc_iscan_f
#pragma weak pnbc_iscan = nbc_iscan_f
#pragma weak pnbc_iscan_ = nbc_iscan_f
#pragma weak pnbc_iscan__ = nbc_iscan_f
void nbc_iscan_f(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iscan,NBC_ISCAN)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iscan,NBC_ISCAN)(void *sendbuf, void *recvbuf, int *count, int *datatype, int *fop, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype dtype;
MPI_Comm comm;
MPI_Op op;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
dtype = MPI_Type_f2c(*datatype);
comm = MPI_Comm_f2c(*fcomm);
op = MPI_Op_f2c(*fop);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iscan(sendbuf, recvbuf, *count, dtype, op, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -31,11 +31,10 @@ int NBC_Scatter_args_compare(NBC_Scatter_args *a, NBC_Scatter_args *b, void *par
#endif
/* simple linear MPI_Iscatter */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iscatter=PNBC_Iscatter
#define NBC_Iscatter PNBC_Iscatter
#endif
int NBC_Iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, i;
MPI_Aint sndext;
NBC_Schedule *schedule;
@ -43,10 +42,13 @@ int NBC_Iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recv
#ifdef NBC_CACHE_SCHEDULE
NBC_Scatter_args *args, *found, search;
#endif
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -129,42 +131,3 @@ int NBC_Iscatter(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recv
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iscatter,NBC_ISCATTER,(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_ISCATTER = nbc_iscatter_f
#pragma weak nbc_iscatter = nbc_iscatter_f
#pragma weak nbc_iscatter_ = nbc_iscatter_f
#pragma weak nbc_iscatter__ = nbc_iscatter_f
#pragma weak PNBC_ISCATTER = nbc_iscatter_f
#pragma weak pnbc_iscatter = nbc_iscatter_f
#pragma weak pnbc_iscatter_ = nbc_iscatter_f
#pragma weak pnbc_iscatter__ = nbc_iscatter_f
void nbc_iscatter_f(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iscatter,NBC_ISCATTER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iscatter,NBC_ISCATTER)(void *sendbuf, int *sendcount, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype stype, rtype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iscatter(sendbuf, *sendcount, stype, recvbuf, *recvcount, rtype, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -15,19 +15,21 @@
* would not be sufficient ... we simply do not cache it */
/* simple linear MPI_Iscatterv */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
#pragma weak NBC_Iscatterv=PNBC_Iscatterv
#define NBC_Iscatterv PNBC_Iscatterv
#endif
int NBC_Iscatterv(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype, void* recvbuf, int recvcount, MPI_Datatype recvtype, int root, MPI_Comm comm, NBC_Handle* handle) {
int ompi_coll_libnbc_iscatterv(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype sendtype,
void* recvbuf, int recvcount, MPI_Datatype recvtype, int root,
struct ompi_communicator_t *comm, ompi_request_t ** request,
struct mca_coll_base_module_2_0_0_t *module) {
int rank, p, res, i;
MPI_Aint sndext;
NBC_Schedule *schedule;
char *sbuf, inplace;
NBC_Handle *handle;
ompi_coll_libnbc_request_t **coll_req = (ompi_coll_libnbc_request_t**) request;
ompi_coll_libnbc_module_t *libnbc_module = (ompi_coll_libnbc_module_t*) module;
NBC_IN_PLACE(sendbuf, recvbuf, inplace);
res = NBC_Init_handle(handle, comm);
res = NBC_Init_handle(comm, coll_req, libnbc_module);
if(res != NBC_OK) { printf("Error in NBC_Init_handle(%i)\n", res); return res; }
res = MPI_Comm_rank(comm, &rank);
if (MPI_SUCCESS != res) { printf("MPI Error in MPI_Comm_rank() (%i)\n", res); return res; }
@ -74,42 +76,3 @@ int NBC_Iscatterv(void* sendbuf, int *sendcounts, int *displs, MPI_Datatype send
return NBC_OK;
}
#ifdef __cplusplus
extern "C" {
#endif
/* Fortran bindings */
#ifdef HAVE_SYS_WEAK_ALIAS_PRAGMA
NBC_F77_ALLFUNC_(nbc_iscatterv,NBC_ISCATTERV,(void *sendbuf, int *sendcounts, int *displs, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr));
#pragma weak NBC_ISCATTERV = nbc_iscatterv_f
#pragma weak nbc_iscatterv = nbc_iscatterv_f
#pragma weak nbc_iscatterv_ = nbc_iscatterv_f
#pragma weak nbc_iscatterv__ = nbc_iscatterv_f
#pragma weak PNBC_ISCATTERV = nbc_iscatterv_f
#pragma weak pnbc_iscatterv = nbc_iscatterv_f
#pragma weak pnbc_iscatterv_ = nbc_iscatterv_f
#pragma weak pnbc_iscatterv__ = nbc_iscatterv_f
void nbc_iscatterv_f(void *sendbuf, int *sendcounts, int *displs, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#else
void NBC_F77_FUNC_(nbc_iscatterv,NBC_ISCATTERV)(void *sendbuf, int *sendcounts, int *displs, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr);
void NBC_F77_FUNC_(nbc_iscatterv,NBC_ISCATTERV)(void *sendbuf, int *sendcounts, int *displs, int *sendtype, void *recvbuf, int *recvcount, int *recvtype, int *root, int *fcomm, int *fhandle, int *ierr) {
#endif
MPI_Datatype stype, rtype;
MPI_Comm comm;
NBC_Handle *handle;
/* this is the only MPI-2 we need :-( */
rtype = MPI_Type_f2c(*recvtype);
stype = MPI_Type_f2c(*sendtype);
comm = MPI_Comm_f2c(*fcomm);
/* create a new handle in handle table */
NBC_Create_fortran_handle(fhandle, &handle);
/* call NBC function */
*ierr = NBC_Iscatterv(sendbuf, sendcounts, displs, stype, recvbuf, *recvcount, rtype, *root, comm, handle);
}
#ifdef __cplusplus
}
#endif

Просмотреть файл

@ -1,32 +0,0 @@
/*
* Copyright (c) 2006 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2006 The Technical University of Chemnitz. All
* rights reserved.
*
* Author(s): Torsten Hoefler <htor@cs.indiana.edu>
*
*/
/* this gets it's own file since it is used twice ... */
#include "ompi/include/mpi.h"
/* the autohell defines some macros ... that OMPI redefines ... but we
* need to undefine them before that *ARGH* */
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT
#include "ompi/include/ompi/constants.h"
/* undefine the stuff set by ompi */
#undef PACKAGE_BUGREPORT
#undef PACKAGE_NAME
#undef PACKAGE_STRING
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#undef PACKAGE_BUGREPORT