xref: /petsc/src/sys/memory/ftn-custom/zmtrf.c (revision ce0a2cd1da0658c2b28aad1be2e2c8e41567bece)
1*ce0a2cd1SBarry 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
955fcb7f5SSatish Balay #elif !defined(PETSC_HAVE_FORTRAN_UNDERSCORE)
1055fcb7f5SSatish Balay #define petscmallocdump_           petscmallocdump
1155fcb7f5SSatish Balay #define petscmallocdumplog_        petscmallocdumplog
1255fcb7f5SSatish Balay #define petscmallocvalidate_       petscmallocvalidate
13fe7fb379SMatthew Knepley #define petscmemoryshowusage_      petscmemoryshowusage
1455fcb7f5SSatish Balay #endif
1555fcb7f5SSatish Balay 
1655fcb7f5SSatish Balay EXTERN_C_BEGIN
1755fcb7f5SSatish Balay void PETSC_STDCALL  petscmallocdump_(PetscErrorCode *ierr)
1855fcb7f5SSatish Balay {
1955fcb7f5SSatish Balay   *ierr = PetscMallocDump(stdout);
2055fcb7f5SSatish Balay }
2155fcb7f5SSatish Balay void PETSC_STDCALL petscmallocdumplog_(PetscErrorCode *ierr)
2255fcb7f5SSatish Balay {
2355fcb7f5SSatish Balay   *ierr = PetscMallocDumpLog(stdout);
2455fcb7f5SSatish Balay }
2555fcb7f5SSatish Balay 
2655fcb7f5SSatish Balay void PETSC_STDCALL petscmallocvalidate_(PetscErrorCode *ierr)
2755fcb7f5SSatish Balay {
2855fcb7f5SSatish Balay   *ierr = PetscMallocValidate(0,"Unknown Fortran",0,0);
2955fcb7f5SSatish Balay }
3055fcb7f5SSatish Balay 
31fe7fb379SMatthew Knepley void PETSC_STDCALL petscmemoryshowusage_(PetscViewer *vin, CHAR message PETSC_MIXED_LEN(len), PetscErrorCode *ierr PETSC_END_LEN(len))
32fe7fb379SMatthew Knepley {
33fe7fb379SMatthew Knepley   PetscViewer v;
34fe7fb379SMatthew Knepley   char *msg;
35fe7fb379SMatthew Knepley 
36fe7fb379SMatthew Knepley   FIXCHAR(message,len,msg);
37fe7fb379SMatthew Knepley   PetscPatchDefaultViewers_Fortran(vin,v);
38fe7fb379SMatthew Knepley   *ierr = PetscMemoryShowUsage(v,msg);
39fe7fb379SMatthew Knepley   FREECHAR(message,msg);
40fe7fb379SMatthew Knepley }
41fe7fb379SMatthew Knepley 
4255fcb7f5SSatish Balay EXTERN_C_END
43