Save the current CPU-memory status into a file. File is accessed in append position.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | file_name |
File name. |
||
character(len=*), | intent(in), | optional | :: | tag |
Tag of current status. |
subroutine save_memory_status(file_name, tag) !< Save the current CPU-memory status into a file. !< File is accessed in append position. character(*), intent(in) :: file_name !< File name. character(*), intent(in), optional :: tag !< Tag of current status. character(:), allocatable :: tag_ !< Tag of current status, local var. integer(I8P) :: mem_free, mem_total !< Process memory. integer(I4P) :: file_unit !< File unit. tag_ = '' ; if (present(tag)) tag_ = trim(tag) call get_memory_info(mem_free, mem_total) open(newunit=file_unit, file=trim(file_name), position="append") write(file_unit,*) tag_, mem_free, mem_total close(file_unit) endsubroutine save_memory_status