Code Monkey home page Code Monkey logo

zfp_simple_example's Introduction

Fortran ZFP Example

License: MIT Fortran Build Status

This repository demonstrates how to integrate the Fortran bindings for the ZFP library into a simple example that illustrates compression and decompression of a double-precision 3D array.

Overview

ZFP is an open-source library for compressed floating-point and integer arrays that support high throughput read and write random access. This repository focuses on integrating the Fortran bindings for ZFP into a Fortran project, showcasing its usage through a simple example.

The zfp_example.f90 file contains the main program, which demonstrates the compression and decompression of a 3D array of 64-bit floats using the ZFP library. It would be the equivalent of the simple compressor example. The zfp_fct_wrapper.f90 file provides a Fortran module with functions for interacting with the ZFP library.

Features

  • Integration of Fortran bindings for the ZFP library.
  • Simple example demonstrating compression and decompression of a 3D array of 64-bit floats.
  • Easy-to-understand CMakeLists.txt file for building the example.

Prerequisites

Before building and running the example, ensure you have the following prerequisites installed:

  • Fortran compiler which fully supports F2018 (e.g., GNU Fortran, Intel Fortran)
  • CMake (version 3.16 or higher)

Build the app

  1. Clone this repository:

    git clone https://github.com/ofmla/fortran-zfp-example.git
  2. Build the project using CMake:

    cd fortran-zfp-example
    mkdir build
    cd build
    cmake ..
    cmake --build .
  3. Run the executable with the appropriate command-line argument (-c for compress or -d for decompress). Executing

    ./exe -c

    will create an archive named compressed.zfp.

To decompress the compressed data and save it to decompressed.zfp, run the executable with the -d option:

  ./exe -d

Attempting to decompress data without first compressing it will result in an error, as the compressed.zfp file does not exist. This example is built with double precision (real64) real values, but you can use zfp_fct_wrapper.f90 in a project that uses real32 and explicitly specify the real kind with the preprocessor flag -DREAL_KIND=REAL32, i.e., cmake -DREAL_KIND=REAL32 ...

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or create a pull request.

License

This project is licensed under the MIT License

zfp_simple_example's People

Contributors

ofmla avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.