public function my_status_int(key, info, def) result(val)
Read out the first integer in the line matched by the specified key
in the text provided by print_self_status.
The key should include all text in front of the integer.
For example the peak memory consumption up to now could be extracted with:
peakval = my_status_int('VmPeak:')
If the key is not found 0 or the optionally defined value in def
will be returned.
info can be used to change the input that should be read, it defaults to
'/proc/self/status'.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed
arrows point from an interface to procedures which implement that interface.
This could include the module procedures in a generic interface or the
implementation in a submodule of an interface in a parent module.
Source Code
function my_status_int(key,info,def)result(val)! ---------------------------------------------------------------------------character(len=*),intent(in)::key!< Case sensitive!character(len=*),intent(in),optional::infointeger,intent(in),optional::def!< Result for non-existing keysinteger::val! ---------------------------------------------------------------------------character(len=labelLen)::vstring! ---------------------------------------------------------------------------val=0if(present(def))val=defvstring=my_status_string(key,info=info)if(scan(vstring,set='0123456789')>0)then read(vstring,*)valend if end function my_status_int