mmap-access-pattern-openmp
Design a fast parallel memory access pattern for a memory-mapped file with mmap().
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
✓DOI references
Found 2 DOI reference(s) in README -
✓Academic publication links
Links to: springer.com, zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.1%) to scientific vocabulary
Repository
Design a fast parallel memory access pattern for a memory-mapped file with mmap().
Basic Info
Statistics
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 1
Metadata Files
README.md
Design a fast parallel memory access pattern for a memory-mapped file with mmap().
Note You can just copy
main.shto your system and run it. \ For the code, refer tomain.cxx.
```bash $ ./main.sh
OMPNUMTHREADS=64
Finding byte sum of file /home/graphwork/Data/indochina-2004.mtx ...
{adv=0, block=4096, mode=0} -> {0000532.8ms, sum=148985827434} byteSum
OMPNUMTHREADS=64
Finding byte sum of file /home/graphwork/Data/uk-2002.mtx ...
{adv=0, block=4096, mode=0} -> {0000880.9ms, sum=244964049087} byteSum
...
```
I tried a simple file bytes sum using mmap() - both sequential and parallel using openmp (64 threads on DGX). I adjust madvise(), mmap(), and per-thread block size to see which access pattern has the best performance. It seems to me using an early madvice(MADV_WILLNEED), a per-thread block size of 256K (dynamic schedule) is good. Below is a plot showing the time taken with this config for each graph.
In parallel doing a file byte sum takes ~100ms on indochina-2004 graph. Note that PIGO takes ~650ms to load the same graphs as CSR. Next i measure the read bandwith of each file, simply by dividing the size of each file by the time taken.
We appear to be reaching a peak bandwidth of ~35GB/s. The KIOXIA KCM6DRUL7T68 7.68TB NVMe SSD installed on DGX has a peack sequential read performance of 62GB/s (we are close). Sequential approach can hit a max of only 6GB/s.
There is a paper called "Efficient Memory Mapped File I/O for In-Memory File Systems" on the topic - where Choi et al. working at Samsung say that mmap() is a good interface for fast IO (in contrast to file streams) and propose async map-ahead based madvise() for low-latency NVM storage devices. The also have a good slides on this - where their (modified) extended madvice obtains ~2.5x better performance than default mmap() by minimizing the number of page faults.
References
- Efficient Memory Mapped File I/O for In-Memory File Systems
- Efficient Memory Mapped File I/O for In-Memory File Systems - Slides
- DI-MMAP—a scalable memory-map runtime for out-of-core data-intensive applications
- Kioxia CD6 7.68TB NVMe PCIe4x4 2.5" U.3 15mm SIE 1DWPD - KCD6XLUL7T68
- Kioxia KCD6XLUL7T68 - 7.68TB SSD NVMe 2.5-inch 15mm CD6-R Series, SIE, PCIe 4.0 6200 MB/sec Read, BiCS FLASH™ TLC, 1 DWPD
- Is mmap + madvise really a form of async I/O?
- Is there really no asynchronous block I/O on Linux?
- Linux mmap() with MAP_POPULATE, man page seems to give wrong info
- When would one use mmap MAP_FIXED?
- Overlapping pages with mmap (MAP_FIXED)
- Zero a large memory mapping with
madvise - convert string to size_t
- mmap(2) — Linux manual page
- madvise(2) — Linux manual page
- msync(2) — Linux manual page
- mincore(2) — Linux manual page
- Reference - cstdlib - atol
- Air gap (networking)
- Stuxnet
Owner
- Name: puzzlef
- Login: puzzlef
- Kind: organization
- Website: https://puzzlef.github.io/
- Repositories: 10
- Profile: https://github.com/puzzlef
A summary of experiments.
Citation (CITATION.cff)
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Sahu
given-names: Subhajit
orcid: https://orcid.org/0000-0001-5140-6578
title: "puzzlef/mmap-access-pattern-openmp: Design a fast parallel memory access pattern for a memory-mapped file with mmap()"
version: 1.2.0
doi: 10.5281/zenodo.10072426
date-released: 2023-11-05
GitHub Events
Total
- Push event: 1
Last Year
- Push event: 1
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 0
- Total pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Total issue authors: 0
- Total pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0


