barbagroup/AmgXWrapper

Error in function `getPartVec()`

piyueh opened this issue · 0 comments

With PETSc 3.7.3 compiled under DEBUG MODE (i.e., --with-debugging=1), AmgX wrapper returns an error during the call to a PETSc function, VecISSet(), at line 182. The error message, which is produced by function PetscCheckSameComm(...) in the source code of VecISSet(), complains:

Different communicators in the two objects: Argument # 3 and 1 flag 3.

This may be caused by the fact that tempMPI and devIS at line 182 are created with different MPI communicators.

The reason why this problem didn't show up previously may be that I compiled PETSc under RELEASE MODE during developing AmgX wrapper. And PetscCheckSameComm(...) is doing nothing under release mode.

Though tempMPI and devIS are created with different MPI communicators, the wrapper still works well with released-mode PETSc. This is because we only call VecISSet() on overlapped ranks of the communicators of tempMPI and devIS. And therefore the code works well. However, this code is still dangerous. I have to fix it as soon as possible.