itaps-parallel technical issues in iMeshP.h
Devine, Karen D
kddevin at sandia.gov
Mon Oct 13 14:28:20 CDT 2008
In the currently committed interface, I fixed
* destroyPartitionAll to take partition_handle by value (Jason's request)
* getCopyOnPart to take part_id by value (Ting's request)
* getLocalParts to (1) no longer return num_local_parts, as it was redundant
with part_handles_size and (2) to pass part_handles as iMeshP_PartHandle **
(Karen's fix).
I am also doxygenizing the file; I got through the partition section but I
have a long way to go. This is a good opportunity for proof-reading the
interface, so more minor changes may occur. Thanks for your patience.
Karen
On 10/7/08 8:59 AM, "Jason Kraftcheck" <kraftche at cae.wisc.edu> wrote:
> txie at scorec.rpi.edu wrote:
>> I agree that the argument definition in iMeshP.h should be consistent in
>> one way. And I think that the current argument definition trend in
>> iMeshP.h can be summarized as follows. (I agree with it. )
>>
>> ----------------------------------------
>> If an argument is an 'in' argument (it will not be changed through the
>> function), it is a value not a pointer (except it is an 'array'
>> argument).
>
> And should be a const pointer in the case of an array.
>
>>
>> If an argument is an 'inout' or 'out' argument (it can be changed through
>> the function), it is a pointer.
>> -----------------------------------------
>>
>> Through this way, User may be more clear about the interface function usage.
>>
>> For example, in iMeshP.h, we have:
>>
>> iMeshP_createPart()
>> iMeshP_destroyPart()
>> iMeshP_createPartitionAll()
>> iMeshP_destroyPartitionAll()
>> iMeshP_syncPartitionAll()
>>
>> Since the 'part_handle/partition_handle' argument is changed through the
>> function, it should be a pointer in the function argument list. (However,
>> the 'partition_handle' argument in iMeshP_syncPartitionAll() is not a
>> pointer now. )
>>
>
> The part_handle/partition_handle argument is *not* changed in:
> iMeshP_destroyPart
> iMeshP_syncPartitionAll
> and perhaps
> iMeshP_destroyPartitionAll
>
> The entity that the handle references is changed, not the handle. The
> purpose of passing a pointer to an argument is to allow the called function
> to change the value of that argument. The functions are not changing the
> handle value, and therefore should not be declared as if they were.
>
>
>>
>> PS:
>> One minor thing, in the latest iMeshP.h version,
>>
>> void iMeshP_getCopyOnPart(iMesh_Instance instance,
>> /*in*/ const iMeshP_PartitionHandle partition_handle,
>> /*in*/ const iBase_EntityHandle entity_handle,
>> /*in*/ const iMeshP_Part* part_id,
>> /*out*/ iBase_EntityHandle* copy_entity_handle,
>> int *err);
>>
>> To get one copy on a certain part, I think the 'in' argument 'part_id'
>> should not be a pointer.
>>
>
> I agree with this.
>
>
> - jason
>
>
More information about the itaps-parallel
mailing list