Skip to content

Commit

Permalink
ch4/coll: Move algorithms into *_coll_impl.h files
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyMalkhanov authored and raffenet committed Aug 23, 2017
1 parent 8b8cb28 commit 48cf68f
Show file tree
Hide file tree
Showing 9 changed files with 927 additions and 1,117 deletions.
146 changes: 0 additions & 146 deletions src/mpid/ch4/netmod/ofi/ofi_coll.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,22 +45,6 @@ static inline int MPIDI_NM_mpi_barrier(MPIR_Comm * comm_ptr, MPIR_Errflag_t * er
goto fn_exit;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Barrier_recursive_doubling
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Barrier_recursive_doubling(MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Barrier_recursive_doubling(comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_NM_mpi_bcast
#undef FCNAME
Expand Down Expand Up @@ -92,66 +76,6 @@ static inline int MPIDI_NM_mpi_bcast(void *buffer, int count, MPI_Datatype datat
goto fn_exit;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_binomial
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_binomial(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_binomial(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_scatter_doubling_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_scatter_doubling_allgather(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_scatter_ring_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_scatter_ring_allgather(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_NM_mpi_allreduce
#undef FCNAME
Expand Down Expand Up @@ -182,42 +106,6 @@ static inline int MPIDI_NM_mpi_allreduce(const void *sendbuf, void *recvbuf, int
goto fn_exit;
}


#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_allreduce_recursive_doubling
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_allreduce_recursive_doubling(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Allreduce_recursive_doubling(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_allreduce_reduce_scatter_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_allreduce_reduce_scatter_allgather(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Allreduce_reduce_scatter_allgather(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);

return mpi_errno;
}


#undef FUNCNAME
#define FUNCNAME MPIDI_NM_mpi_allgather
#undef FCNAME
Expand Down Expand Up @@ -427,40 +315,6 @@ static inline int MPIDI_NM_mpi_reduce(const void *sendbuf, void *recvbuf, int co
goto fn_exit;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_reduce_redscat_gather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_reduce_redscat_gather(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Reduce_redscat_gather(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_reduce_binomial
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_reduce_binomial(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Reduce_binomial(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_NM_mpi_reduce_scatter
#undef FCNAME
Expand Down
160 changes: 160 additions & 0 deletions src/mpid/ch4/netmod/ofi/ofi_coll_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/* -*- Mode: C ; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
/*
* (C) 2006 by Argonne National Laboratory.
* See COPYRIGHT in top-level directory.
*
* Portions of this code were written by Intel Corporation.
* Copyright (C) 2011-2016 Intel Corporation. Intel provides this material
* to Argonne National Laboratory subject to Software Grant and Corporate
* Contributor License Agreement dated February 8, 2012.
*/
#ifndef OFI_COLL_IMPL_H_INCLUDED
#define OFI_COLL_IMPL_H_INCLUDED

#include "ofi_coll_params.h"

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Barrier_recursive_doubling
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Barrier_recursive_doubling(MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Barrier_recursive_doubling(comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_binomial
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_binomial(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_binomial(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_scatter_doubling_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_scatter_doubling_allgather(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_Bcast_scatter_ring_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_Bcast_scatter_ring_allgather(void *buffer,
int count,
MPI_Datatype datatype,
int root,
MPIR_Comm * comm_ptr,
MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Bcast_scatter_ring_allgather(buffer, count, datatype, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_allreduce_recursive_doubling
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_allreduce_recursive_doubling(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Allreduce_recursive_doubling(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_allreduce_reduce_scatter_allgather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_allreduce_reduce_scatter_allgather(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Allreduce_reduce_scatter_allgather(sendbuf, recvbuf, count, datatype, op, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_reduce_redscat_gather
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_reduce_redscat_gather(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Reduce_redscat_gather(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, errflag);

return mpi_errno;
}

#undef FUNCNAME
#define FUNCNAME MPIDI_OFI_reduce_binomial
#undef FCNAME
#define FCNAME MPL_QUOTE(FUNCNAME)
MPL_STATIC_INLINE_PREFIX
int MPIDI_OFI_reduce_binomial(const void *sendbuf, void *recvbuf, int count,
MPI_Datatype datatype, MPI_Op op, int root,
MPIR_Comm * comm_ptr, MPIR_Errflag_t * errflag,
MPIDI_OFI_coll_algo_container_t * params_container ATTRIBUTE((unused)))
{
int mpi_errno = MPI_SUCCESS;

mpi_errno = MPIR_Reduce_binomial(sendbuf, recvbuf, count, datatype, op, root, comm_ptr, errflag);

return mpi_errno;
}

#endif /* OFI_COLL_IMPL_H_INCLUDED */
Loading

0 comments on commit 48cf68f

Please sign in to comment.