!===============================================================================
!
! tuning_info.F90 - prints values of tuning_* parameters
!
!-------------------------------------------------------------------------------
!
! Copyright (C) 2014-2016 Hinnerk Stueben
!
! This file is part of BQCD -- Berlin Quantum ChromoDynamics program
!
! BQCD is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! BQCD is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with BQCD.  If not, see <http://www.gnu.org/licenses/>.
!
!-------------------------------------------------------------------------------
# include "defs.h"
# define PRINT(var) str = #var; write(unit, fmt) str, STRCAT3(input,FORTRAN_PERCENT,var)  

!-------------------------------------------------------------------------------
subroutine tuning_info(unit)

  use module_input
  use module_function_decl
  implicit none
  integer, intent(in) :: unit
  character(*), parameter :: fmt = "(x, a, x, i0)"
  character(32) :: str

  call begin(unit, "TuningInfo")

  if (my_pe() == 0) then
     PRINT(tuning_cg_version)

     if (input%tuning_cg_version == 1) then
        write(unit, *) "--original implementation--"
        PRINT(tuning_cg_precision_r4)
     endif

     if (input%tuning_cg_version == 2) then
        write(unit, *) "--more flexible implementation--"
        PRINT(tuning_cg_d)
        PRINT(tuning_cg_simd)
        PRINT(tuning_cg_precision)
        PRINT(tuning_cg_loop_blocking)
        PRINT(tuning_cg_block_length)
        PRINT(tuning_cg_mcg_block_length)
        PRINT(tuning_cg_spincol)
        PRINT(tuning_cg_clover)
     endif

     !!!PRINT(tuning_io_ildg)
  endif

  call end(unit, "TuningInfo")
end

!===============================================================================
