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