On Thu, 17 Sep 2009, Roy Stogner wrote:

> We use Parallel::datatype<> to wrap a bunch of MPI calls into a much
> nicer interface.  Unfortunately, it looks like MPI_DOUBLE_COMPLEX is a
> Fortran-only datatype, and MPI::DOUBLE_COMPLEX requires a C++ MPI2
> standard whereas we've been trying to stay C MPI1 compatible, so we
> have to write special template definition for Parallel operations
> on std::complex data.  If allgather code ever tried to use a
> non-special template definition, this is the error you'd see.
>
> Ben added a new Parallel::allgather() argument a while back, but he
> did it properly on both the regular and complex versions - I'm not
> sure what the problem here could be.  I'll keep looking.

Okay, I've found the problem.

Ben cleaned up the API a bit, so that Parallel::send and
Parallel::receive (and nonblocking_send, etc.) all take an optional
DataType argument; if a wrapper function is called where that argument
isn't present it is assumed to be datatype<T> for the data of type T
being sent.

But datatype<std::complex<T> > doesn't exist, and somehow during those
API changes we neglected to notice the new discrepancy between the
regular and complex send/receive call versions.

Fix A would be to add the DataType argument to the complex call
implementations, and add a "phony" datatype<std::complex<T> > that
gets ignored by those implementations.  The trouble with this is that
I *like* having datatype<std::complex<T> > be undefined, because then
if someone really does try to use it, the error gets flagged at
compile time instead of run time.  And, as in this case, compile time
errors are usually much easier to reproduce and fix.

Fix B would be to create complex send/receive call versions for the
wrapper functions.  This one requires more code, but it's all simple
code.  I'll start on that now, unless Ben chimes in to disagree.
---
Roy

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to