[Matrix-SIG] Re: FPIG: dot with error checking

Travis Oliphant Oliphant.Travis@mayo.edu
Tue, 13 Jul 1999 09:59:47 -0500 (CDT)


> Travis,
> 
> I have defined user-friendly dot(x,y) that checks which ??dot to call from
> the BLAS. I have tried also to check that x and y have the same types. If
> they are not, say, x.astype(y.typecode()) is called. It turns out this
> will be a real performance killer. With out this check my dot is
> still 50% faster than Numeric.dot, otherwise it was a little slower.
> 
> In conclusion, I think in doing the interface with f2py, the user should
> be responsible for type conversation. f2py should only result in
> very low level python functions, so that one can write maximally optimised
> code in python -- type conversation should be carried out in the top level
> of application function in order to minimise the nof calls to *.astype().
> Interface generated by f2py, should only check that the arguments are in a
> correct type --- it should not then affect the performance (I hope).
> 
> How do you feel about the policy above?

Yes, I think this is a good plan.  I think we need to empower the user and
make them responsible for a low-level tool like this.  It is always
possible to make an interface that guarantees stability on top of a raw,
optimized one (we should have basic error checking but not try to out
guess the user).

> 
> And how do you feel on continuing this conversation in matrix-sig in order
> to  grab more people into Multipack project?  
> 
> Pearu

Good idea, I'll post this to matrix-sig as well.