system_info_wrapper.F90 Source File


This file depends on

sourcefile~~system_info_wrapper.f90~~EfferentGraph sourcefile~system_info_wrapper.f90 system_info_wrapper.F90 sourcefile~c_utils.f90 c_utils.F90 sourcefile~system_info_wrapper.f90->sourcefile~c_utils.f90 sourcefile~memory_stats.f90 memory_stats.F90 sourcefile~c_utils.f90->sourcefile~memory_stats.f90 sourcefile~signal_flag.f90 signal_flag.F90 sourcefile~c_utils.f90->sourcefile~signal_flag.f90 sourcefile~system_info.f90 system_info.F90 sourcefile~c_utils.f90->sourcefile~system_info.f90

Files dependent on this one

sourcefile~~system_info_wrapper.f90~~AfferentGraph sourcefile~system_info_wrapper.f90 system_info_wrapper.F90 sourcefile~fortran_utils.f90 fortran_utils.F90 sourcefile~fortran_utils.f90->sourcefile~system_info_wrapper.f90 sourcefile~core.f90 core.F90 sourcefile~core.f90->sourcefile~fortran_utils.f90 sourcefile~adjacency_element.f90 adjacency_element.F90 sourcefile~adjacency_element.f90->sourcefile~core.f90 sourcefile~element.f90 element.F90 sourcefile~adjacency_element.f90->sourcefile~element.f90 sourcefile~adjacency_node.f90 adjacency_node.F90 sourcefile~adjacency_node.f90->sourcefile~core.f90 sourcefile~boundary_interface.f90 boundary_interface.F90 sourcefile~boundary_interface.f90->sourcefile~core.f90 sourcefile~domain.f90 domain.F90 sourcefile~boundary_interface.f90->sourcefile~domain.f90 sourcefile~input.f90 input.F90 sourcefile~boundary_interface.f90->sourcefile~input.f90 sourcefile~matrix.f90 matrix.F90 sourcefile~boundary_interface.f90->sourcefile~matrix.f90 sourcefile~boundary_manager.f90 boundary_manager.F90 sourcefile~boundary_manager.f90->sourcefile~core.f90 sourcefile~boundary_manager.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_manager.f90->sourcefile~domain.f90 sourcefile~boundary_manager.f90->sourcefile~input.f90 sourcefile~boundary_manager.f90->sourcefile~matrix.f90 sourcefile~density_interface.f90 density_interface.F90 sourcefile~density_interface.f90->sourcefile~core.f90 sourcefile~density_interface.f90->sourcefile~input.f90 sourcefile~domain_manager.f90 domain_manager.F90 sourcefile~domain_manager.f90->sourcefile~core.f90 sourcefile~domain_manager.f90->sourcefile~element.f90 sourcefile~element_factory.f90 element_factory.F90 sourcefile~domain_manager.f90->sourcefile~element_factory.f90 sourcefile~multicoloring.f90 multicoloring.F90 sourcefile~domain_manager.f90->sourcefile~multicoloring.f90 sourcefile~reordering.f90 reordering.F90 sourcefile~domain_manager.f90->sourcefile~reordering.f90 sourcefile~side.f90 side.F90 sourcefile~domain_manager.f90->sourcefile~side.f90 sourcefile~side_factory.f90 side_factory.F90 sourcefile~domain_manager.f90->sourcefile~side_factory.f90 sourcefile~adjacency.f90 adjacency.F90 sourcefile~domain_manager.f90->sourcefile~adjacency.f90 sourcefile~domain_manager.f90->sourcefile~input.f90 sourcefile~element.f90->sourcefile~core.f90 sourcefile~element.f90->sourcefile~input.f90 sourcefile~element_factory.f90->sourcefile~core.f90 sourcefile~element_factory.f90->sourcefile~element.f90 sourcefile~element_factory.f90->sourcefile~input.f90 sourcefile~ftdss.f90 ftdss.F90 sourcefile~ftdss.f90->sourcefile~core.f90 sourcefile~input_interface.f90 input_interface.F90 sourcefile~ftdss.f90->sourcefile~input_interface.f90 sourcefile~thermal_interface.f90 thermal_interface.F90 sourcefile~ftdss.f90->sourcefile~thermal_interface.f90 sourcefile~boundary.f90 boundary.F90 sourcefile~ftdss.f90->sourcefile~boundary.f90 sourcefile~control.f90 control.F90 sourcefile~ftdss.f90->sourcefile~control.f90 sourcefile~ftdss.f90->sourcefile~domain.f90 sourcefile~initial.f90 initial.F90 sourcefile~ftdss.f90->sourcefile~initial.f90 sourcefile~output.f90 output.F90 sourcefile~ftdss.f90->sourcefile~output.f90 sourcefile~properties.f90 properties.F90 sourcefile~ftdss.f90->sourcefile~properties.f90 sourcefile~heat_capacity_interface.f90 heat_capacity_interface.F90 sourcefile~heat_capacity_interface.f90->sourcefile~core.f90 sourcefile~heat_capacity_interface.f90->sourcefile~density_interface.f90 sourcefile~heat_capacity_interface.f90->sourcefile~input_interface.f90 sourcefile~initial_interface.f90 initial_interface.F90 sourcefile~initial_interface.f90->sourcefile~core.f90 sourcefile~initial_interface.f90->sourcefile~boundary.f90 sourcefile~initial_interface.f90->sourcefile~domain.f90 sourcefile~initial_interface.f90->sourcefile~input.f90 sourcefile~initial_manager.f90 initial_manager.F90 sourcefile~initial_manager.f90->sourcefile~core.f90 sourcefile~initial_manager.f90->sourcefile~initial_interface.f90 sourcefile~initial_manager.f90->sourcefile~domain.f90 sourcefile~initial_manager.f90->sourcefile~input.f90 sourcefile~input_interface.f90->sourcefile~core.f90 sourcefile~project_settings.f90 project_settings.F90 sourcefile~input_interface.f90->sourcefile~project_settings.f90 sourcefile~matrix_coo.f90 matrix_coo.F90 sourcefile~matrix_coo.f90->sourcefile~core.f90 sourcefile~matrix_coo.f90->sourcefile~domain.f90 sourcefile~matrix_base.f90 matrix_base.F90 sourcefile~matrix_coo.f90->sourcefile~matrix_base.f90 sourcefile~matrix_crs.f90 matrix_crs.F90 sourcefile~matrix_crs.f90->sourcefile~core.f90 sourcefile~matrix_crs.f90->sourcefile~matrix_coo.f90 sourcefile~matrix_crs.f90->sourcefile~domain.f90 sourcefile~matrix_crs.f90->sourcefile~matrix_base.f90 sourcefile~matrix_dense.f90 matrix_dense.F90 sourcefile~matrix_dense.f90->sourcefile~core.f90 sourcefile~matrix_dense.f90->sourcefile~domain.f90 sourcefile~matrix_dense.f90->sourcefile~matrix_base.f90 sourcefile~multicoloring.f90->sourcefile~core.f90 sourcefile~multicoloring.f90->sourcefile~adjacency_element.f90 sourcefile~output_interface.f90 output_interface.F90 sourcefile~output_interface.f90->sourcefile~core.f90 sourcefile~output_interface.f90->sourcefile~project_settings.f90 sourcefile~output_interface.f90->sourcefile~control.f90 sourcefile~output_interface.f90->sourcefile~domain.f90 sourcefile~output_interface.f90->sourcefile~input.f90 sourcefile~output_interface.f90->sourcefile~matrix.f90 sourcefile~output_interface.f90->sourcefile~properties.f90 sourcefile~project_settings.f90->sourcefile~core.f90 sourcefile~properties_manager.f90 properties_manager.F90 sourcefile~properties_manager.f90->sourcefile~core.f90 sourcefile~calculate.f90 calculate.F90 sourcefile~properties_manager.f90->sourcefile~calculate.f90 sourcefile~properties_manager.f90->sourcefile~input.f90 sourcefile~materials_manager.f90 materials_manager.F90 sourcefile~properties_manager.f90->sourcefile~materials_manager.f90 sourcefile~reordering.f90->sourcefile~core.f90 sourcefile~reordering.f90->sourcefile~adjacency_node.f90 sourcefile~reordering.f90->sourcefile~element.f90 sourcefile~side.f90->sourcefile~core.f90 sourcefile~side.f90->sourcefile~input.f90 sourcefile~side_factory.f90->sourcefile~core.f90 sourcefile~side_factory.f90->sourcefile~side.f90 sourcefile~side_factory.f90->sourcefile~input.f90 sourcefile~specific_heat_interface.f90 specific_heat_interface.F90 sourcefile~specific_heat_interface.f90->sourcefile~core.f90 sourcefile~specific_heat_interface.f90->sourcefile~input.f90 sourcefile~thermal_conductivity_interface.f90 thermal_conductivity_interface.F90 sourcefile~thermal_conductivity_interface.f90->sourcefile~core.f90 sourcefile~thermal_conductivity_interface.f90->sourcefile~input.f90 sourcefile~thermal_interface.f90->sourcefile~core.f90 sourcefile~thermal_interface.f90->sourcefile~boundary.f90 sourcefile~thermal_interface.f90->sourcefile~control.f90 sourcefile~thermal_interface.f90->sourcefile~domain.f90 sourcefile~thermal_interface.f90->sourcefile~input.f90 sourcefile~thermal_interface.f90->sourcefile~matrix.f90 sourcefile~thermal_interface.f90->sourcefile~properties.f90 sourcefile~solver.f90 solver.F90 sourcefile~thermal_interface.f90->sourcefile~solver.f90 sourcefile~time.f90 time.F90 sourcefile~time.f90->sourcefile~core.f90 sourcefile~time.f90->sourcefile~input.f90 sourcefile~adjacency.f90->sourcefile~adjacency_element.f90 sourcefile~adjacency.f90->sourcefile~adjacency_node.f90 sourcefile~boundary.f90->sourcefile~boundary_interface.f90 sourcefile~boundary.f90->sourcefile~boundary_manager.f90 sourcefile~boundary_adiabatic.f90 boundary_adiabatic.F90 sourcefile~boundary_adiabatic.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_base.f90 boundary_base.F90 sourcefile~boundary_base.f90->sourcefile~boundary_interface.f90 sourcefile~boundary_dirichlet.f90 boundary_dirichlet.F90 sourcefile~boundary_dirichlet.f90->sourcefile~boundary_interface.f90 sourcefile~calculate.f90->sourcefile~density_interface.f90 sourcefile~calculate.f90->sourcefile~heat_capacity_interface.f90 sourcefile~calculate.f90->sourcefile~specific_heat_interface.f90 sourcefile~calculate.f90->sourcefile~thermal_conductivity_interface.f90 sourcefile~gcc_interface.f90 gcc_interface.F90 sourcefile~calculate.f90->sourcefile~gcc_interface.f90 sourcefile~control.f90->sourcefile~time.f90 sourcefile~density_3phase.f90 density_3phase.F90 sourcefile~density_3phase.f90->sourcefile~density_interface.f90 sourcefile~density_base.f90 density_base.F90 sourcefile~density_base.f90->sourcefile~density_interface.f90 sourcefile~domain.f90->sourcefile~domain_manager.f90 sourcefile~domain.f90->sourcefile~element.f90 sourcefile~domain.f90->sourcefile~element_factory.f90 sourcefile~domain.f90->sourcefile~multicoloring.f90 sourcefile~domain.f90->sourcefile~reordering.f90 sourcefile~domain.f90->sourcefile~side.f90 sourcefile~domain.f90->sourcefile~side_factory.f90 sourcefile~domain.f90->sourcefile~adjacency.f90 sourcefile~dsatur.f90 dsatur.F90 sourcefile~dsatur.f90->sourcefile~multicoloring.f90 sourcefile~element_square_first.f90 element_square_first.F90 sourcefile~element_square_first.f90->sourcefile~element.f90 sourcefile~element_square_second.f90 element_square_second.F90 sourcefile~element_square_second.f90->sourcefile~element.f90 sourcefile~element_triangle_first.f90 element_triangle_first.F90 sourcefile~element_triangle_first.f90->sourcefile~element.f90 sourcefile~element_triangle_second.f90 element_triangle_second.F90 sourcefile~element_triangle_second.f90->sourcefile~element.f90 sourcefile~heat_capacity_3phase.f90 heat_capacity_3phase.F90 sourcefile~heat_capacity_3phase.f90->sourcefile~heat_capacity_interface.f90 sourcefile~heat_capacity_3phase_apparent.f90 heat_capacity_3phase_apparent.F90 sourcefile~heat_capacity_3phase_apparent.f90->sourcefile~heat_capacity_interface.f90 sourcefile~heat_capacity_base.f90 heat_capacity_base.F90 sourcefile~heat_capacity_base.f90->sourcefile~heat_capacity_interface.f90 sourcefile~initial.f90->sourcefile~initial_interface.f90 sourcefile~initial.f90->sourcefile~initial_manager.f90 sourcefile~initial_laplace.f90 initial_laplace.F90 sourcefile~initial_laplace.f90->sourcefile~initial_interface.f90 sourcefile~initial_uniform.f90 initial_uniform.F90 sourcefile~initial_uniform.f90->sourcefile~initial_interface.f90 sourcefile~input.f90->sourcefile~input_interface.f90 sourcefile~input_basic.f90 input_basic.F90 sourcefile~input_basic.f90->sourcefile~input_interface.f90 sourcefile~input_conditions.f90 input_conditions.F90 sourcefile~input_conditions.f90->sourcefile~input_interface.f90 sourcefile~input_geometry.f90 input_geometry.F90 sourcefile~input_geometry.f90->sourcefile~input_interface.f90 sourcefile~input_output.f90 input_output.F90 sourcefile~input_output.f90->sourcefile~input_interface.f90 sourcefile~lfo.f90 lfo.F90 sourcefile~lfo.f90->sourcefile~multicoloring.f90 sourcefile~matrix.f90->sourcefile~matrix_coo.f90 sourcefile~matrix.f90->sourcefile~matrix_crs.f90 sourcefile~matrix.f90->sourcefile~matrix_dense.f90 sourcefile~matrix.f90->sourcefile~matrix_base.f90 sourcefile~methods.f90 methods.F90 sourcefile~methods.f90->sourcefile~reordering.f90 sourcefile~output.f90->sourcefile~output_interface.f90 sourcefile~output_base.f90 output_base.F90 sourcefile~output_base.f90->sourcefile~output_interface.f90 sourcefile~output_observation.f90 output_observation.F90 sourcefile~output_observation.f90->sourcefile~output_interface.f90 sourcefile~output_overall_base.f90 output_overall_base.F90 sourcefile~output_overall_base.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtk.f90 output_overall_vtk.F90 sourcefile~output_overall_vtk.f90->sourcefile~output_interface.f90 sourcefile~output_overall_vtu.f90 output_overall_vtu.F90 sourcefile~output_overall_vtu.f90->sourcefile~output_interface.f90 sourcefile~output_system_logger.f90 output_system_logger.F90 sourcefile~output_system_logger.f90->sourcefile~output_interface.f90 sourcefile~properties.f90->sourcefile~properties_manager.f90 sourcefile~properties.f90->sourcefile~materials_manager.f90 sourcefile~side_first.f90 side_first.F90 sourcefile~side_first.f90->sourcefile~side.f90 sourcefile~side_second.f90 side_second.F90 sourcefile~side_second.f90->sourcefile~side.f90 sourcefile~specific_heat_3phase.f90 specific_heat_3phase.F90 sourcefile~specific_heat_3phase.f90->sourcefile~specific_heat_interface.f90 sourcefile~specific_heat_base.f90 specific_heat_base.F90 sourcefile~specific_heat_base.f90->sourcefile~specific_heat_interface.f90 sourcefile~thermal.f90 thermal.F90 sourcefile~thermal.f90->sourcefile~thermal_interface.f90 sourcefile~thermal_3phase.f90 thermal_3phase.F90 sourcefile~thermal_3phase.f90->sourcefile~thermal_interface.f90 sourcefile~thermal_conductivity_3phase.f90 thermal_conductivity_3phase.F90 sourcefile~thermal_conductivity_3phase.f90->sourcefile~thermal_conductivity_interface.f90 sourcefile~thermal_conductivity_base.f90 thermal_conductivity_base.F90 sourcefile~thermal_conductivity_base.f90->sourcefile~thermal_conductivity_interface.f90 sourcefile~to_original.f90 to_original.F90 sourcefile~to_original.f90->sourcefile~reordering.f90 sourcefile~to_reordered.f90 to_reordered.F90 sourcefile~to_reordered.f90->sourcefile~reordering.f90 sourcefile~welch_powell.f90 welch_powell.F90 sourcefile~welch_powell.f90->sourcefile~multicoloring.f90 sourcefile~gcc_interface.f90->sourcefile~input.f90 sourcefile~materials_manager.f90->sourcefile~calculate.f90 sourcefile~materials_manager.f90->sourcefile~input.f90 sourcefile~matrix_base.f90->sourcefile~domain.f90 sourcefile~solver_factory.f90 solver_factory.F90 sourcefile~solver_factory.f90->sourcefile~input.f90 sourcefile~solver_factory.f90->sourcefile~matrix.f90 sourcefile~gcc_base.f90 gcc_base.F90 sourcefile~gcc_base.f90->sourcefile~gcc_interface.f90 sourcefile~gcc_non_segregation_m.f90 gcc_non_segregation_m.F90 sourcefile~gcc_non_segregation_m.f90->sourcefile~gcc_interface.f90 sourcefile~gcc_non_segregation_pa.f90 gcc_non_segregation_pa.F90 sourcefile~gcc_non_segregation_pa.f90->sourcefile~gcc_interface.f90 sourcefile~gcc_segregation_m.f90 gcc_segregation_m.F90 sourcefile~gcc_segregation_m.f90->sourcefile~gcc_interface.f90 sourcefile~gcc_segregation_pa.f90 gcc_segregation_pa.F90 sourcefile~gcc_segregation_pa.f90->sourcefile~gcc_interface.f90 sourcefile~solver.f90->sourcefile~solver_factory.f90

Source Code

module core_fortran_utils_system_info_wrapper
    use, intrinsic :: iso_fortran_env, only: int32
    use, intrinsic :: iso_c_binding, only: c_ptr, c_associated
    use :: stdlib_strings, only:to_string
    use :: core_c_utils, only:c_get_os, c_get_cpu_architecture, c_ptr_to_string
    implicit none

    private
    !----------------------------------------------------------------------!
    ! Public Interface:
    !----------------------------------------------------------------------!
    public :: get_username
    public :: get_hostname
    public :: get_compiler_name
    public :: get_compiler_version
    public :: get_os
    public :: get_cpu_architecture
    public :: get_openmp_version
    !----------------------------------------------------------------------!

contains
    !----------------------------------------------------------------------!
    ! get_username:
    !----------------------------------------------------------------------!
    ! This function retrieves the username of the user currently running
    ! the program. It checks a list of commonly used environment variables
    ! that may store the username.
    !
    ! Return Value:
    !   UserName : Allocatable character string containing the username of
    !              the current user. Returns "Unknown" if the username
    !              cannot be determined.
    !
    ! Function Details:
    !   - Attempts to retrieve the username from environment variables:
    !     "USER", "LOGNAME", "LNAME", and "USERNAME".
    !   - Uses the intrinsic `get_environment_variable` procedure to query
    !     each variable in order.
    !   - If a valid value is found, it is trimmed and returned.
    !   - If none of the variables are set, the function returns "Unknown".
    !   - Dynamically allocates and deallocates an array of environment
    !     variable names.
    !
    !----------------------------------------------------------------------!
    function get_username() result(user_name)
        implicit none
        character(:), allocatable :: user_name

        character(64) :: tmp_user_name
        integer(int32) :: len, status
        integer(int32) :: i

        character(:), allocatable :: user_name_lists(:)
        integer(int32), parameter :: user_name_lists_length = 4

        allocate (character(len=16) :: user_name_lists(user_name_lists_length))

        user_name_lists(1) = "USER"
        user_name_lists(2) = "LOGNAME"
        user_name_lists(3) = "LNAME"
        user_name_lists(4) = "USERNAME"

        do i = 1, user_name_lists_length
            call get_environment_variable(user_name_lists(i), &
                                          tmp_user_name, &
                                          len, &
                                          status)
            if (status == 0 .and. len > 0) then
                user_name = trim(adjustl(tmp_user_name))
                deallocate (user_name_lists)
                return
            end if
        end do

        user_name = "Unknown"

        deallocate (user_name_lists)

    end function get_username

    !----------------------------------------------------------------------!
    ! get_hostname:
    !----------------------------------------------------------------------!
    ! This function retrieves the hostname of the system where the program
    ! is currently running. It attempts to obtain the hostname by querying
    ! environment variables commonly used for this purpose.
    !
    ! Return Value:
    !   HostName : Allocatable character string containing the name of the
    !              host computer. Returns "Unknown" if the hostname cannot
    !              be determined.
    !
    ! Function Details:
    !   - Attempts to retrieve the hostname by checking common environment
    !     variables: "HOSTNAME" and "COMPUTERNAME".
    !   - Uses the Fortran intrinsic procedure `get_environment_variable`
    !     to query the environment.
    !   - If a valid hostname is found, it is returned; otherwise, the
    !     function returns "Unknown".
    !   - Dynamically allocates and deallocates an array used to hold
    !     environment variable names.
    !
    !----------------------------------------------------------------------!
    function get_hostname() result(host_name)
        implicit none
        character(:), allocatable :: host_name

        character(64) :: tmp_host_name
        integer(int32) :: len, status
        integer(int32) :: i

        character(:), allocatable :: host_name_lists(:)
        integer(int32), parameter :: host_name_lists_length = 2

        allocate (character(len=16) :: host_name_lists(host_name_lists_length))
        host_name_lists(1) = "HOSTNAME"
        host_name_lists(2) = "COMPUTERNAME"

        do i = 1, host_name_lists_length
            call get_environment_variable(host_name_lists(i), &
                                          tmp_host_name, &
                                          len, &
                                          status)
            if (status == 0 .and. len > 0) then
                host_name = trim(adjustl(tmp_host_name))
                deallocate (host_name_lists)
                return
            end if
        end do

        host_name = "Unknown"

        deallocate (host_name_lists)

    end function get_hostname

    function get_compiler_name() result(compiler_name)
        implicit none
        character(:), allocatable :: compiler_name

#ifdef __GFORTRAN__
        compiler_name = "GNU Fortran Compiler"
#elif defined(__INTEL_COMPILER)
        compiler_name = "Intel Fortran Compiler"
#elif defined(__PGI) || defined(__NVCOMPILER)
        compiler_name = "NVIDIA (PGI) Fortran Compiler"
#else
        compiler_name = "Unknown Compiler"
#endif

    end function get_compiler_name

    function get_compiler_version() result(compiler_version)
        implicit none
        character(:), allocatable :: compiler_version
        integer(int32) :: year, major, minor

#ifdef __GFORTRAN__
#ifdef __GNUC__
        compiler_version = to_string(__GNUC__)//"."//to_string(__GNUC_MINOR__)//"."//to_string(__GNUC_PATCHLEVEL__)
#else
        compiler_version = "Unknown Compiler Version"
#endif
#elif defined(__INTEL_COMPILER)
        year = __INTEL_COMPILER / 10000
        major = mod(__INTEL_COMPILER / 100, 100)
        minor = mod(__INTEL_COMPILER, 100)

        compiler_version = to_string(year)//"."//to_string(major)//"."//to_string(minor)
#elif defined(__PGI) || defined(__NVCOMPILER)
        compiler_version = to_string(__NVCOMPILER_MAJOR__)//"."//to_string(__NVCOMPILER_MINOR__)//"."//to_string(__NVCOMPILER_PATCHLEVEL__)
#else
        compiler_version = "Unknown Compiler Version"
#endif

    end function get_compiler_version

    function get_os() result(os)
        implicit none
        character(:), allocatable :: os
        type(c_ptr) :: ptr

        ! C 側 c_get_os() を呼び出し
        ptr = c_get_os()

        ! NULL ポインタなら "Unknown"、そうでなければ変換関数を使う
        if (c_associated(ptr)) then
            os = c_ptr_to_string(ptr)
        else
            allocate (character(len=10) :: os)
            os = "Unknown OS"
        end if
    end function get_os

    function get_cpu_architecture() result(architecture)
        implicit none
        character(:), allocatable :: architecture
        type(c_ptr) :: ptr

        ! C 側 c_get_cpu_architecture() を呼び出し
        ptr = c_get_cpu_architecture()

        ! NULL ポインタなら "Unknown"、そうでなければ変換関数を使う
        if (c_associated(ptr)) then
            architecture = c_ptr_to_string(ptr)
        else
            allocate (character(len=24) :: architecture)
            architecture = "Unknown CPU Architecture"
        end if
    end function get_cpu_architecture

    function get_openmp_version() result(openmp_version)
        implicit none
        character(:), allocatable :: openmp_version

#ifdef _OPENMP
        select case (_OPENMP)
        case (199911)
            openmp_version = '1.0'
        case (200203)
            openmp_version = '2.0'
        case (200505)
            openmp_version = '2.5'
        case (200805)
            openmp_version = '3.0'
        case (201107)
            openmp_version = '3.1'
        case (201307)
            openmp_version = '4.0'
        case (201511)
            openmp_version = '4.5'
        case (201811)
            openmp_version = '5.0'
        case (202011)
            openmp_version = '5.1'
        case (202111)
            openmp_version = '5.2'
        case default
            openmp_version = 'unknown'
        end select
#else
        openmp_version = 'not defined'
#endif

    end function get_openmp_version

end module core_fortran_utils_system_info_wrapper