dbcsr_set_config Subroutine

public subroutine dbcsr_set_config(mm_driver, use_mpi_allocator, mm_stack_size, avg_elements_images, num_mult_images, nstacks, use_mpi_rma, num_layers_3D, use_comm_thread, comm_thread_load, mm_dense, multrec_limit, run_on_gpu, accdrv_thread_buffers, accdrv_avoid_after_busy, accdrv_min_flop_process, accdrv_stack_sort, accdrv_min_flop_sort, accdrv_do_inhomogenous, accdrv_binning_nbins, accdrv_binning_binsize, use_mempools_cpu, tas_split_factor, use_acc_g2g)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: mm_driver
logical, intent(in), optional :: use_mpi_allocator
integer, intent(in), optional :: mm_stack_size
integer, intent(in), optional :: avg_elements_images

Maximum number of elements for each image

integer, intent(in), optional :: num_mult_images

Multiplicative factor for number of virtual images

integer, intent(in), optional :: nstacks

Number of stacks to use

logical, intent(in), optional :: use_mpi_rma

use_mpi_rma RMA algorithm

integer, intent(in), optional :: num_layers_3D

num_layers_3D 3D layers

logical, intent(in), optional :: use_comm_thread
integer, intent(in), optional :: comm_thread_load
logical, intent(in), optional :: mm_dense
integer, intent(in), optional :: multrec_limit
logical, intent(in), optional :: run_on_gpu
integer, intent(in), optional :: accdrv_thread_buffers
logical, intent(in), optional :: accdrv_avoid_after_busy
integer, intent(in), optional :: accdrv_min_flop_process
logical, intent(in), optional :: accdrv_stack_sort
integer, intent(in), optional :: accdrv_min_flop_sort
logical, intent(in), optional :: accdrv_do_inhomogenous
integer, intent(in), optional :: accdrv_binning_nbins
integer, intent(in), optional :: accdrv_binning_binsize
logical, intent(in), optional :: use_mempools_cpu
real(kind=real_8), intent(in), optional :: tas_split_factor
logical, intent(in), optional :: use_acc_g2g

Source Code

   SUBROUTINE dbcsr_set_config( &
      mm_driver, &
      use_mpi_allocator, &
      mm_stack_size, &
      avg_elements_images, &
      num_mult_images, &
      nstacks, &
      use_mpi_rma, &
      num_layers_3D, &
      use_comm_thread, &
      comm_thread_load, &
      mm_dense, &
      multrec_limit, &
      run_on_gpu, &
      accdrv_thread_buffers, &
      accdrv_avoid_after_busy, &
      accdrv_min_flop_process, &
      accdrv_stack_sort, &
      accdrv_min_flop_sort, &
      accdrv_do_inhomogenous, &
      accdrv_binning_nbins, &
      accdrv_binning_binsize, &
      use_mempools_cpu, &
      tas_split_factor, &
      use_acc_g2g)

      CHARACTER(len=*), INTENT(IN), OPTIONAL             :: mm_driver
      LOGICAL, INTENT(IN), OPTIONAL                      :: use_mpi_allocator
      INTEGER, INTENT(IN), OPTIONAL                      :: avg_elements_images
         !! Maximum number of elements for each image
      INTEGER, INTENT(IN), OPTIONAL                      :: num_mult_images
         !! Multiplicative factor for number of virtual images
      INTEGER, INTENT(IN), OPTIONAL                      :: nstacks
         !! Number of stacks to use
      INTEGER, INTENT(IN), OPTIONAL                      :: mm_stack_size
      LOGICAL, INTENT(IN), OPTIONAL                      :: use_mpi_rma
         !! use_mpi_rma RMA algorithm
      INTEGER, INTENT(IN), OPTIONAL                      :: num_layers_3D
         !! num_layers_3D 3D layers
      LOGICAL, INTENT(IN), OPTIONAL                      :: use_comm_thread
      INTEGER, INTENT(IN), OPTIONAL                      :: comm_thread_load
      LOGICAL, INTENT(IN), OPTIONAL                      :: mm_dense
      LOGICAL, INTENT(IN), OPTIONAL                      :: run_on_gpu
      INTEGER, INTENT(IN), OPTIONAL                      :: multrec_limit, accdrv_thread_buffers
      LOGICAL, INTENT(IN), OPTIONAL                      :: accdrv_avoid_after_busy
      INTEGER, INTENT(IN), OPTIONAL                      :: accdrv_min_flop_process
      LOGICAL, INTENT(IN), OPTIONAL                      :: accdrv_stack_sort
      INTEGER, INTENT(IN), OPTIONAL                      :: accdrv_min_flop_sort
      LOGICAL, INTENT(IN), OPTIONAL                      :: accdrv_do_inhomogenous
      INTEGER, INTENT(IN), OPTIONAL                      :: accdrv_binning_nbins, &
                                                            accdrv_binning_binsize
      LOGICAL, INTENT(IN), OPTIONAL                      :: use_mempools_cpu
      REAL(KIND=real_8), INTENT(IN), OPTIONAL            :: tas_split_factor
      LOGICAL, INTENT(IN), OPTIONAL                      :: use_acc_g2g

      INTEGER, SAVE                                      :: nthreads = 0

      CALL dbcsr_cfg%use_mpi_allocator%set(use_mpi_allocator)
      CALL dbcsr_cfg%avg_elements_images%set(avg_elements_images)
      CALL dbcsr_cfg%num_mult_images%set(num_mult_images)
      CALL dbcsr_cfg%use_mpi_rma%set(use_mpi_rma)
      CALL dbcsr_cfg%num_layers_3D%set(num_layers_3D)
      CALL dbcsr_cfg%use_comm_thread%set(use_comm_thread)
      CALL dbcsr_cfg%multrec_limit%set(multrec_limit)
      CALL dbcsr_cfg%run_on_gpu%set(run_on_gpu)
      CALL dbcsr_cfg%accdrv_thread_buffers%set(accdrv_thread_buffers)
      CALL dbcsr_cfg%accdrv_avoid_after_busy%set(accdrv_avoid_after_busy)
      CALL dbcsr_cfg%accdrv_min_flop_process%set(accdrv_min_flop_process)
      CALL dbcsr_cfg%accdrv_stack_sort%set(accdrv_stack_sort)
      CALL dbcsr_cfg%accdrv_min_flop_sort%set(accdrv_min_flop_sort)
      CALL dbcsr_cfg%accdrv_do_inhomogenous%set(accdrv_do_inhomogenous)
      CALL dbcsr_cfg%accdrv_binning_nbins%set(accdrv_binning_nbins)
      CALL dbcsr_cfg%accdrv_binning_binsize%set(accdrv_binning_binsize)
      CALL dbcsr_cfg%use_mempools_cpu%set(use_mempools_cpu)
      CALL dbcsr_cfg%tas_split_factor%set(tas_split_factor)
#if defined(__DBCSR_ACC_G2G)
      CALL dbcsr_cfg%use_acc_g2g%set(use_acc_g2g)
#else
      MARK_USED(use_acc_g2g)
#endif

      IF (0 == nthreads) THEN
         nthreads = 1
!$       nthreads = OMP_GET_MAX_THREADS()
      END IF
      ! Change default values
      IF (dbcsr_cfg%use_mpi_rma%val) THEN
         dbcsr_cfg%comm_thread_load%defval = 100
      ELSE
         dbcsr_cfg%comm_thread_load%defval = MAX(0, 90 - (30*nthreads)/8)
      END IF
      CALL dbcsr_cfg%comm_thread_load%set(comm_thread_load)

      CALL dbcsr_cfg%n_stacks%set(nstacks)
      CALL dbcsr_cfg%mm_driver%set(mm_driver)

      ! If ACC is turned-off, use the CPU defaults
      IF (.NOT. PRESENT(mm_stack_size) .AND. .NOT. dbcsr_cfg%run_on_gpu%val) THEN
         CALL dbcsr_cfg%mm_stack_size%set(mm_stack_default_size_cpu)
      ELSE
         CALL dbcsr_cfg%mm_stack_size%set(mm_stack_size)
      END IF

      IF (.NOT. PRESENT(mm_dense) .AND. .NOT. dbcsr_cfg%run_on_gpu%val) THEN
         CALL dbcsr_cfg%mm_dense%set(mm_dense_default_cpu)
      ELSE
         CALL dbcsr_cfg%mm_dense%set(mm_dense)
      END IF

   END SUBROUTINE dbcsr_set_config