15c6c1daeSBarry Smith 207475bc1SBarry Smith #include <petsc-private/viewerimpl.h> /*I "petscsys.h" */ 3*38dc1537SBarry Smith #include <petscviewerams.h> 45c6c1daeSBarry Smith 55c6c1daeSBarry Smith #undef __FUNCT__ 65c6c1daeSBarry Smith #define __FUNCT__ "PetscViewerAMSOpen" 75c6c1daeSBarry Smith /*@C 85c6c1daeSBarry Smith PetscViewerAMSOpen - Opens an AMS memory snooper PetscViewer. 95c6c1daeSBarry Smith 105c6c1daeSBarry Smith Collective on MPI_Comm 115c6c1daeSBarry Smith 125c6c1daeSBarry Smith Input Parameters: 135c6c1daeSBarry Smith + comm - the MPI communicator 145c6c1daeSBarry Smith - name - name of AMS communicator being created 155c6c1daeSBarry Smith 165c6c1daeSBarry Smith Output Parameter: 175c6c1daeSBarry Smith . lab - the PetscViewer 185c6c1daeSBarry Smith 195c6c1daeSBarry Smith Options Database Keys: 205c6c1daeSBarry Smith + -ams_port <port number> - port number where you are running AMS client 215c6c1daeSBarry Smith . -ams_publish_objects - publish all PETSc objects to be visible to the AMS memory snooper, 225c6c1daeSBarry Smith use PetscObjectAMSPublish() to publish individual objects 235c6c1daeSBarry Smith - -ams_java - open JAVA AMS client 245c6c1daeSBarry Smith 255c6c1daeSBarry Smith Level: advanced 265c6c1daeSBarry Smith 275c6c1daeSBarry Smith Fortran Note: 285c6c1daeSBarry Smith This routine is not supported in Fortran. 295c6c1daeSBarry Smith 305c6c1daeSBarry Smith See the matlab/petsc directory in the AMS installation for one example of external 315c6c1daeSBarry Smith tools that can monitor PETSc objects that have been published. 325c6c1daeSBarry Smith 335c6c1daeSBarry Smith Notes: 345c6c1daeSBarry Smith This PetscViewer can be destroyed with PetscViewerDestroy(). 355c6c1daeSBarry Smith 36*38dc1537SBarry Smith This viewer is currently different than other viewers in that you cannot pass this viewer to XXXView() to view the XXX object. 37*38dc1537SBarry Smith PETSC_VIEWER_AMS_() is used by PetscObjectAMSPublish() to connect to that particular AMS communicator. 38*38dc1537SBarry Smith 395c6c1daeSBarry Smith Information about the AMS is available via http://www.mcs.anl.gov/ams. 405c6c1daeSBarry Smith 415c6c1daeSBarry Smith Concepts: AMS 425c6c1daeSBarry Smith Concepts: ALICE Memory Snooper 435c6c1daeSBarry Smith Concepts: Asynchronous Memory Snooper 445c6c1daeSBarry Smith 45*38dc1537SBarry Smith .seealso: PetscObjectAMSPublish(), PetscViewerDestroy(), PetscViewerStringSPrintf(), PETSC_VIEWER_AMS_(), 46*38dc1537SBarry Smith PetscObjectAMSPublish(), PetscObjectAMSUnPublish(), PetscObjectAMSTakeAccess(), PetscObjectAMSGrantAccess() 475c6c1daeSBarry Smith 485c6c1daeSBarry Smith @*/ 495c6c1daeSBarry Smith PetscErrorCode PetscViewerAMSOpen(MPI_Comm comm,const char name[],PetscViewer *lab) 505c6c1daeSBarry Smith { 515c6c1daeSBarry Smith PetscErrorCode ierr; 525c6c1daeSBarry Smith 535c6c1daeSBarry Smith PetscFunctionBegin; 545c6c1daeSBarry Smith ierr = PetscViewerCreate(comm,lab);CHKERRQ(ierr); 555c6c1daeSBarry Smith ierr = PetscViewerSetType(*lab,PETSCVIEWERAMS);CHKERRQ(ierr); 565c6c1daeSBarry Smith ierr = PetscViewerAMSSetCommName(*lab,name);CHKERRQ(ierr); 575c6c1daeSBarry Smith PetscFunctionReturn(0); 585c6c1daeSBarry Smith } 59