Octopus
profiling_oct_m Module Reference

/* To use the profiling module, call profiling_in and profiling_out with the label of the region as argument around the regions you want to profile. The module then cares about creating the profile_t objects and stores them in a hashmap so they can be retrieved using their label. More...

Detailed Description

/* To use the profiling module, call profiling_in and profiling_out with the label of the region as argument around the regions you want to profile. The module then cares about creating the profile_t objects and stores them in a hashmap so they can be retrieved using their label.

This module works in the following way:

Each profile_t object measures two times:

total time: time spent inside the profiling region self time: the total time minus the time spent in profiling regions called inside

To implement this there is a current pointer that holds the innermost region active. When a new profile_t is activated, it puts itself as current and stores the previous current pointer as parent. When it is deactivated it sets back current as its parent and subtracts the time spent from the parent`s self time.

This scheme will fail with recursive calls, but we dont use that and I dont think we will need it.

To be able to print the profiling results, there is an array with pointers to all initialized profile_t. For simplicity this array is static with size MAX_PROFILES, eventually it should be incremented. It could be replaced by a linked list, but I don`t think this is necessary.

Data Types

type  profile_pointer_t
 
type  profile_t
 
type  profile_vars_t
 
interface  profiling_count_operations
 
interface  profiling_count_transfers
 

Functions/Subroutines

subroutine, public profiling_init (namespace)
 Create profiling subdirectory. More...
 
subroutine, public profiling_end (namespace)
 
subroutine profile_init (this, label)
 Initialize a profile object and add it to the list. More...
 
subroutine, public profiling_in (label, exclude)
 Increment in counter and save entry time. More...
 
subroutine, public profiling_out (label)
 Increment out counter and sum up difference between entry and exit time. More...
 
subroutine iprofiling_count_operations (ops)
 
subroutine rprofiling_count_operations (ops)
 
subroutine dprofiling_count_operations (ops)
 
subroutine profiling_count_tran_int_l (trf, type)
 
subroutine profiling_count_tran_int_8_l (trf, type)
 
subroutine profiling_count_tran_real_4_l (trf, type)
 
subroutine profiling_count_tran_real_8_l (trf, type)
 
subroutine profiling_count_tran_complex_4_l (trf, type)
 
subroutine profiling_count_tran_complex_8_l (trf, type)
 
subroutine profiling_count_tran_type_l (trf, type)
 
subroutine profiling_count_tran_int (trf, type)
 
subroutine profiling_count_tran_int_8 (trf, type)
 
subroutine profiling_count_tran_real_4 (trf, type)
 
subroutine profiling_count_tran_real_8 (trf, type)
 
subroutine profiling_count_tran_complex_4 (trf, type)
 
subroutine profiling_count_tran_complex_8 (trf, type)
 
subroutine profiling_count_tran_type (trf, type)
 
real(real64) function profile_total_time (this)
 
real(real64) function profile_self_time (this)
 
real(real64) function profile_total_time_per_call (this)
 
real(real64) function profile_min_time (this)
 
real(real64) function profile_self_time_per_call (this)
 
real(real64) function profile_total_throughput (this)
 
real(real64) function profile_total_bandwidth (this)
 
real(real64) function profile_self_throughput (this)
 
real(real64) function profile_self_bandwidth (this)
 
integer function profile_num_calls (this)
 
character(label_length) function profile_label (this)
 
subroutine profiling_output (namespace)
 Write profiling results of each node to profiling.NNN/profiling.nnn The format of each line is tag-label pass_in pass_out time time/pass_in. More...
 
subroutine profiling_make_position_str (var, file, line, str)
 
subroutine profiling_memory_log (type, var, file, line, size)
 
subroutine, public profiling_memory_allocate (var, file, line, size_)
 
subroutine, public profiling_memory_deallocate (var, file, line, size)
 
pure character(len=1) function char_to_upper (c_in)
 
pure character(len=len(string)) function to_upper (string)
 

Variables

integer, parameter label_length = 40
 Max. number of characters of tag label. More...
 
integer, parameter max_profiles = 300
 Max. number of tags. More...
 
integer, parameter, public profiling_time = 1
 
integer, parameter, public profiling_memory = 2
 
integer, parameter, public profiling_memory_full = 4
 
integer, parameter, public profiling_likwid = 8
 
integer, parameter, public profiling_io = 16
 
integer, parameter max_memory_vars = 25
 
type(profile_vars_t), target, save, public prof_vars
 
type(sphash_t), save profiling_map
 

Function/Subroutine Documentation

◆ profiling_init()

subroutine, public profiling_oct_m::profiling_init ( type(namespace_t), intent(in)  namespace)

Create profiling subdirectory.

Definition at line 263 of file profiling.F90.

◆ profiling_end()

subroutine, public profiling_oct_m::profiling_end ( type(namespace_t), intent(in)  namespace)

Definition at line 454 of file profiling.F90.

◆ profile_init()

subroutine profiling_oct_m::profile_init ( type(profile_t), intent(out), target  this,
character(*), intent(in)  label 
)
private

Initialize a profile object and add it to the list.

Definition at line 534 of file profiling.F90.

◆ profiling_in()

subroutine, public profiling_oct_m::profiling_in ( character(*), intent(in)  label,
logical, intent(in), optional  exclude 
)

Increment in counter and save entry time.

Parameters
[in]exclude.true. The time spent here is also excluded from the parent total_time. Only use it for functions that otherwise would spoil statistics.

Definition at line 603 of file profiling.F90.

◆ profiling_out()

subroutine, public profiling_oct_m::profiling_out ( character(*), intent(in)  label)

Increment out counter and sum up difference between entry and exit time.

Definition at line 671 of file profiling.F90.

◆ iprofiling_count_operations()

subroutine profiling_oct_m::iprofiling_count_operations ( integer, intent(in)  ops)
private

Definition at line 745 of file profiling.F90.

◆ rprofiling_count_operations()

subroutine profiling_oct_m::rprofiling_count_operations ( real(4), intent(in)  ops)
private

Definition at line 757 of file profiling.F90.

◆ dprofiling_count_operations()

subroutine profiling_oct_m::dprofiling_count_operations ( real(real64), intent(in)  ops)
private

Definition at line 769 of file profiling.F90.

◆ profiling_count_tran_int_l()

subroutine profiling_oct_m::profiling_count_tran_int_l ( integer(int64), intent(in)  trf,
integer, intent(in)  type 
)
private

Definition at line 782 of file profiling.F90.

◆ profiling_count_tran_int_8_l()

subroutine profiling_oct_m::profiling_count_tran_int_8_l ( integer(int64), intent(in)  trf,
integer(int64), intent(in)  type 
)
private

Definition at line 795 of file profiling.F90.

◆ profiling_count_tran_real_4_l()

subroutine profiling_oct_m::profiling_count_tran_real_4_l ( integer(int64), intent(in)  trf,
real(4), intent(in)  type 
)
private

Definition at line 808 of file profiling.F90.

◆ profiling_count_tran_real_8_l()

subroutine profiling_oct_m::profiling_count_tran_real_8_l ( integer(int64), intent(in)  trf,
real(real64), intent(in)  type 
)
private

Definition at line 822 of file profiling.F90.

◆ profiling_count_tran_complex_4_l()

subroutine profiling_oct_m::profiling_count_tran_complex_4_l ( integer(int64), intent(in)  trf,
complex(4), intent(in)  type 
)
private

Definition at line 836 of file profiling.F90.

◆ profiling_count_tran_complex_8_l()

subroutine profiling_oct_m::profiling_count_tran_complex_8_l ( integer(int64), intent(in)  trf,
complex(real64), intent(in)  type 
)
private

Definition at line 850 of file profiling.F90.

◆ profiling_count_tran_type_l()

subroutine profiling_oct_m::profiling_count_tran_type_l ( integer(int64), intent(in)  trf,
type(type_t), intent(in)  type 
)
private

Definition at line 864 of file profiling.F90.

◆ profiling_count_tran_int()

subroutine profiling_oct_m::profiling_count_tran_int ( integer, intent(in)  trf,
integer, intent(in)  type 
)
private

Definition at line 878 of file profiling.F90.

◆ profiling_count_tran_int_8()

subroutine profiling_oct_m::profiling_count_tran_int_8 ( integer, intent(in)  trf,
integer(int64), intent(in)  type 
)
private

Definition at line 891 of file profiling.F90.

◆ profiling_count_tran_real_4()

subroutine profiling_oct_m::profiling_count_tran_real_4 ( integer, intent(in)  trf,
real(4), intent(in)  type 
)
private

Definition at line 904 of file profiling.F90.

◆ profiling_count_tran_real_8()

subroutine profiling_oct_m::profiling_count_tran_real_8 ( integer, intent(in)  trf,
real(real64), intent(in)  type 
)
private

Definition at line 918 of file profiling.F90.

◆ profiling_count_tran_complex_4()

subroutine profiling_oct_m::profiling_count_tran_complex_4 ( integer, intent(in)  trf,
complex(4), intent(in)  type 
)
private

Definition at line 932 of file profiling.F90.

◆ profiling_count_tran_complex_8()

subroutine profiling_oct_m::profiling_count_tran_complex_8 ( integer, intent(in)  trf,
complex(real64), intent(in)  type 
)
private

Definition at line 946 of file profiling.F90.

◆ profiling_count_tran_type()

subroutine profiling_oct_m::profiling_count_tran_type ( integer, intent(in)  trf,
type(type_t), intent(in)  type 
)
private

Definition at line 960 of file profiling.F90.

◆ profile_total_time()

real(real64) function profiling_oct_m::profile_total_time ( type(profile_t), intent(in)  this)
private

Definition at line 972 of file profiling.F90.

◆ profile_self_time()

real(real64) function profiling_oct_m::profile_self_time ( type(profile_t), intent(in)  this)
private

Definition at line 983 of file profiling.F90.

◆ profile_total_time_per_call()

real(real64) function profiling_oct_m::profile_total_time_per_call ( type(profile_t), intent(in)  this)
private

Definition at line 994 of file profiling.F90.

◆ profile_min_time()

real(real64) function profiling_oct_m::profile_min_time ( type(profile_t), intent(in)  this)
private

Definition at line 1005 of file profiling.F90.

◆ profile_self_time_per_call()

real(real64) function profiling_oct_m::profile_self_time_per_call ( type(profile_t), intent(in)  this)
private

Definition at line 1016 of file profiling.F90.

◆ profile_total_throughput()

real(real64) function profiling_oct_m::profile_total_throughput ( type(profile_t), intent(in)  this)
private

Definition at line 1027 of file profiling.F90.

◆ profile_total_bandwidth()

real(real64) function profiling_oct_m::profile_total_bandwidth ( type(profile_t), intent(in)  this)
private

Definition at line 1044 of file profiling.F90.

◆ profile_self_throughput()

real(real64) function profiling_oct_m::profile_self_throughput ( type(profile_t), intent(in)  this)
private

Definition at line 1060 of file profiling.F90.

◆ profile_self_bandwidth()

real(real64) function profiling_oct_m::profile_self_bandwidth ( type(profile_t), intent(in)  this)
private

Definition at line 1076 of file profiling.F90.

◆ profile_num_calls()

integer function profiling_oct_m::profile_num_calls ( type(profile_t), intent(in)  this)
private

Definition at line 1092 of file profiling.F90.

◆ profile_label()

character(label_length) function profiling_oct_m::profile_label ( type(profile_t), intent(in)  this)
private

Definition at line 1103 of file profiling.F90.

◆ profiling_output()

subroutine profiling_oct_m::profiling_output ( type(namespace_t), intent(in)  namespace)
private

Write profiling results of each node to profiling.NNN/profiling.nnn The format of each line is tag-label pass_in pass_out time time/pass_in.

The last column gives the average time consumed between in and out (only, if pass_in and pass_out are equal).

Definition at line 1120 of file profiling.F90.

◆ profiling_make_position_str()

subroutine profiling_oct_m::profiling_make_position_str ( character(len=*), intent(in)  var,
character(len=*), intent(in)  file,
integer, intent(in)  line,
character(len=*), intent(out)  str 
)
private

Definition at line 1314 of file profiling.F90.

◆ profiling_memory_log()

subroutine profiling_oct_m::profiling_memory_log ( character(len=*), intent(in)  type,
character(len=*), intent(in)  var,
character(len=*), intent(in)  file,
integer, intent(in)  line,
integer(int64), intent(in)  size 
)
private

Definition at line 1347 of file profiling.F90.

◆ profiling_memory_allocate()

subroutine, public profiling_oct_m::profiling_memory_allocate ( character(len=*), intent(in)  var,
character(len=*), intent(in)  file,
integer, intent(in)  line,
integer(int64), intent(in)  size_ 
)

Definition at line 1371 of file profiling.F90.

◆ profiling_memory_deallocate()

subroutine, public profiling_oct_m::profiling_memory_deallocate ( character(len=*), intent(in)  var,
character(len=*), intent(in)  file,
integer, intent(in)  line,
integer(int64), intent(in)  size 
)

Definition at line 1442 of file profiling.F90.

◆ char_to_upper()

pure character(len=1) function profiling_oct_m::char_to_upper ( character(len=1), intent(in)  c_in)
private

Definition at line 1464 of file profiling.F90.

◆ to_upper()

pure character(len=len(string)) function profiling_oct_m::to_upper ( character(len=*), intent(in)  string)
private

Definition at line 1480 of file profiling.F90.

Variable Documentation

◆ label_length

integer, parameter profiling_oct_m::label_length = 40
private

Max. number of characters of tag label.

Definition at line 153 of file profiling.F90.

◆ max_profiles

integer, parameter profiling_oct_m::max_profiles = 300
private

Max. number of tags.

Definition at line 153 of file profiling.F90.

◆ profiling_time

integer, parameter, public profiling_oct_m::profiling_time = 1

Definition at line 213 of file profiling.F90.

◆ profiling_memory

integer, parameter, public profiling_oct_m::profiling_memory = 2

Definition at line 213 of file profiling.F90.

◆ profiling_memory_full

integer, parameter, public profiling_oct_m::profiling_memory_full = 4

Definition at line 213 of file profiling.F90.

◆ profiling_likwid

integer, parameter, public profiling_oct_m::profiling_likwid = 8

Definition at line 213 of file profiling.F90.

◆ profiling_io

integer, parameter, public profiling_oct_m::profiling_io = 16

Definition at line 213 of file profiling.F90.

◆ max_memory_vars

integer, parameter profiling_oct_m::max_memory_vars = 25
private

Definition at line 220 of file profiling.F90.

◆ prof_vars

type(profile_vars_t), target, save, public profiling_oct_m::prof_vars

Definition at line 255 of file profiling.F90.

◆ profiling_map

type(sphash_t), save profiling_oct_m::profiling_map
private

Definition at line 257 of file profiling.F90.