xref: /petsc/src/sys/classes/viewer/impls/ams/amsopen.c (revision 07475bc16356fc37e8c66fcce1957fb7d8feef24)
15c6c1daeSBarry Smith 
2*07475bc1SBarry Smith #include <petsc-private/viewerimpl.h>   /*I  "petscsys.h"  */
35c6c1daeSBarry Smith 
45c6c1daeSBarry Smith #undef __FUNCT__
55c6c1daeSBarry Smith #define __FUNCT__ "PetscViewerAMSOpen"
65c6c1daeSBarry Smith /*@C
75c6c1daeSBarry Smith     PetscViewerAMSOpen - Opens an AMS memory snooper PetscViewer.
85c6c1daeSBarry Smith 
95c6c1daeSBarry Smith     Collective on MPI_Comm
105c6c1daeSBarry Smith 
115c6c1daeSBarry Smith     Input Parameters:
125c6c1daeSBarry Smith +   comm - the MPI communicator
135c6c1daeSBarry Smith -   name - name of AMS communicator being created
145c6c1daeSBarry Smith 
155c6c1daeSBarry Smith     Output Parameter:
165c6c1daeSBarry Smith .   lab - the PetscViewer
175c6c1daeSBarry Smith 
185c6c1daeSBarry Smith     Options Database Keys:
195c6c1daeSBarry Smith +   -ams_port <port number> - port number where you are running AMS client
205c6c1daeSBarry Smith .   -ams_publish_objects - publish all PETSc objects to be visible to the AMS memory snooper,
215c6c1daeSBarry Smith                            use PetscObjectAMSPublish() to publish individual objects
225c6c1daeSBarry Smith -   -ams_java - open JAVA AMS client
235c6c1daeSBarry Smith 
245c6c1daeSBarry Smith     Level: advanced
255c6c1daeSBarry Smith 
265c6c1daeSBarry Smith     Fortran Note:
275c6c1daeSBarry Smith     This routine is not supported in Fortran.
285c6c1daeSBarry Smith 
295c6c1daeSBarry Smith     See the matlab/petsc directory in the AMS installation for one example of external
305c6c1daeSBarry Smith     tools that can monitor PETSc objects that have been published.
315c6c1daeSBarry Smith 
325c6c1daeSBarry Smith     Notes:
335c6c1daeSBarry Smith     This PetscViewer can be destroyed with PetscViewerDestroy().
345c6c1daeSBarry Smith 
355c6c1daeSBarry Smith     Information about the AMS is available via http://www.mcs.anl.gov/ams.
365c6c1daeSBarry Smith 
375c6c1daeSBarry Smith    Concepts: AMS
385c6c1daeSBarry Smith    Concepts: ALICE Memory Snooper
395c6c1daeSBarry Smith    Concepts: Asynchronous Memory Snooper
405c6c1daeSBarry Smith 
415c6c1daeSBarry Smith .seealso: PetscObjectAMSPublish(), PetscViewerDestroy(), PetscViewerStringSPrintf()
425c6c1daeSBarry Smith 
435c6c1daeSBarry Smith @*/
445c6c1daeSBarry Smith PetscErrorCode PetscViewerAMSOpen(MPI_Comm comm,const char name[],PetscViewer *lab)
455c6c1daeSBarry Smith {
465c6c1daeSBarry Smith   PetscErrorCode ierr;
475c6c1daeSBarry Smith 
485c6c1daeSBarry Smith   PetscFunctionBegin;
495c6c1daeSBarry Smith   ierr = PetscViewerCreate(comm,lab);CHKERRQ(ierr);
505c6c1daeSBarry Smith   ierr = PetscViewerSetType(*lab,PETSCVIEWERAMS);CHKERRQ(ierr);
515c6c1daeSBarry Smith   ierr = PetscViewerAMSSetCommName(*lab,name);CHKERRQ(ierr);
525c6c1daeSBarry Smith   PetscFunctionReturn(0);
535c6c1daeSBarry Smith }
54