dtfft_interface_zfp Module

Fortran interface to ZFP compression library


Uses

  • module~~dtfft_interface_zfp~~UsesGraph module~dtfft_interface_zfp dtfft_interface_zfp iso_c_binding iso_c_binding module~dtfft_interface_zfp->iso_c_binding iso_fortran_env iso_fortran_env module~dtfft_interface_zfp->iso_fortran_env

Used by

  • module~~dtfft_interface_zfp~~UsedByGraph module~dtfft_interface_zfp dtfft_interface_zfp module~dtfft_compressor_zfp dtfft_compressor_zfp module~dtfft_compressor_zfp->module~dtfft_interface_zfp program~test_compression test_compression program~test_compression->module~dtfft_compressor_zfp

Variables

Type Visibility Attributes Name Initial
type(zfp_type), public, parameter :: zfp_type_float = zfp_type(3)

Single precision floating point type

type(zfp_type), public, parameter :: zfp_type_double = zfp_type(4)

Double precision floating point type

type(zfp_exec_policy), public, parameter :: zfp_exec_serial = zfp_exec_policy(0)

Serial execution policy

type(zfp_exec_policy), public, parameter :: zfp_exec_omp = zfp_exec_policy(1)

OpenMP parallel execution policy

type(zfp_exec_policy), public, parameter :: zfp_exec_cuda = zfp_exec_policy(2)

CUDA parallel execution policy


Interfaces

interface

  • public function zfp_field_2d(uncompressed_ptr, scalar_type, nx, ny) result(field) bind(c, name="zfp_field_2d")

    Allocate metadata for 2D field f[ny][nx]

    Arguments

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

    pointer to uncompressed scalars (may be NULL)

    type(zfp_type), value :: scalar_type

    scalar type

    integer(kind=c_size_t), value :: nx

    number of scalars in x dimension

    integer(kind=c_size_t), value :: ny

    number of scalars in y dimension

    Return Value type(zfp_field)

    allocated field metadata

interface

  • public function zfp_field_3d(uncompressed_ptr, scalar_type, nx, ny, nz) result(field) bind(c, name="zfp_field_3d")

    Allocate metadata for 3D field f[nz][ny][nx]

    Arguments

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

    pointer to uncompressed scalars (may be NULL)

    type(zfp_type), value :: scalar_type

    scalar type

    integer(kind=c_size_t), value :: nx

    number of scalars in x dimension

    integer(kind=c_size_t), value :: ny

    number of scalars in y dimension

    integer(kind=c_size_t), value :: nz

    number of scalars in z dimension

    Return Value type(zfp_field)

    allocated field metadata

interface

  • public subroutine zfp_field_set_stride_2d(field, sx, sy) bind(c, name="zfp_field_set_stride_2d")

    Set 2D field strides in number of scalars

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

    integer(kind=c_ptrdiff_t), value :: sx

    stride in x dimension: &f[0][1] - &f[0][0]

    integer(kind=c_ptrdiff_t), value :: sy

    stride in y dimension: &f[1][0] - &f[0][0]

interface

  • public subroutine zfp_field_set_stride_3d(field, sx, sy, sz) bind(c, name="zfp_field_set_stride_3d")

    Set 3D field strides in number of scalars

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

    integer(kind=c_ptrdiff_t), value :: sx

    stride in x dimension: &f[0][0][1] - &f[0][0][0]

    integer(kind=c_ptrdiff_t), value :: sy

    stride in y dimension: &f[0][1][0] - &f[0][0][0]

    integer(kind=c_ptrdiff_t), value :: sz

    stride in z dimension: &f[1][0][0] - &f[0][0][0]

interface

  • public function zfp_stream_open(bs) result(stream) bind(c, name="zfp_stream_open")

    Open compressed stream and associate with bit stream

    Arguments

    Type IntentOptional Attributes Name
    type(bitstream), value :: bs

    bit stream to read from and write to (may be NULL)

    Return Value type(zfp_stream)

    allocated compressed stream

interface

  • public subroutine zfp_stream_close(stream) bind(c, name="zfp_stream_close")

    Close and deallocate compressed stream (does not affect bit stream)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

interface

  • public function zfp_stream_maximum_size(stream, field) result(max_size) bind(c, name="zfp_stream_maximum_size")

    Conservative estimate of compressed size in bytes

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    type(zfp_field), value :: field

    array to compress

    Return Value integer(kind=c_size_t)

    maximum number of bytes of compressed storage

interface

  • public subroutine zfp_field_set_pointer(field, arr_ptr) bind(c, name="zfp_field_set_pointer")

    Set pointer to first scalar in field

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

    type(c_ptr), value :: arr_ptr

    pointer to first scalar

interface

  • public function zfp_field_dimensionality(field) result(dims) bind(c, name="zfp_field_dimensionality")

    Field dimensionality (1, 2, 3, or 4)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

    Return Value integer(kind=c_int)

    number of dimensions

interface

  • public function zfp_field_type(field) result(scalar_type) bind(c, name="zfp_field_type")

    Field scalar type

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

    Return Value type(zfp_type)

    scalar type

interface

  • public subroutine zfp_field_free(field) bind(c, name="zfp_field_free")

    Deallocate field metadata

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_field), value :: field

    field metadata

interface

  • public subroutine zfp_stream_rewind(stream) bind(c, name="zfp_stream_rewind")

    Rewind bit stream to beginning for compression or decompression

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed bit stream

interface

  • public function stream_open(buffer, bytes) result(bs) bind(c, name="stream_open")

    Open bit stream for reading and writing

    Arguments

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

    pointer to buffer

    integer(kind=c_size_t), value :: bytes

    buffer size in bytes

    Return Value type(bitstream)

    bit stream

interface

  • public subroutine stream_close(bs) bind(c, name="stream_close")

    Close bit stream

    Arguments

    Type IntentOptional Attributes Name
    type(bitstream), value :: bs

    bit stream

interface

  • public subroutine zfp_stream_set_bit_stream(stream, bs) bind(c, name="zfp_stream_set_bit_stream")

    Associate bit stream with compressed stream

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    type(bitstream), value :: bs

    bit stream to read from and write to

interface

  • public subroutine zfp_stream_set_reversible(stream) bind(c, name="zfp_stream_set_reversible")

    Enable reversible (lossless) compression

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

interface

  • public function zfp_stream_set_rate_interface(stream, rate, scalar_type, dims, align) result(rate_result) bind(c, name="zfp_stream_set_rate")

    Set size in compressed bits/scalar (fixed-rate mode)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    real(kind=c_double), value :: rate

    desired rate in compressed bits/scalar

    type(zfp_type), value :: scalar_type

    scalar type to compress

    integer(kind=c_int), value :: dims

    array dimensionality (1, 2, 3, or 4)

    integer(kind=c_int), value :: align

    word-aligned blocks, e.g., for write random access

    Return Value real(kind=c_double)

    actual rate in compressed bits/scalar

interface

  • public function zfp_stream_set_precision_interface(stream, prec) result(prec_result) bind(c, name="zfp_stream_set_precision")

    Set precision in uncompressed bits/scalar (fixed-precision mode)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    integer(kind=c_int), value :: prec

    desired precision in uncompressed bits/scalar

    Return Value integer(kind=c_int)

    actual precision

interface

  • public function zfp_stream_set_accuracy_interface(stream, acc) result(acc_result) bind(c, name="zfp_stream_set_accuracy")

    Set accuracy as absolute error tolerance (fixed-accuracy mode)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    real(kind=c_double), value :: acc

    desired error tolerance

    Return Value real(kind=c_double)

    actual error tolerance

interface

  • public function zfp_stream_set_execution(stream, execution_policy) result(is_success) bind(c, name="zfp_stream_set_execution")

    Set execution policy

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    type(zfp_exec_policy), value :: execution_policy

    execution policy

    Return Value integer(kind=c_int)

    true upon success

interface

  • public function zfp_decompress(stream, field) result(bitstream_offset_bytes) bind(c, name="zfp_decompress")

    Decompress entire field (nonzero return value upon success)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    type(zfp_field), value :: field

    field metadata

    Return Value integer(kind=c_size_t)

    cumulative number of bytes of compressed storage

interface

  • public function zfp_compress(stream, field) result(bitstream_offset_bytes) bind(c, name="zfp_compress")

    Compress entire field (nonzero return value upon success)

    Arguments

    Type IntentOptional Attributes Name
    type(zfp_stream), value :: stream

    compressed stream

    type(zfp_field), value :: field

    field metadata

    Return Value integer(kind=c_size_t)

    cumulative number of bytes of compressed storage


Derived Types

type, public, bind(C) ::  zfp_field

ZFP field type, representing an uncompressed array

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: val

type, public, bind(C) ::  zfp_stream

ZFP stream type, representing a compressed stream

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: val

type, public, bind(C) ::  bitstream

Bitstream type for compressed data

Components

Type Visibility Attributes Name Initial
type(c_ptr), public :: val

type, public, bind(C) ::  zfp_type

Scalar type enumeration

Components

Type Visibility Attributes Name Initial
integer(kind=c_int), public :: val

type, public, bind(C) ::  zfp_exec_policy

Execution policy enumeration

Components

Type Visibility Attributes Name Initial
integer(kind=c_int), public :: val

Functions

public function zfp_create_field(uncompressed_ptr, scalar_type, dims) result(field)

Create field for 2D or 3D arrays

Arguments

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

pointer to uncompressed scalars

type(zfp_type), intent(in) :: scalar_type

scalar type

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

array dimensions

Return Value type(zfp_field)

field metadata


Subroutines

public subroutine zfp_field_set_stride(field, strides)

Set field strides for 2D or 3D arrays

Arguments

Type IntentOptional Attributes Name
type(zfp_field), intent(in) :: field

field metadata

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

strides per dimension

public subroutine zfp_stream_set_rate(stream, field, rate)

Set compression rate with alignment for complex data

Arguments

Type IntentOptional Attributes Name
type(zfp_stream), intent(in) :: stream

compressed stream

type(zfp_field), intent(in) :: field

field metadata

real(kind=c_double), intent(in) :: rate

desired rate in compressed bits/scalar

public subroutine zfp_stream_set_precision(stream, prec)

Set precision in uncompressed bits/scalar

Arguments

Type IntentOptional Attributes Name
type(zfp_stream), intent(in) :: stream

compressed stream

integer(kind=c_int), intent(in) :: prec

desired precision

public subroutine zfp_stream_set_accuracy(stream, acc)

Set accuracy as absolute error tolerance

Arguments

Type IntentOptional Attributes Name
type(zfp_stream), intent(in) :: stream

compressed stream

real(kind=c_double), intent(in) :: acc

desired error tolerance