To tie up this thread for the web archives -- I just replied to the
original post (short version: definite bug in OMPI, committed fix to
trunk, will be in upcoming 1.0.2 release):
http://www.open-mpi.org/community/lists/users/2006/03/0781.php
On Mar 3, 2006, at 3:05 PM, Andy Selle wrote:
Sorry for the repeat from the user list, but in retrospect, it is
probably
more appropriate on this list, but here goes:
I am trying to do a reduction using a bool type using the C++
bindings. I am
using this sample program to test:
---------------------------------------------
#include <mpi.h>
#include <iostream>
int main(int argc,char *argv[])
{
MPI::Init();
int rank=MPI::COMM_WORLD.Get_rank();
{bool test=true;
bool result;
MPI::COMM_WORLD.Allreduce(&test,&result,1,MPI::BOOL,MPI::LOR);
std::cout<<"rank "<<rank<<" got in="<<test<<"
out="<<result<<std::endl;}
MPI::Finalize();
return 0;
}
---------------------------------------------
The result of running this on OpenMPI is:
---------------------------------------------
[div:17034] *** An error occurred in MPI_Allreduce: the reduction
operation
MPI_LOR is not defined on the MPI_CXX_BOOL datatype
[div:17034] *** on communicator MPI_COMM_WORLD
[div:17034] *** MPI_ERR_OP: invalid reduce operation
[div:17034] *** MPI_ERRORS_ARE_FATAL (goodbye)
[div:17034] [0,0,0] ORTE_ERROR_LOG: Not found in file
pls_base_proxy.c at line
183
---------------------------------------------
Alternatively on LAM this works fine and I get:
---------------------------------------------
aselle@div mpi $ mpirun -np 4 ./reduce.lam
rank 0 got in=1 out=1
rank 1 got in=1 out=1
rank 2 got in=1 out=1
rank 3 got in=1 out=1
---------------------------------------------
Looking at OpenMPI's source it doesn't seem like there is a type
map entry for
the bool case in the op_predefined.c
---------
#undef current_func
#define current_func(a, b) ((a) || (b))
/* C integer */
FUNC_FUNC(lor, int, int)
FUNC_FUNC(lor, long, long)
FUNC_FUNC(lor, short, short)
FUNC_FUNC(lor, unsigned_short, unsigned short)
FUNC_FUNC(lor, unsigned, unsigned)
FUNC_FUNC(lor, unsigned_long, unsigned long)
#if HAVE_LONG_LONG
FUNC_FUNC(lor, long_long_int, long long int)
FUNC_FUNC(lor, long_long, long long)
FUNC_FUNC(lor, unsigned_long_long, unsigned long long)
#endif
/* Logical */
#if OMPI_HAVE_FORTRAN_LOGICAL
FUNC_FUNC(lor, fortran_logical, ompi_fortran_logical_t)
#endif
I am using OpenMPI 1.0.1.
-Andy
_______________________________________________
devel mailing list
de...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/devel
--
{+} Jeff Squyres
{+} The Open MPI Project
{+} http://www.open-mpi.org/