dtfft_utils Module

All Utilities functions are located here


Uses

  • module~~dtfft_utils~~UsesGraph module~dtfft_utils dtfft_utils iso_c_binding iso_c_binding module~dtfft_utils->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_utils->iso_fortran_env module~dtfft_parameters dtfft_parameters module~dtfft_utils->module~dtfft_parameters mpi_f08 mpi_f08 module~dtfft_utils->mpi_f08 module~dtfft_parameters->iso_c_binding module~dtfft_parameters->iso_fortran_env module~dtfft_parameters->mpi_f08

Used by

  • module~~dtfft_utils~~UsedByGraph module~dtfft_utils dtfft_utils module~dtfft_abstract_backend dtfft_abstract_backend module~dtfft_abstract_backend->module~dtfft_utils module~dtfft_interface_cuda_runtime dtfft_interface_cuda_runtime module~dtfft_abstract_backend->module~dtfft_interface_cuda_runtime module~dtfft_interface_nccl dtfft_interface_nccl module~dtfft_abstract_backend->module~dtfft_interface_nccl module~dtfft_nvrtc_kernel dtfft_nvrtc_kernel module~dtfft_abstract_backend->module~dtfft_nvrtc_kernel module~dtfft_pencil dtfft_pencil module~dtfft_abstract_backend->module~dtfft_pencil module~dtfft_abstract_executor dtfft_abstract_executor module~dtfft_abstract_executor->module~dtfft_utils module~dtfft_interface_nvtx dtfft_interface_nvtx module~dtfft_abstract_executor->module~dtfft_interface_nvtx module~dtfft_abstract_executor->module~dtfft_pencil module~dtfft_abstract_transpose_plan dtfft_abstract_transpose_plan module~dtfft_abstract_transpose_plan->module~dtfft_utils module~dtfft_abstract_transpose_plan->module~dtfft_abstract_backend module~dtfft_config dtfft_config module~dtfft_abstract_transpose_plan->module~dtfft_config module~dtfft_abstract_transpose_plan->module~dtfft_interface_cuda_runtime module~dtfft_abstract_transpose_plan->module~dtfft_interface_nccl module~dtfft_interface_nvshmem dtfft_interface_nvshmem module~dtfft_abstract_transpose_plan->module~dtfft_interface_nvshmem module~dtfft_abstract_transpose_plan->module~dtfft_interface_nvtx module~dtfft_abstract_transpose_plan->module~dtfft_nvrtc_kernel module~dtfft_abstract_transpose_plan->module~dtfft_pencil module~dtfft_api dtfft_api module~dtfft_api->module~dtfft_utils module~dtfft_api->module~dtfft_config module~dtfft_api->module~dtfft_pencil module~dtfft_plan dtfft_plan module~dtfft_api->module~dtfft_plan module~dtfft_backend_cufftmp_m dtfft_backend_cufftmp_m module~dtfft_backend_cufftmp_m->module~dtfft_utils module~dtfft_backend_cufftmp_m->module~dtfft_abstract_backend module~dtfft_backend_cufftmp_m->module~dtfft_interface_cuda_runtime module~dtfft_interface_cufft dtfft_interface_cufft module~dtfft_backend_cufftmp_m->module~dtfft_interface_cufft module~dtfft_backend_cufftmp_m->module~dtfft_interface_nvshmem module~dtfft_backend_cufftmp_m->module~dtfft_pencil module~dtfft_backend_mpi dtfft_backend_mpi module~dtfft_backend_mpi->module~dtfft_utils module~dtfft_backend_mpi->module~dtfft_abstract_backend module~dtfft_backend_mpi->module~dtfft_interface_cuda_runtime module~dtfft_backend_nccl_m dtfft_backend_nccl_m module~dtfft_backend_nccl_m->module~dtfft_utils module~dtfft_backend_nccl_m->module~dtfft_abstract_backend module~dtfft_backend_nccl_m->module~dtfft_interface_cuda_runtime module~dtfft_backend_nccl_m->module~dtfft_interface_nccl module~dtfft_config->module~dtfft_utils module~dtfft_config->module~dtfft_interface_cuda_runtime module~dtfft_executor_cufft_m dtfft_executor_cufft_m module~dtfft_executor_cufft_m->module~dtfft_utils module~dtfft_executor_cufft_m->module~dtfft_abstract_executor module~dtfft_executor_cufft_m->module~dtfft_config module~dtfft_executor_cufft_m->module~dtfft_interface_cuda_runtime module~dtfft_executor_cufft_m->module~dtfft_interface_cufft module~dtfft_executor_fftw_m dtfft_executor_fftw_m module~dtfft_executor_fftw_m->module~dtfft_utils module~dtfft_executor_fftw_m->module~dtfft_abstract_executor module~dtfft_executor_fftw_m->module~dtfft_pencil module~dtfft_executor_mkl_m dtfft_executor_mkl_m module~dtfft_executor_mkl_m->module~dtfft_utils module~dtfft_executor_mkl_m->module~dtfft_abstract_executor module~dtfft_interface_mkl_m dtfft_interface_mkl_m module~dtfft_executor_mkl_m->module~dtfft_interface_mkl_m module~dtfft_interface_cuda dtfft_interface_cuda module~dtfft_interface_cuda->module~dtfft_utils module~dtfft_interface_cuda->module~dtfft_interface_cuda_runtime module~dtfft_interface_cuda_runtime->module~dtfft_utils module~dtfft_interface_cufft->module~dtfft_utils module~dtfft_interface_mkl_m->module~dtfft_utils module~dtfft_interface_nccl->module~dtfft_utils module~dtfft_interface_nvrtc dtfft_interface_nvrtc module~dtfft_interface_nvrtc->module~dtfft_utils module~dtfft_interface_nvrtc->module~dtfft_interface_cuda_runtime module~dtfft_interface_nvshmem->module~dtfft_utils module~dtfft_interface_nvtx->module~dtfft_utils module~dtfft_interface_vkfft_m dtfft_interface_vkfft_m module~dtfft_interface_vkfft_m->module~dtfft_utils module~dtfft_nvrtc_kernel->module~dtfft_utils module~dtfft_nvrtc_kernel->module~dtfft_interface_cuda module~dtfft_nvrtc_kernel->module~dtfft_interface_cuda_runtime module~dtfft_nvrtc_kernel->module~dtfft_interface_nvrtc module~dtfft_nvrtc_kernel->module~dtfft_interface_nvtx module~dtfft_pencil->module~dtfft_utils module~dtfft_pencil->module~dtfft_interface_cuda_runtime module~dtfft_plan->module~dtfft_utils module~dtfft_plan->module~dtfft_abstract_executor module~dtfft_plan->module~dtfft_abstract_transpose_plan module~dtfft_plan->module~dtfft_config module~dtfft_plan->module~dtfft_executor_cufft_m module~dtfft_plan->module~dtfft_executor_fftw_m module~dtfft_plan->module~dtfft_executor_mkl_m module~dtfft_plan->module~dtfft_interface_cuda_runtime module~dtfft_plan->module~dtfft_interface_nvshmem module~dtfft_plan->module~dtfft_interface_nvtx module~dtfft_plan->module~dtfft_nvrtc_kernel module~dtfft_plan->module~dtfft_pencil module~dtfft_transpose_plan_cuda dtfft_transpose_plan_cuda module~dtfft_plan->module~dtfft_transpose_plan_cuda module~dtfft_transpose_plan_host dtfft_transpose_plan_host module~dtfft_plan->module~dtfft_transpose_plan_host module~dtfft_executor_vkfft_m dtfft_executor_vkfft_m module~dtfft_plan->module~dtfft_executor_vkfft_m module~dtfft_transpose_handle_cuda dtfft_transpose_handle_cuda module~dtfft_transpose_handle_cuda->module~dtfft_utils module~dtfft_transpose_handle_cuda->module~dtfft_abstract_backend module~dtfft_transpose_handle_cuda->module~dtfft_backend_cufftmp_m module~dtfft_transpose_handle_cuda->module~dtfft_backend_mpi module~dtfft_transpose_handle_cuda->module~dtfft_backend_nccl_m module~dtfft_transpose_handle_cuda->module~dtfft_interface_cuda_runtime module~dtfft_transpose_handle_cuda->module~dtfft_interface_nvtx module~dtfft_transpose_handle_cuda->module~dtfft_nvrtc_kernel module~dtfft_transpose_handle_cuda->module~dtfft_pencil module~dtfft_transpose_plan_cuda->module~dtfft_utils module~dtfft_transpose_plan_cuda->module~dtfft_abstract_backend module~dtfft_transpose_plan_cuda->module~dtfft_abstract_transpose_plan module~dtfft_transpose_plan_cuda->module~dtfft_config module~dtfft_transpose_plan_cuda->module~dtfft_interface_cuda module~dtfft_transpose_plan_cuda->module~dtfft_interface_cuda_runtime module~dtfft_transpose_plan_cuda->module~dtfft_interface_nvrtc module~dtfft_transpose_plan_cuda->module~dtfft_interface_nvtx module~dtfft_transpose_plan_cuda->module~dtfft_nvrtc_kernel module~dtfft_transpose_plan_cuda->module~dtfft_pencil module~dtfft_transpose_plan_cuda->module~dtfft_transpose_handle_cuda module~dtfft_transpose_plan_host->module~dtfft_utils module~dtfft_transpose_plan_host->module~dtfft_abstract_transpose_plan module~dtfft_transpose_plan_host->module~dtfft_interface_nvtx module~dtfft_transpose_plan_host->module~dtfft_pencil module~dtfft_transpose_handle_host dtfft_transpose_handle_host module~dtfft_transpose_plan_host->module~dtfft_transpose_handle_host module~dtfft dtfft module~dtfft->module~dtfft_config module~dtfft->module~dtfft_pencil module~dtfft->module~dtfft_plan module~dtfft_executor_vkfft_m->module~dtfft_abstract_executor module~dtfft_executor_vkfft_m->module~dtfft_config module~dtfft_executor_vkfft_m->module~dtfft_interface_vkfft_m module~dtfft_transpose_handle_host->module~dtfft_interface_nvtx module~dtfft_transpose_handle_host->module~dtfft_pencil

Variables

Type Visibility Attributes Name Initial
logical, private, save :: is_init_called = .false.

Has init_internal already been called or not

logical, private, save :: is_log_enabled

Should we log messages to stdout or not

type(dtfft_platform_t), private, save :: platform_from_env = PLATFORM_NOT_SET

Platform obtained from environ

integer(kind=int32), private, save :: z_slab_from_env

Should Z-slab be used if possible

type(dtfft_backend_t), private, save :: backend_from_env

Backend obtained from environ

integer(kind=int32), private, save :: mpi_enabled_from_env

Should we use MPI backends during autotune or not

integer(kind=int32), private, save :: nccl_enabled_from_env

Should we use NCCL backends during autotune or not

integer(kind=int32), private, save :: nvshmem_enabled_from_env

Should we use NVSHMEM backends during autotune or not

integer(kind=int32), private, save :: pipe_enabled_from_env

Should we use pipelined backends during autotune or not

character(len=26), private, parameter :: UPPER_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

Upper case alphabet.

character(len=26), private, parameter :: LOWER_ALPHABET = 'abcdefghijklmnopqrstuvwxyz'

Lower case alphabet.

integer(kind=c_int), private, parameter :: RTLD_LAZY = 1_c_int

Each external function reference is bound the first time the function is called.

integer(kind=c_int), private, parameter :: RTLD_NOW = 2_c_int

All external function references are bound when the library is loaded.


Interfaces

public interface int_to_str

Converts integer to string

  • private function int_to_str_int8(n) result(string)

    Convert 8-bit integer to string

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int8), intent(in) :: n

    Integer to convert

    Return Value character(len=:), allocatable

    Resulting string

  • private function int_to_str_int32(n) result(string)

    Convert 32-bit integer to string

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int32), intent(in) :: n

    Integer to convert

    Return Value character(len=:), allocatable

    Resulting string

  • private function int_to_str_int64(n) result(string)

    Convert 64-bit integer to string

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=int64), intent(in) :: n

    Integer to convert

    Return Value character(len=:), allocatable

    Resulting string

public interface get_env

Obtains environment variable

  • private function get_env_base(name) result(env)

    Base function of obtaining dtFFT environment variable

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    Name of environment variable without prefix

    Return Value character(len=:), allocatable

    Environment variable value

  • private function get_env_string(name, default, valid_values) result(env)

    Obtains string environment variable

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    Name of environment variable without prefix

    character(len=*), intent(in) :: default

    Name of environment variable without prefix

    type(string), intent(in) :: valid_values(:)

    List of valid variable values

    Return Value character(len=:), allocatable

    Environment variable value

  • private function get_env_int32(name, default, valid_values, min_valid_value) result(env)

    Base Integer function of obtaining dtFFT environment variable

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    Name of environment variable without prefix

    integer(kind=int32), intent(in) :: default

    Default value in case env is not set or it has wrong value

    integer(kind=int32), intent(in), optional :: valid_values(:)

    List of valid values

    integer(kind=int32), intent(in), optional :: min_valid_value

    Mininum valid value. Usually 0 or 1

    Return Value integer(kind=int32)

  • private function get_env_int8(name, default, valid_values) result(env)

    Obtains int8 environment variable

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    Name of environment variable without prefix

    integer(kind=int8), intent(in) :: default

    Default value in case env is not set or it has wrong value

    integer(kind=int32), intent(in) :: valid_values(:)

    List of valid values

    Return Value integer(kind=int8)

  • private function get_env_logical(name, default) result(env)

    Obtains logical environment variable

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: name

    Name of environment variable without prefix

    logical, intent(in) :: default

    Default value in case env is not set or it has wrong value

    Return Value logical

public interface string

Creates string object

  • private function string_constructor(str)

    Creates string object

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: str

    String

    Return Value type(string)

interface

Allocates memory using C11 Standard alloc_align with 16 bytes alignment

  • public subroutine mem_alloc_host(alloc_size, ptr) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_size_t), value :: alloc_size

    Number of bytes to allocate

    type(c_ptr) :: ptr

    Pointer to allocate

interface

Frees memory allocated with mem_alloc_host

  • public subroutine mem_free_host(ptr) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: ptr

    Pointer to free

interface

Converts Fortran communicator to C

  • public function Comm_f2c(fcomm) bind(C, name="Comm_f2c")

    Arguments

    Type IntentOptional Attributes Name
    integer(kind=c_int), value :: fcomm

    Fortran communicator

    Return Value type(c_ptr)

interface

Checks if pointer can be accessed from device

  • public function is_device_ptr(ptr) result(bool) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: ptr

    Device pointer

    Return Value logical(kind=c_bool)

    Result

private interface is_null_ptr

Checks if pointer is NULL

  • private interface is_null_ptr()

    Checks if pointer is NULL

    Arguments

    None
  • private elemental function is_null_funptr(ptr)

    Checks if pointer is NULL

    Arguments

    Type IntentOptional Attributes Name
    type(c_funptr), intent(in) :: ptr

    Pointer to check

    Return Value logical

interface

Load and link a dynamic library or bundle

  • private function dlopen(filename, mode) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    character(len=c_char) :: filename(*)

    Name of the library

    integer(kind=c_int), value :: mode

    Options to dlopen

    Return Value type(c_ptr)

    Handle to the library

interface

Get address of a symbol

  • private function dlsym(handle, name) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: handle

    Handle to the library

    character(len=c_char) :: name(*)

    Name of the symbol

    Return Value type(c_funptr)

    Address of the symbol

interface

Close a dynamic library or bundle

  • private function dlclose(handle) bind(C)

    Arguments

    Type IntentOptional Attributes Name
    type(c_ptr), value :: handle

    Handle to the library

    Return Value integer(kind=c_int)

    Result of the operation

interface

Get diagnostic information

  • private function dlerror() bind(C)

    Arguments

    None

    Return Value type(c_ptr)

    Error message


Derived Types

type, public ::  string

Class used to create array of strings

Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: raw

String

Constructor

Creates string object

private function string_constructor (str)

Creates string object


Functions

public function init_internal()

Checks if MPI is initialized and loads environment variables

Arguments

None

Return Value integer(kind=int32)

public pure function get_platform_from_env()

Returns execution platform set by environment variable

Arguments

None

Return Value type(dtfft_platform_t)

public pure function get_z_slab_from_env()

Returns Z-slab to be used set by environment variable

Arguments

None

Return Value integer(kind=int32)

public pure function get_backend_from_env()

Returns GPU backend to use set by environment variable

Arguments

None

Return Value type(dtfft_backend_t)

public pure function get_mpi_enabled_from_env()

Returns usage of MPI Backends during autotune set by environment variable

Arguments

None

Return Value integer(kind=int32)

public pure function get_nccl_enabled_from_env()

Returns usage of NCCL Backends during autotune set by environment variable

Arguments

None

Return Value integer(kind=int32)

public pure function get_nvshmem_enabled_from_env()

Returns usage of NVSHMEM Backends during autotune set by environment variable

Arguments

None

Return Value integer(kind=int32)

public pure function get_pipe_enabled_from_env()

Returns usage of Pipelined Backends during autotune set by environment variable

Arguments

None

Return Value integer(kind=int32)

public function get_iters_from_env(is_warmup) result(n_iters)

Obtains number of iterations from environment variable

Arguments

Type IntentOptional Attributes Name
logical, intent(in) :: is_warmup

Warmup variable flag

Return Value integer(kind=int32)

public function get_datatype_from_env(name) result(env)

Obtains datatype id from environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

Return Value integer(kind=int8)

public pure function get_log_enabled() result(log)

Returns the value of the log_enabled variable

Arguments

None

Return Value logical

Value of the log_enabled variable

public function load_library(name) result(lib_handle)

Dynamically loads library

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of library to load

Return Value type(c_ptr)

Loaded handle

public function load_symbol(handle, name) result(symbol_handle)

Dynamically loads symbol from library

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: handle

Loaded handle

character(len=*), intent(in) :: name

Name of function to load

Return Value type(c_funptr)

Function pointer

public function dynamic_load(name, symbol_names, handle, symbols) result(error_code)

Dynamically loads library and its symbols

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of library to load

type(string), intent(in) :: symbol_names(:)

Names of functions to load

type(c_ptr), intent(out) :: handle

Loaded handle

type(c_funptr), intent(out) :: symbols(:)

Function pointers

Return Value integer(kind=int32)

Error code

public function double_to_str(n) result(string)

Convert double to string

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: n

Double to convert

Return Value character(len=:), allocatable

Resulting string

public elemental function get_inverse_kind(r2r_kind) result(result_kind)

Get the inverse R2R kind of transform for the given R2R kind

Arguments

Type IntentOptional Attributes Name
type(dtfft_r2r_kind_t), intent(in) :: r2r_kind

R2R kind

Return Value type(dtfft_r2r_kind_t)

public elemental function is_null_ptr(ptr)

Checks if pointer is NULL

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: ptr

Pointer to check

Return Value logical

public elemental function is_same_ptr(ptr1, ptr2)

Checks if two pointer are the same

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: ptr1

First pointer

type(c_ptr), intent(in) :: ptr2

Second pointer

Return Value logical

public function count_unique(x) result(n)

Count the number of unique elements in the array

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: x(:)

Array of integers

Return Value integer(kind=int32)

private function string_constructor(str)

Creates string object

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

String

Return Value type(string)

private function get_env_base(name) result(env)

Base function of obtaining dtFFT environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

Return Value character(len=:), allocatable

Environment variable value

private function get_env_string(name, default, valid_values) result(env)

Obtains string environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

character(len=*), intent(in) :: default

Name of environment variable without prefix

type(string), intent(in) :: valid_values(:)

List of valid variable values

Return Value character(len=:), allocatable

Environment variable value

private function get_env_int32(name, default, valid_values, min_valid_value) result(env)

Base Integer function of obtaining dtFFT environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

integer(kind=int32), intent(in) :: default

Default value in case env is not set or it has wrong value

integer(kind=int32), intent(in), optional :: valid_values(:)

List of valid values

integer(kind=int32), intent(in), optional :: min_valid_value

Mininum valid value. Usually 0 or 1

Return Value integer(kind=int32)

private function get_env_int8(name, default, valid_values) result(env)

Obtains int8 environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

integer(kind=int8), intent(in) :: default

Default value in case env is not set or it has wrong value

integer(kind=int32), intent(in) :: valid_values(:)

List of valid values

Return Value integer(kind=int8)

private function get_env_logical(name, default) result(env)

Obtains logical environment variable

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Name of environment variable without prefix

logical, intent(in) :: default

Default value in case env is not set or it has wrong value

Return Value logical

private function int_to_str_int8(n) result(string)

Convert 8-bit integer to string

Arguments

Type IntentOptional Attributes Name
integer(kind=int8), intent(in) :: n

Integer to convert

Return Value character(len=:), allocatable

Resulting string

private function int_to_str_int32(n) result(string)

Convert 32-bit integer to string

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: n

Integer to convert

Return Value character(len=:), allocatable

Resulting string

private function int_to_str_int64(n) result(string)

Convert 64-bit integer to string

Arguments

Type IntentOptional Attributes Name
integer(kind=int64), intent(in) :: n

Integer to convert

Return Value character(len=:), allocatable

Resulting string

private elemental function is_null_funptr(ptr)

Checks if pointer is NULL

Arguments

Type IntentOptional Attributes Name
type(c_funptr), intent(in) :: ptr

Pointer to check

Return Value logical


Subroutines

public subroutine destroy_strings(strings)

Destroys array of string objects

Arguments

Type IntentOptional Attributes Name
type(string), intent(inout), allocatable :: strings(:)

Array of strings

public subroutine string_f2c(fstring, cstring, string_size)

Convert Fortran string to C string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fstring

Fortran string

character(kind=c_char, len=1), intent(inout) :: cstring(*)

C string

integer(kind=int64), intent(out), optional :: string_size

Size of the C string

public subroutine string_c2f(cstring, string)

Convert C string to Fortran string

Arguments

Type IntentOptional Attributes Name
type(c_ptr) :: cstring

C string

character(len=:), allocatable :: string

Fortran string

public subroutine astring_f2c(fstring, cstring, string_size)

Convert Fortran string to C allocatable string

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: fstring

Fortran string

character(kind=c_char, len=1), intent(out), allocatable :: cstring(:)

C string

integer(kind=int64), intent(out), optional :: string_size

Size of the C string

public subroutine unload_library(handle)

Unloads library

Arguments

Type IntentOptional Attributes Name
type(c_ptr), intent(in) :: handle

Loaded handle

public subroutine write_message(unit, message, prefix)

Write message to the specified unit

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: unit

Unit number

character(len=*), intent(in) :: message

Message to write

character(len=*), intent(in), optional :: prefix

Prefix to the message

private subroutine dl_error(message)

Writes error message to the error unit

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: message

Message to write