On Thu, Dec 10, 2009 at 8:01 PM, Greg Ewing <[email protected]> wrote:
> Lisandro Dalcin wrote:
>> I need to return a MPI_Comm value, and MPI_Comm can be
>> anything (well, it usually is an integer or a pointer, depending on
>> the implementation).
>
> If it's actually a struct, then you're in trouble, because
> an exception value has to be something comparable with
> == in C, and you can't do that with structs.
>

OK. "Anything" was too much. It is an integer typedef or a pointer to
an opaque struct, depending on the MPI implementation. But I make
Cython to see MPI_Comm as a pointer type.

>
> If it's a scalar type, you can probably tell Pyrex that
> it's an int and use an enum for the exception value.
>

Well, at least in Cython, an enum is not compatible with all scalar
types, just with integral types. As I have to return a pointer type, I
loose.


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to