xref: /petsc/src/sys/memory/ftn-custom/zmtrf.c (revision 7a4fe282d1b349e95b3be72d69d8dd3d3bcd7bc6)
1ce0a2cd1SBarry Smith #include "private/fortranimpl.h"
255fcb7f5SSatish Balay #include "petsc.h"
355fcb7f5SSatish Balay 
455fcb7f5SSatish Balay #if defined(PETSC_HAVE_FORTRAN_CAPS)
555fcb7f5SSatish Balay #define petscmallocdump_           PETSCMALLOCDUMP
655fcb7f5SSatish Balay #define petscmallocdumplog_        PETSCMALLOCDUMPLOG
755fcb7f5SSatish Balay #define petscmallocvalidate_       PETSCMALLOCVALIDATE
8fe7fb379SMatthew Knepley #define petscmemoryshowusage_      PETSCMEMORYSHOWUSAGE
9*7a4fe282SBarry Smith #define petscmemorysetgetmaximumusage_ PETSCMEMORYSETGETMAXIMUMUSAGE
1055fcb7f5SSatish Balay #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
1155fcb7f5SSatish Balay #define petscmallocdump_           petscmallocdump
1255fcb7f5SSatish Balay #define petscmallocdumplog_        petscmallocdumplog
1355fcb7f5SSatish Balay #define petscmallocvalidate_       petscmallocvalidate
14fe7fb379SMatthew Knepley #define petscmemoryshowusage_      petscmemoryshowusage
15*7a4fe282SBarry Smith #define petscmemorysetgetmaximumusage_ petscmemorysetgetmaximumusage
1655fcb7f5SSatish Balay #endif
1755fcb7f5SSatish Balay 
1855fcb7f5SSatish Balay EXTERN_C_BEGIN
1955fcb7f5SSatish Balay void PETSC_STDCALL  petscmallocdump_(PetscErrorCode *ierr)
2055fcb7f5SSatish Balay {
2155fcb7f5SSatish Balay   *ierr = PetscMallocDump(stdout);
2255fcb7f5SSatish Balay }
2355fcb7f5SSatish Balay void PETSC_STDCALL petscmallocdumplog_(PetscErrorCode *ierr)
2455fcb7f5SSatish Balay {
2555fcb7f5SSatish Balay   *ierr = PetscMallocDumpLog(stdout);
2655fcb7f5SSatish Balay }
2755fcb7f5SSatish Balay 
2855fcb7f5SSatish Balay void PETSC_STDCALL petscmallocvalidate_(PetscErrorCode *ierr)
2955fcb7f5SSatish Balay {
3055fcb7f5SSatish Balay   *ierr = PetscMallocValidate(0,"Unknown Fortran",0,0);
3155fcb7f5SSatish Balay }
3255fcb7f5SSatish Balay 
33*7a4fe282SBarry Smith void PETSC_STDCALL petscmemorysetgetmaximumusage_(PetscErrorCode *ierr)
34*7a4fe282SBarry Smith {
35*7a4fe282SBarry Smith   *ierr = PetscMemorySetGetMaximumUsage();
36*7a4fe282SBarry Smith }
37*7a4fe282SBarry Smith 
38fe7fb379SMatthew Knepley void PETSC_STDCALL petscmemoryshowusage_(PetscViewer *vin, CHAR message PETSC_MIXED_LEN(len), PetscErrorCode *ierr PETSC_END_LEN(len))
39fe7fb379SMatthew Knepley {
40fe7fb379SMatthew Knepley   PetscViewer v;
41fe7fb379SMatthew Knepley   char *msg;
42fe7fb379SMatthew Knepley 
43fe7fb379SMatthew Knepley   FIXCHAR(message,len,msg);
44fe7fb379SMatthew Knepley   PetscPatchDefaultViewers_Fortran(vin,v);
45fe7fb379SMatthew Knepley   *ierr = PetscMemoryShowUsage(v,msg);
46fe7fb379SMatthew Knepley   FREECHAR(message,msg);
47fe7fb379SMatthew Knepley }
48fe7fb379SMatthew Knepley 
4955fcb7f5SSatish Balay EXTERN_C_END
50