[MOAB-dev] question about reduce_tags behavior

Lorenzo Alessio Botti ihabiamx at yahoo.it
Fri Mar 30 15:40:16 CDT 2012


Dear Tim,
thanks for the reply...

> [cc'ing to moab-dev in case others are interested...]
> 
> I've inserted a few comments below in your code, but in general I think you've got the right idea, and if tag_reduce doesn't work it's probably a bug.  If you could isolate the problem in a simple example (with mesh input), I'd be happy to look at it.  There is a unit test now for this capability, so it's mostly tested.  If I find a bug from your example, I'll fix and add a test for it.
> 

This code should allow to test the ghost face ids on not_owned entities comparing the result of exchange_tags and reduce_tags.
If I compile it with -DNDEBUG and run with mpiexec -n 2 the execution is stopped after reduce_tags because of assertion failure.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: partcheck.cpp
Type: application/octet-stream
Size: 5019 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20120330/ce0f7582/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: square_10x10_100p_quad4.h5m
Type: application/octet-stream
Size: 692564 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20120330/ce0f7582/attachment-0003.obj>
-------------- next part --------------

> On 03/30/2012 08:28 AM, Lorenzo Alessio Botti wrote:
>> Hi Tim,
>> first of all sorry to bother you with something that is not fully tested yet.
>> I have just installed moab-4.5...
>> 
>> After having created a non unique global id for shared faces which I have stored as an integer in gid_tag,
>> I'd like to know if the following
>> 
>> int zero = 0;
>> Tag gid_sum_tag;
>> result = _instance.tag_get_handle("__global_id_sum", 1, MB_TYPE_INTEGER,
>> gid_sum_tag, MB_TAG_DENSE|MB_TAG_CREAT, &zero);
>> Range sharedFaces;
>> result = _instance.get_entities_by_dimension(0,dim-1,sharedFaces);
>> result = pcomm->filter_pstatus(sharedFaces, PSTATUS_SHARED, PSTATUS_AND);
> 
> Probably a better way to get shared faces is to use:
> 
> ErrorCode get_shared_entities(int other_proc,
>                                  Range &shared_ents,
>                                  int dim = -1,
>                                  const bool iface = false,
>                                  const bool owned_filter = false);
> 

Thanks!


>> std::vector<Tag> gid_tag_vec;
>> gid_tag_vec.push_back(gid_tag);
>> std::vector<Tag> gid_sum_tag_vec;
>> gid_sum_tag_vec.push_back(gid_sum_tag);
>> pcomm->reduce_tags(gid_tag_vec, gid_sum_tag_vec, MPI_SUM, sharedFaces);
> 
> I'll make another variant with two tag handles, so you don't need to create two temporary std::vector's.

and thanks.

Lorenzo


More information about the moab-dev mailing list