On Tue, 22 Jul 2008, Peter W. Draper wrote:
>>> array argument. Now I presume CNF is not thread safe, so it could be
>>> possible for the allocation of integer identifiers for each malloced
>>> memory block to go up the spout. Could it be possible that the same
>>> integer identifier is being issued for different memory blocks? Or
>>> maybe the other way round - different integer identifiers being
>>> associated with the same memory block?
>>
>> That is a possibility I think because even though the CNF integer
>> corresponding to the C pointer is unique to the pointer (it uses some bit
>> masking) the array it is stored in in CNF is not protected by a mutex so
>> it could be that two routines are trying to store different pointers into
>> the same slot. I can't really remember how it all worked but it might need
>> tweaking.
>>
>> Since David is on holiday now, would it be possible for Peter to take a
>> quick look at CNF?
>
> Yes, I was sitting here having just these thoughts... I'm betting this is
> the smoking gun for the SLA problems.
Just as well there wasn't any money or beer on that, as this cannot be the
SLA problem. SLA doesn't use CNF registered memory in the Fortran wrappers
(or in fact any dynamic memory as far as I can see). So it's back to plan
A and wrapping all the calls.
Just for reference, there is definitely an issue in CNF, the list of
registered pointers uses various global variables which would require
wrapping with a mutex, if this layer was used in a threading context. This
there any indication that's true? If so I'll make the necessary changes --
don't want to leap at that as this is probably an area with a potential
performance hit.
Peter.
|