2
* Copyright (c) 2003, 2007-11 Matteo Frigo
3
* Copyright (c) 2003, 2007-11 Massachusetts Institute of Technology
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
#include "ifftw-mpi.h"
23
/* During planning, if any process fails to create a plan then
24
all of the processes must fail. This synchronization is implemented
25
by the following routine.
28
if (failure) goto nada;
30
if (any_true(failure, comm)) goto nada;
33
int XM(any_true)(int condition, MPI_Comm comm)
36
MPI_Allreduce(&condition, &result, 1, MPI_INT, MPI_LOR, comm);
40
/***********************************************************************/
42
#if defined(FFTW_DEBUG)
43
/* for debugging, we include an assertion to make sure that
44
MPI problems all produce equal hashes, as checked by this routine: */
46
int XM(md5_equal)(md5 m, MPI_Comm comm)
52
for (i = 0; i < 4; ++i) s0[i] = m.s[i];
53
MPI_Bcast(s0, 4, MPI_UNSIGNED_LONG, 0, comm);
54
for (i = 0; i < 4 && s0[i] == m.s[i]; ++i) ;
56
MPI_Allreduce(&eq_me, &eq_all, 1, MPI_INT, MPI_LAND, comm);