<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Dear all, dear Tim,</div><div>I've seen that you updated the ParallelComm implementation and I've done a few more tests...&nbsp;</div><div><br></div>It seems that the code I sent is failing because the GLOBAL_ID tag has been created by MOAB without a default value and I'm not able to set it<div>without removing the tag.</div><div>I added the following lines before calling tag_get_handle (GLOBAL_ID,...)</div><div><br></div><div><div><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>&nbsp; std::vector&lt;Tag&gt; tags;</div><div>&nbsp; instance.tag_get_tags(tags);</div><div>&nbsp; for (unsigned int i = 0; i &lt; tags.size(); i++)</div><div>&nbsp; {</div><div>&nbsp; &nbsp; std::string name;</div><div>&nbsp; &nbsp; instance.tag_get_name(tags[i], name);</div><div>&nbsp; &nbsp; if (name == "GLOBAL_ID")</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; std::vector&lt;unsigned char&gt; vals(sizeof(int));</div><div>&nbsp; &nbsp; &nbsp; result = instance.tag_get_default_value(tags[i], &amp;vals[0]);</div><div>&nbsp; &nbsp; &nbsp; if (result != MB_SUCCESS)</div><div>&nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; std::cout&lt;&lt;"faile to get globalid tag def value, deleting tag... "&lt;&lt;std::endl;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; instance.tag_delete(tags[i]);</div><div>&nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; }</div><div>&nbsp; }</div></div><div><br></div><div>and know it works as follows...</div><div><div><br></div></div><div><div><div style="word-break: break-all; ">pcomm-&gt;reduce_tags(gid_tag_vec, gid_tag_vec, MPI_SUM, sharedFaces);</div></div></div><div>provides in gid_tag_vec the sum of the tag values on shared faces, so it sums the value of the tag on the owned and on the not_owned entity. This is what I need in my code.</div><div><br></div><div>pcomm-&gt;reduce_tags(gid_tag_vec, gid_sum_tag_vec, MPI_OP_NULL, sharedFaces);</div><div>provides in gid_sum_tag_vec the values of gid_tag_vec on the owned ents, so this call replicates the behavior of exchange_tags.</div><div><br></div><div>As you pointed out there is an issue&nbsp;when you want the result in a different tag, in particular</div><div>pcomm-&gt;reduce_tags(gid_tag_vec, gid_sum_tag_vec, MPI_SUM, sharedFaces);</div><div>returns an error in ParallelComm::unpack_tags() if the tags have different default values.</div><div><br></div><div>Moreover I don't understand if the behavior of&nbsp;</div><div>pcomm-&gt;reduce_tags(gid_tag_vec, gid_sum_tag_vec, MPI_SUM, sharedFaces);</div><div>is correct.</div><div>This call provides in gid_sum_tag_vec the sum of the gid_tag on the owned entity and the gid_sum_tag on the not_owned entity.</div><div>If gid_sum_tag has values on the owned entity these are ignored.&nbsp;</div><div><br></div><div>Thanks for help.</div><div>Lorenzo</div><div></div></div></div></div></div></body></html>