dbcsr_mm_sched Module

Fourth layer of the dbcsr matrix-matrix multiplication. It hides the differences between performing calculations on the accelerator device or on the CPU. Modification history: - 2010-02-23 Moved from dbcsr_operations - 2011-11 Moved parameter-stack processing routines to dbcsr_mm_methods. - 2013-01 extensive refactoring (Ole Schuett)



Contents


Variables

TypeVisibilityAttributesNameInitial
character(len=*), private, parameter:: moduleN ='dbcsr_mm_sched'
type(stats_type), private, DIMENSION(:), ALLOCATABLE, TARGET, SAVE:: stats_per_thread

Counters for each thread to collect statistics


Derived Types

type, public :: dbcsr_mm_sched_type

Components

TypeVisibilityAttributesNameInitial
type(dbcsr_work_type), private, POINTER:: product_wm=> Null()
type(dbcsr_mm_accdrv_type), private :: accdrv
type(dbcsr_mm_hostdrv_type), private :: hostdrv
logical, private :: avoid_accdrv =.FALSE.
logical, private :: product_wm_cleared =.FALSE.
logical, private :: keep_product_data =.TRUE.
integer, private :: product_wm_orig_datasize =-1

type, private :: stats_type

Components

TypeVisibilityAttributesNameInitial
integer(kind=int_8), public :: cpu_num_stacks =0
integer(kind=int_8), public :: smm_num_stacks =0
integer(kind=int_8), public :: acc_num_stacks =0
integer(kind=int_8), public :: cpu_flop =0
integer(kind=int_8), public :: smm_flop =0
integer(kind=int_8), public :: acc_flop =0
integer(kind=int_8), public :: max_cpu_flop =0
integer(kind=int_8), public :: max_smm_flop =0
integer(kind=int_8), public :: max_acc_flop =0
integer(kind=int_8), public, DIMENSION(:, :), ALLOCATABLE:: num_mnk_stacks
integer(kind=int_4), public, DIMENSION(64):: padding

Subroutines

private subroutine stats_init(stats)

Initialize a stats_type

Arguments

TypeIntentOptionalAttributesName
type(stats_type), intent(inout) :: stats

public subroutine dbcsr_mm_sched_lib_init()

Initialize the library

Arguments

None

public subroutine dbcsr_mm_sched_lib_finalize()

Finalize the library and prints DBCSR statistics

Arguments

None

public subroutine dbcsr_mm_sched_print_statistics(group, output_unit)

Prints DBCSR statistics

Arguments

TypeIntentOptionalAttributesName
integer, intent(in) :: group
integer, intent(in) :: output_unit

private subroutine ensure_product_wm_cleared(this)

Makes sure that the product_wm is cleared.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this

public subroutine dbcsr_mm_sched_init(this, product_wm, nlayers, keep_product_data)

Initializes a multiplication cycle for new set of C-blocks.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this
type(dbcsr_work_type), POINTER:: product_wm
integer, optional :: nlayers
logical, intent(in) :: keep_product_data

public subroutine dbcsr_mm_sched_finalize(this)

Finalizes a multiplication cycle for a set of C-blocks.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this

public subroutine dbcsr_mm_sched_dev2host_init(this)

Finalizes a multiplication cycle for a set of C-blocks.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this

public subroutine dbcsr_mm_sched_begin_burst(this)

Signal begin of a burst of calls to dbcsr_mm_sched_process.

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this

public subroutine dbcsr_mm_sched_end_burst()

Signal end of a burst of calls to dbcsr_mm_sched_process.

Arguments

None

public subroutine dbcsr_mm_sched_barrier()

Signal that previous stacks should be processed first

Arguments

None

public subroutine dbcsr_mm_sched_process(this, left, right, stack_data, stack_fillcount, stack_descr)

Processes a given stack. From here on there is no boundary checking due to assumed-SIZE-arguments. This is useful to check stack parameters, BUT it works only for kind=dp

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this
type(dbcsr_type), intent(in) :: left
type(dbcsr_type), intent(in) :: right
integer, DIMENSION(:, :), POINTER:: stack_data
integer, POINTER:: stack_fillcount
type(stack_descriptor_type), intent(in) :: stack_descr

public subroutine dbcsr_mm_sched_set_orig_datasize(this, newsize)

Change the datasize of the original workspace buffer

Arguments

TypeIntentOptionalAttributesName
type(dbcsr_mm_sched_type), intent(inout) :: this
integer, intent(in) :: newsize

private subroutine stats_add(stats, m, n, k, stacksize_cpu, stacksize_smm, stacksize_acc, nstacks_cpu, nstacks_smm, nstacks_acc)

Helper-routine used by dbcsr_mm_sched_process to supply statistics.

Arguments

TypeIntentOptionalAttributesName
type(stats_type), intent(inout) :: stats
integer, intent(in) :: m
integer, intent(in) :: n
integer, intent(in) :: k
integer(kind=int_8), optional :: stacksize_cpu
integer(kind=int_8), optional :: stacksize_smm
integer(kind=int_8), optional :: stacksize_acc
integer(kind=int_8), optional :: nstacks_cpu
integer(kind=int_8), optional :: nstacks_smm
integer(kind=int_8), optional :: nstacks_acc

private subroutine stats_collect_from_threads(report)

Collects statistics from all OpenMP-threads into report

Arguments

TypeIntentOptionalAttributesName
type(stats_type), intent(inout) :: report

private subroutine stats_collect_from_ranks(report, group)

Collects statistics from all MPI-ranks

Arguments

TypeIntentOptionalAttributesName
type(stats_type), intent(inout) :: report
integer, intent(in) :: group

private subroutine stats_print_report(report, output_unit)

Prints collected statistics

Arguments

TypeIntentOptionalAttributesName
type(stats_type), intent(inout) :: report
integer, intent(in) :: output_unit