https://github.com/p-costa/convert-precision
A code to convert the precision of very large binary files from double/single to single/double in parallel, using MPI I/O
https://github.com/p-costa/convert-precision
conversion fortran high-performance-computing input-output mpi precision
Last synced: 2 months ago
JSON representation
A code to convert the precision of very large binary files from double/single to single/double in parallel, using MPI I/O
- Host: GitHub
- URL: https://github.com/p-costa/convert-precision
- Owner: p-costa
- License: mit
- Created: 2019-06-13T17:55:02.000Z (almost 6 years ago)
- Default Branch: main
- Last Pushed: 2022-10-10T21:13:50.000Z (over 2 years ago)
- Last Synced: 2024-12-30T09:36:34.206Z (4 months ago)
- Topics: conversion, fortran, high-performance-computing, input-output, mpi, precision
- Language: Fortran
- Homepage:
- Size: 32.2 KB
- Stars: 6
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
### Convert Precision
This Fortran program converts large binary files in parallel from/to single to/from double precision, using MPI-I/O. The code assumes that the each file contains *only* single- or double-precision floating-point numbers.
### Usage
1. build the Fortran program:
```bash
mpif90 -O3 -D_SINGLE_TO_DOUBLE convert_precision.F90 -o single2double # executable for single-to-double conversion
mpif90 -O3 -D_DOUBLE_TO_SINGLE convert_precision.F90 -o double2single # executable for double-to-single conversion
```
n.b.: by default, the compiled executable from `mpif90 convert_precision.F90` will convert from double to single precision.2. list the files to be converted in a file `files.in`. For instance:
```bash
ls a.bin b.bin c.bin > files.in
```3. run the code, e.g.:
```bash
NUM_TASKS=16
mpirun -n $NUM_TASKS ./double2single
```4. done! the converted files are generated with the same name as the original file, with the extension `.converted` appended, i.e., for the example above:
```bash
$ ls *.converted
a.bin.converted b.bin.converted c.bin.converted
```