MPI-SCATCI 2.0
An MPI version of SCATCI
Loading...
Searching...
No Matches
Utility_module Module Reference

Utility module. More...

Functions/Subroutines

integer(longint) function, public compute_total_triangular (n)
 Calculate triangular area.
integer function, public compute_total_box (width, height)
 Calculate rectangular product.
subroutine, public box_index_to_ij (idx, height, i, j)
 Extract indices from rectangular multi-index.
subroutine, public triangular_index_to_ij (idx_f, n, row, column)
 Extract indices from triangular multi-index.
integer function, public string_hash (str, table_size)
 Calculate a string hash.
real(wp) function, public get_real_time ()
 Get current (real) time.
real(wp) function, public get_cpu_time ()
 Get current (CPU) time.
subroutine pack_ints (i1, i2, i3, i4, i5, i6, i7, i8, z)
 Store 8 integers in given number of integers.
subroutine unpack_ints (z, u)
 Retrieve 8 integers from given number of integers.
integer function lexicographical_compare (a, b)
 Compare two arrays.

Detailed Description

Utility module.

Authors
A Al-Refaie
Date
2017
Note
16/01/2019 - Jakub Benda: Unifom coding style and expanded documentation.

Function/Subroutine Documentation

◆ box_index_to_ij()

subroutine, public Utility_module::box_index_to_ij ( integer, intent(in) idx,
integer, intent(in) height,
integer, intent(out) i,
integer, intent(out) j )

Extract indices from rectangular multi-index.

Authors
A Al-Refaie
Date
2017

Definition at line 73 of file Utility_module.f90.

◆ compute_total_box()

integer function, public Utility_module::compute_total_box ( integer, intent(in) width,
integer, intent(in) height )

Calculate rectangular product.

Authors
A Al-Refaie
Date
2017

Calculate width*height.

Definition at line 61 of file Utility_module.f90.

◆ compute_total_triangular()

integer(longint) function, public Utility_module::compute_total_triangular ( integer, intent(in) n)

Calculate triangular area.

Authors
A Al-Refaie
Date
2017

Calculate n*(n+1)/2.

Definition at line 47 of file Utility_module.f90.

◆ get_cpu_time()

real(wp) function, public Utility_module::get_cpu_time

Get current (CPU) time.

Authors
A Al-Refaie
Date
2017

Definition at line 145 of file Utility_module.f90.

◆ get_real_time()

real(wp) function, public Utility_module::get_real_time

Get current (real) time.

Authors
A Al-Refaie
Date
2017

Uses a function from GBTOlib.

Definition at line 133 of file Utility_module.f90.

◆ lexicographical_compare()

integer function Utility_module::lexicographical_compare ( integer(longint), dimension(nidx), intent(in) a,
integer(longint), dimension(nidx), intent(in) b )

Compare two arrays.

Authors
J Benda
Date
2023

Lexicographically compare two integer arrays of equal length NIDX. Return 0 if the arrays are indentical, -1 if the first unequal element is smaller in the first array that in the second array, and +1 otherwise.

Definition at line 290 of file Utility_module.f90.

◆ pack_ints()

subroutine Utility_module::pack_ints ( integer, intent(in) i1,
integer, intent(in) i2,
integer, intent(in) i3,
integer, intent(in) i4,
integer, intent(in) i5,
integer, intent(in) i6,
integer, intent(in) i7,
integer, intent(in) i8,
integer(longint), dimension(:), intent(out) z )

Store 8 integers in given number of integers.

Authors
J Benda
Date
2023

Copy or pack 8 integers to the given packed storage.

Definition at line 159 of file Utility_module.f90.

◆ string_hash()

integer function, public Utility_module::string_hash ( character(len=*), intent(in) str,
integer, intent(in) table_size )

Calculate a string hash.

Authors
A Al-Refaie
Date
2017

This hash assumes at least 29-bit integers. It is supposedly documented in Aho, Sethi, and Ullman, pp. 434-438

Definition at line 110 of file Utility_module.f90.

◆ triangular_index_to_ij()

subroutine, public Utility_module::triangular_index_to_ij ( integer, intent(in) idx_f,
integer, intent(in) n,
integer, intent(out) row,
integer, intent(out) column )

Extract indices from triangular multi-index.

Authors
A Al-Refaie
Date
2017

Definition at line 87 of file Utility_module.f90.

◆ unpack_ints()

subroutine Utility_module::unpack_ints ( integer(longint), dimension(:), intent(in) z,
integer, dimension(8), intent(out) u )

Retrieve 8 integers from given number of integers.

Authors
J Benda
Date
2023

Copy or unpack 8 default integers from the provided packed storage.

Definition at line 229 of file Utility_module.f90.