x
Yes
No
Do you want to visit DriveHQ English website?
Inicio
Características
Precios
Prueba gratuita
Software cliente
Acerca de nosotros
Servidor de archivos
|
Solución de copias de seguridad
|
Servidor FTP
|
Servidor de correo electrónico
|
Alojamiento web
|
Software cliente
Servidor de archivos
Solución de copia de seguridad
Servidor FTP
Servidor de correo electrónico
Alojamiento web
Software cliente
all_gather.hpp - Hosted on DriveHQ Cloud IT Platform
Arriba
Subir
Descargar
Compartir
Publicar
Nueva carpeta
Nuevo archivo
Copiar
Cortar
Eliminar
Pegar
Clasificación
Actualizar
Ruta de la carpeta: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\boost_1_35_0\boost\mpi\collectives\all_gather.hpp
Girar
Efecto
Propiedad
Historial
// Copyright (C) 2005-2006 Douglas Gregor
. // Use, modification and distribution is subject to the Boost Software // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // Message Passing Interface 1.1 -- Section 4.7. Gather-to-all #ifndef BOOST_MPI_ALL_GATHER_HPP #define BOOST_MPI_ALL_GATHER_HPP #include
#include
#include
#include
// all_gather falls back to gather+broadcast in some cases #include
#include
namespace boost { namespace mpi { namespace detail { // We're all-gathering for a type that has an associated MPI // datatype, so we'll use MPI_Gather to do all of the work. template
void all_gather_impl(const communicator& comm, const T* in_values, int n, T* out_values, mpl::true_) { MPI_Datatype type = boost::mpi::get_mpi_datatype
(*in_values); BOOST_MPI_CHECK_RESULT(MPI_Allgather, (const_cast
(in_values), n, type, out_values, n, type, comm)); } // We're all-gathering for a type that has no associated MPI // type. So, we'll do a manual gather followed by a broadcast. template
void all_gather_impl(const communicator& comm, const T* in_values, int n, T* out_values, mpl::false_) { std::cerr << comm.rank() << ": gathering " << n << " values to root 0..." << std::endl; std::cerr << in_values << ", " << out_values << std::endl; gather(comm, in_values, n, out_values, 0); std::cerr << comm.rank() << ": broadcasting from root 0..." << std::endl; broadcast(comm, out_values, comm.size() * n, 0); } } // end namespace detail template
inline void all_gather(const communicator& comm, const T& in_value, T* out_values) { detail::all_gather_impl(comm, &in_value, 1, out_values, is_mpi_datatype
()); } template
void all_gather(const communicator& comm, const T& in_value, std::vector
& out_values) { out_values.resize(comm.size()); ::boost::mpi::all_gather(comm, &in_value, 1, &out_values[0]); } template
inline void all_gather(const communicator& comm, const T* in_values, int n, T* out_values) { detail::all_gather_impl(comm, in_values, n, out_values, is_mpi_datatype
()); } template
void all_gather(const communicator& comm, const T* in_values, int n, std::vector
& out_values) { out_values.resize(comm.size() * n); ::boost::mpi::all_gather(comm, in_values, n, &out_values[0]); } } } // end namespace boost::mpi #endif // BOOST_MPI_ALL_GATHER_HPP
all_gather.hpp
Dirección de la página
Dirección del archivo
Anterior 1/8
Siguiente
Descargar
( 2 KB )
Comments
Total ratings:
0
Average rating:
No clasificado
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.