Fande Kong <[email protected]> writes: > Hi all, > > I make a very simple code, but run into some error messages. > > Code: > > #include <petsc.h> > static char help[] = " simple test.\n\n"; > > #undef __FUNCT__ > #define __FUNCT__ "main" > int main(int argc,char **argv) > { > PetscMPIInt tag = 0; > PetscErrorCode ierr; > > ierr = PetscInitialize(&argc,&argv,(char *)0,help);CHKERRQ(ierr);
The error message is not ideal, but the pattern used in PETSc is that each object should PetscCommDuplicate(usercomm,&mycomm,&first_tag). If you need more tags, you would pass "mycomm" to PetscCommGetNewTag(). > ierr = PetscCommGetNewTag(PETSC_COMM_WORLD,&tag);CHKERRQ(ierr); > ierr = PetscPrintf(PETSC_COMM_SELF," tag %d \n", tag);CHKERRQ(ierr); > ierr = PetscFinalize();CHKERRQ(ierr); > }
signature.asc
Description: PGP signature
