<div dir="ltr"><div dir="ltr">Hi All,<br><div><br></div><div>I am curious about why we subtract 128 from the max value of tag? Can we directly use the max tag value?</div><div><br></div><div>Thanks,</div><div><br></div><div>Fande,</div><div><br></div><div><br></div><div><div>PetscErrorCode  PetscCommGetNewTag(MPI_Comm comm,PetscMPIInt *tag)</div><div>{</div><div>  PetscErrorCode   ierr;</div><div>  PetscCommCounter *counter;</div><div>   PetscMPIInt      *maxval,flg;</div><div><br></div><div><br></div><div>  MPI_Comm_get_attr(comm,Petsc_Counter_keyval,&counter,&flg);</div><div>  if (!flg) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_CORRUPT,"Bad MPI communicator supplied; must be a PETSc communicator");</div><div><br></div><div> if (counter->tag < 1) {</div><div>  PetscInfo1(NULL,"Out of tags for object, starting to recycle. Comm reference count %d\n",counter->refcount);</div><div>  MPI_Comm_get_attr(MPI_COMM_WORLD,MPI_TAG_UB,&maxval,&flg);</div><div>    if (!flg) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_LIB,"MPI error: MPI_Comm_get_attr() is not returning a MPI_TAG_UB");</div><div>   <font color="#ff0000"> counter->tag = *maxval - 128;</font> /* hope that any still active tags were issued right at the beginning of the run */</div><div>  }</div><div><br></div><div>  *tag = counter->tag--;</div><div>   if (PetscDefined(USE_DEBUG)) {</div><div>     /*</div><div>     Hanging here means that some processes have called PetscCommGetNewTag() and others have not.</div><div>      */</div><div>    MPI_Barrier(comm);</div><div>  }</div><div>  return(0);</div><div>}</div></div></div></div>