libsc
1.6.0
|
00001 /* 00002 This file is part of the SC Library. 00003 The SC Library provides support for parallel scientific applications. 00004 00005 Copyright (C) 2010 The University of Texas System 00006 00007 The SC Library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 The SC Library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with the SC Library; if not, write to the Free Software 00019 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00020 02110-1301, USA. 00021 */ 00022 00023 #ifndef SC_REDUCE_H 00024 #define SC_REDUCE_H 00025 00026 #include <sc.h> 00027 00028 /* highest level that uses all-to-all instead of recursion */ 00029 #ifndef SC_REDUCE_ALLTOALL_LEVEL 00030 #define SC_REDUCE_ALLTOALL_LEVEL 3 00031 #endif 00032 00033 SC_EXTERN_C_BEGIN; 00034 00035 typedef void (*sc_reduce_t) (void *sendbuf, void *recvbuf, 00036 int sendcount, sc_MPI_Datatype sendtype); 00037 00040 int sc_allreduce_custom (void *sendbuf, void *recvbuf, 00041 int sendcount, 00042 sc_MPI_Datatype sendtype, 00043 sc_reduce_t reduce_fn, 00044 sc_MPI_Comm mpicomm); 00045 00049 int sc_reduce_custom (void *sendbuf, void *recvbuf, 00050 int sendcount, sc_MPI_Datatype sendtype, 00051 sc_reduce_t reduce_fn, 00052 int target, sc_MPI_Comm mpicomm); 00053 00056 int sc_allreduce (void *sendbuf, void *recvbuf, int sendcount, 00057 sc_MPI_Datatype sendtype, 00058 sc_MPI_Op operation, sc_MPI_Comm mpicomm); 00059 00063 int sc_reduce (void *sendbuf, void *recvbuf, int sendcount, 00064 sc_MPI_Datatype sendtype, sc_MPI_Op operation, 00065 int target, sc_MPI_Comm mpicomm); 00066 00067 SC_EXTERN_C_END; 00068 00069 #endif /* !SC_REDUCE_H */