[Developers] should we document that CCTK_MyProc(NULL) works?
Erik Schnetter
schnetter at cct.lsu.edu
Fri Jan 12 10:43:25 CST 2007
Err, not documenting it at all is not a good idea. This means that
driver developers have to find out the hard way why their drivers
crash, and why passing a null pointer is necessary. I would document
it as "MyProc and nProcs have to handle that case without crashing",
but also telling the user that the results may not be as expected.
-erik
On Jan 12, 2007, at 10:36:36, Tom Goodale wrote:
> The only problem is that in principle drivers could be using a
> different
> processor mapping - e.g. when using MPI the driver could use a
> different
> communicator - which would give a different result with NULL than
> with a
> cGH, so I would prefer to not document that NULL is acceptable. It is
> only used in the flesh in extreme cases, which are mainly before a
> driver
> has been initialised.
>
> Cheers,
>
> Tom
>
> On Fri, 12 Jan 2007, David Rideout wrote:
>
>> If it is guaranteed to work then there is no need for the argument.
>> Perhaps you might write that most drivers behave this way, but there
>> is no guarantee? And that the calling routine might check that it
>> returns a valid (non-negative) value?
>>
>> Cheers,
>> David
>>
>> On 1/12/07, Jonathan Thornburg <jthorn at aei.mpg.de> wrote:
>>> Hi,
>>>
>>> With all current drivers (or at least all known to the people I've
>>> talked to), it's legal to call CCTK_MyProc() with a NULL GH pointer,
>>> and doing so works (CCTK_MyProc() returns the correct result).
>>>
>>> IMHO this is very useful behavior. For example, it lets code which
>>> doesn't have a GH still generate unique filenames for logging debug
>>> data. The problem is, right now this behavior is not documented in
>>> the Cactus Reference Manual.
>>>
>>> Does anyone object to my documenting the current behavior in the
>>> Cactus Reference Manual? Should we go farther and also promise
>>> (document) that this is guaranteed to work for any driver?
>>>
>>> ciao,
>>>
>>> --
>>> -- Jonathan Thornburg <jthorn at aei.mpg.de>
>>> Max-Planck-Institut fuer Gravitationsphysik (Albert-Einstein-
>>> Institut),
>>> Golm, Germany, "Old Europe" http://www.aei.mpg.de/~jthorn/
>>> home.html
>>> "Washing one's hands of the conflict between the powerful and the
>>> powerless means to side with the powerful, not to be neutral."
>>> -- quote by Freire / poster
>>> by Oxfam
>>>
>>> _______________________________________________
>>> Developers mailing list
>>> Developers at cactuscode.org
>>> http://www.cactuscode.org/mailman/listinfo/developers
>>>
>> _______________________________________________
>> Developers mailing list
>> Developers at cactuscode.org
>> http://www.cactuscode.org/mailman/listinfo/developers
>>
> _______________________________________________
> Developers mailing list
> Developers at cactuscode.org
> http://www.cactuscode.org/mailman/listinfo/developers
>
--
Erik Schnetter <schnetter at cct.lsu.edu>
My email is as private as my paper mail. I therefore support encrypting
and signing email messages. Get my PGP key from www.keyserver.net.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://www.cactuscode.org/pipermail/developers/attachments/20070112/9a2964c2/attachment.bin
More information about the Developers
mailing list