xgc / README.md
ayzk's picture
Update dataset card and file table
03a6aba verified
|
Raw History Blame Contribute Delete
5.51 kB
---
license: other
license_name: sdrbench
license_link: https://sdrbench.github.io/
pretty_name: "SDRBench: XGC"
tags:
- scientific-data
- lossy-compression
- sdrbench
- hpc
- sz3
configs:
- config_name: files
data_files: files.jsonl
default: true
---
# SDRBench — XGC
Gyrokinetic fusion plasma simulation (XGC, PPPL): fields on an unstructured mesh of 20694 nodes x 512 toroidal planes, 9 time steps, double precision.
> **Raw binary arrays, not an Arrow/Parquet dataset.** `datasets.load_dataset("sdrbench/xgc")` returns the table of files (`files.jsonl`: path, dtype, shape, sha256). Read the arrays with the `sdrbench` package or `hf_hub_download` + numpy as shown below.
This repository is an **unmodified mirror** of the XGC data of [SDRBench](https://sdrbench.github.io/datasets.html), the
Scientific Data Reduction Benchmark. The originals are hosted by Argonne National Laboratory on Globus;
every archive was unpacked and its files uploaded byte-for-byte (sha256 verified) (revision `f2518596a1`). `metadata/` holds
the original SDRBench property and template files. Kept in sync automatically by
[szcompressor/sdrbench](https://github.com/szcompressor/sdrbench).
- **Data provider:** Princeton Plasma Physics Laboratory (PPPL); https://jychoi-hpc.github.io/adios-python-docs/XGC-mesh-and-field-data.html
- **Size:** 3.1 GB in 2 variant(s)
- **Format:** raw little-endian binary, C order (slowest dimension first); dtype and shape per field below
## Usage
```bash
pip install "sdrbench[sz3]" # sdrbench + pysz (SZ3)
```
```python
import numpy as np
import sdrbench
from pysz import sz, szConfig, szErrorBoundMode
ds = sdrbench.dataset("xgc") # default variant "raw"
print(ds.fields)
x = ds["mesh_coordinates-values"] # numpy array, dtype <f8, shape (20694, 2)
# compress with SZ3 (pysz) at a 1e-3 value-range-relative error bound
conf = szConfig()
conf.errorBoundMode = szErrorBoundMode.REL
conf.relErrorBound = 1e-3
compressed, ratio = sz.compress(np.ascontiguousarray(x), conf)
y, _ = sz.decompress(compressed, x.dtype.type, x.shape)
max_err, psnr, nrmse = sz.verify(np.asarray(x), y)
print(f"ratio {ratio:.1f}x, PSNR {psnr:.1f} dB, max error {max_err:.3g}")
```
Files are fetched on first use (in parallel with `ds.download("data/")`) and cached, pinned to the revision
of the installed `sdrbench` release; if Hugging Face is unreachable the package falls back to the original
archive on Globus. Existing local SDRBench copies can be used with `sdrbench.dataset("xgc", root="/path")`.
Without the package, with `huggingface_hub` and numpy only:
```python
from huggingface_hub import hf_hub_download
import numpy as np
p = hf_hub_download("sdrbench/xgc", "xgc/xgc.mesh.bp_coordinates-values_20694x2_double", repo_type="dataset", revision="f2518596a116a47c2e439417e17f4d9458012ccb")
x = np.fromfile(p, dtype="<f8").reshape((20694, 2))
```
## Variants and fields
### `raw` (default)
`sdrbench.dataset("xgc", "raw")` — folder `xgc/` — 45 files, 1.5 GB, from [xgc.zip](https://g-d0cd3f.fd635.8443.data.globus.org/raw-data/XGC/xgc.zip).
Raw binary arrays extracted from the ADIOS files: per time step dpot, iden (20694 x 512), pot0, potm0 (20694); mesh arrays prefixed mesh_.
13 variable(s) x 9 steps (08100 ... 08900): `ds.series("dpot")`, `ds["dpot", "08100"]`.
| Field | dtype | Shape (C order) | File |
|---|---|---|---|
| `dpot/08100` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08100.bp_dpot_20694x512_double` |
| `iden/08100` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08100.bp_iden_20694x512_double` |
| `pot0/08100` | `<f8` | 20694 | `xgc/xgc.3d.08100.bp_pot0_20694_double` |
| `potm0/08100` | `<f8` | 20694 | `xgc/xgc.3d.08100.bp_potm0_20694_double` |
| `dpot/08200` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08200.bp_dpot_20694x512_double` |
| `iden/08200` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08200.bp_iden_20694x512_double` |
| `pot0/08200` | `<f8` | 20694 | `xgc/xgc.3d.08200.bp_pot0_20694_double` |
| `potm0/08200` | `<f8` | 20694 | `xgc/xgc.3d.08200.bp_potm0_20694_double` |
| `dpot/08300` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08300.bp_dpot_20694x512_double` |
| `iden/08300` | `<f8` | 20694 x 512 | `xgc/xgc.3d.08300.bp_iden_20694x512_double` |
| ... 35 more | | | |
### `adios`
`sdrbench.dataset("xgc", "adios")` — folder `xgc.3d/` — 10 files, 1.5 GB, from [xgc.3d.tar.gz](https://g-d0cd3f.fd635.8443.data.globus.org/raw-data/XGC/xgc.3d.tar.gz).
The original ADIOS BP files (not raw arrays; read them with ADIOS).
Other files: `xgc.3d/xgc.3d.08100.bp`, `xgc.3d/xgc.3d.08200.bp`, `xgc.3d/xgc.3d.08300.bp`, `xgc.3d/xgc.3d.08400.bp`, `xgc.3d/xgc.3d.08500.bp`, `xgc.3d/xgc.3d.08600.bp`, `xgc.3d/xgc.3d.08700.bp`, `xgc.3d/xgc.3d.08800.bp`, `xgc.3d/xgc.3d.08900.bp`, `xgc.3d/xgc.mesh.bp`
## Citation
Please cite SDRBench; `sdrbench cite xgc` prints it:
```bibtex
@inproceedings{zhao2020sdrbench,
title = {{SDRBench}: Scientific Data Reduction Benchmark for Lossy Compressors},
author = {Zhao, Kai and Di, Sheng and Liang, Xin and Li, Sihuan and Tao, Dingwen and Chen, Zizhong and Cappello, Franck},
booktitle = {2020 IEEE International Conference on Big Data (Big Data)},
pages = {2716--2724},
year = {2020}
}
```
## License and terms
The data are distributed by the SDRBench team for research use under the terms of the original
data providers listed above (see the [SDRBench website](https://sdrbench.github.io/datasets.html)); please acknowledge them as
requested. Rights remain with the data providers.