1*5c6c1daeSBarry Smith 2*5c6c1daeSBarry Smith #include <petsc-private/viewerimpl.h> /*I "petsc.h" */ 3*5c6c1daeSBarry Smith 4*5c6c1daeSBarry Smith #undef __FUNCT__ 5*5c6c1daeSBarry Smith #define __FUNCT__ "PetscViewerAMSOpen" 6*5c6c1daeSBarry Smith /*@C 7*5c6c1daeSBarry Smith PetscViewerAMSOpen - Opens an AMS memory snooper PetscViewer. 8*5c6c1daeSBarry Smith 9*5c6c1daeSBarry Smith Collective on MPI_Comm 10*5c6c1daeSBarry Smith 11*5c6c1daeSBarry Smith Input Parameters: 12*5c6c1daeSBarry Smith + comm - the MPI communicator 13*5c6c1daeSBarry Smith - name - name of AMS communicator being created 14*5c6c1daeSBarry Smith 15*5c6c1daeSBarry Smith Output Parameter: 16*5c6c1daeSBarry Smith . lab - the PetscViewer 17*5c6c1daeSBarry Smith 18*5c6c1daeSBarry Smith Options Database Keys: 19*5c6c1daeSBarry Smith + -ams_port <port number> - port number where you are running AMS client 20*5c6c1daeSBarry Smith . -ams_publish_objects - publish all PETSc objects to be visible to the AMS memory snooper, 21*5c6c1daeSBarry Smith use PetscObjectAMSPublish() to publish individual objects 22*5c6c1daeSBarry Smith - -ams_java - open JAVA AMS client 23*5c6c1daeSBarry Smith 24*5c6c1daeSBarry Smith Level: advanced 25*5c6c1daeSBarry Smith 26*5c6c1daeSBarry Smith Fortran Note: 27*5c6c1daeSBarry Smith This routine is not supported in Fortran. 28*5c6c1daeSBarry Smith 29*5c6c1daeSBarry Smith See the matlab/petsc directory in the AMS installation for one example of external 30*5c6c1daeSBarry Smith tools that can monitor PETSc objects that have been published. 31*5c6c1daeSBarry Smith 32*5c6c1daeSBarry Smith Notes: 33*5c6c1daeSBarry Smith This PetscViewer can be destroyed with PetscViewerDestroy(). 34*5c6c1daeSBarry Smith 35*5c6c1daeSBarry Smith Information about the AMS is available via http://www.mcs.anl.gov/ams. 36*5c6c1daeSBarry Smith 37*5c6c1daeSBarry Smith Concepts: AMS 38*5c6c1daeSBarry Smith Concepts: ALICE Memory Snooper 39*5c6c1daeSBarry Smith Concepts: Asynchronous Memory Snooper 40*5c6c1daeSBarry Smith 41*5c6c1daeSBarry Smith .seealso: PetscObjectAMSPublish(), PetscViewerDestroy(), PetscViewerStringSPrintf() 42*5c6c1daeSBarry Smith 43*5c6c1daeSBarry Smith @*/ 44*5c6c1daeSBarry Smith PetscErrorCode PetscViewerAMSOpen(MPI_Comm comm,const char name[],PetscViewer *lab) 45*5c6c1daeSBarry Smith { 46*5c6c1daeSBarry Smith PetscErrorCode ierr; 47*5c6c1daeSBarry Smith 48*5c6c1daeSBarry Smith PetscFunctionBegin; 49*5c6c1daeSBarry Smith ierr = PetscViewerCreate(comm,lab);CHKERRQ(ierr); 50*5c6c1daeSBarry Smith ierr = PetscViewerSetType(*lab,PETSCVIEWERAMS);CHKERRQ(ierr); 51*5c6c1daeSBarry Smith ierr = PetscViewerAMSSetCommName(*lab,name);CHKERRQ(ierr); 52*5c6c1daeSBarry Smith PetscFunctionReturn(0); 53*5c6c1daeSBarry Smith } 54