<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... </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> std::vector<Tag> tags;</div><div> instance.tag_get_tags(tags);</div><div> for (unsigned int i = 0; i < tags.size(); i++)</div><div> {</div><div> std::string name;</div><div> instance.tag_get_name(tags[i], name);</div><div> if (name == "GLOBAL_ID")</div><div> {</div><div> std::vector<unsigned char> vals(sizeof(int));</div><div> result = instance.tag_get_default_value(tags[i], &vals[0]);</div><div> if (result != MB_SUCCESS)</div><div> {</div><div> std::cout<<"faile to get globalid tag def value, deleting tag... "<<std::endl;</div><div> instance.tag_delete(tags[i]);</div><div> }</div><div> }</div><div> }</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->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->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 when you want the result in a different tag, in particular</div><div>pcomm->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 </div><div>pcomm->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. </div><div><br></div><div>Thanks for help.</div><div>Lorenzo</div><div></div></div></div></div></div></body></html>