A utility that simplifies the download and generation of Matrix Market (`.mtx`) files.
Project description
MtxMan ๐ข
This is a utility that simplifies the download and generation of Matrix Market (.mtx) files.
- Files are downloaded from
SuiteSparse(https://sparse.tamu.edu/) - Supported generators:
Requirements
gcc: to build dependencies:distributed_mmioto convert matrices to BMTX format.Graph500andPaRMATgenerators.
python3/pip/pipxto download and setup MtxMan.
Setup
First, setup you Python environment (if needed).
Virtual Environment Setup
# If you don't already have one, create and activate a venv
python3 -m venv .venv
source .venv/bin/activate
pip install pipx
pipx ensurepath
You may need to restart your terminal for the changes to take effect.
MtxMan Installation
Once pipx is installed, you can install MtxMan from PyPI:
# Install MtxMan CLI
pipx install mtxman
Great, you now have MtxMan installed! You can check out the available commands by running:
mtxman --help
Developer Installation
# Clone the repository
git clone git@github.com:ThomasPasquali/MtxMan.git
cd MtxMan
# Install the project in editable mode
pip install -e .
Now the mtxman command should use the local version of the package.
Any changes you make to the code will be reflected immediately when you run the command.
Usage: matrices download/generation
Once you have the MtxMan available on your system.
- Create your own YAML configuration file (check out the example below for the syntax)
- Run the following command:
mtxman sync <your_config_file>.yaml
By default this command will download/generate all the configured matrices.
For more details, run mtxman sync --help.
Example Configuration File
# This is the base folder for storing the Matrix Market files
path: ./datasets
# This is an example subfolder/category of matrices
matrices_category_1:
# Generators configuration
generators:
# Graph500 Kronecker
graph500:
# This will generate two graphs:
# 1) Scale 4, Edge-factor 5
# 2) Scale 6, Edge-factor 10
scale:
- 4
- 6
edge_factor:
- 5
- 10
# PaRMAT generator
parmat:
# Parameters:
# N - Number of veritces
# M - Number of edges
# a,b,c - RMAT probabilities. "d" will be deduced automatically. (defaulf: a,b,c=0.25)
# noDuplicateEdges, undirected, noEdgeToSelf, sorted - Flags. To enable a flag, please set it to 1. (default: 0)
defaults: # This is optional
N: 32
a: 0.25
b: 0.25
c: 0.25
undirected: 1
noDuplicateEdges: 1
matrices: # Specify the list of matrices. Default parametes can be overwritten
- { M: 64 }
- { M: 128 }
- { N: 64, M: 64, a: 0.7, b: 0.1, c: 0.1, noEdgeToSelf: 1 } # Overriding defaults
# List of matrices to be downloaded from SuiteSparse
# Format: "<group>/<matrix_name>"
suite_sparse_matrix_list:
- HB/ash219
- HB/arc130
- Averous/epb0
# This allows to download matrices based on their metadata
# Internally, these options will be passed to the `ssgetpy` package
suite_sparse_matrix_range:
min_nnzs: 100
max_nnzs: 1000
limit: 4
# This is ANOTHER example subfolder/category of matrices
# The configuration structure is as above
# Keys 'generators', 'suite_sparse_matrix_list' and 'suite_sparse_matrix_range' are OPTIONAL
matrices_category_2:
suite_sparse_matrix_list:
- Simon/olafu
matrices_category_3:
generators:
graph500:
# This will generate three graphs:
# 1) Scale 6, Edge-factor 5
# 2) Scale 8, Edge-factor 5
# 3) Scale 9, Edge-factor 5
edge_factor: 5
scale:
- 6
- 8
- 9
Files Structure
The downloaded/generated files are structured as follows:
<config.path>
โโโ <category_0>
โ โโโ <SuiteSparse_group_0> # Matrices from SuiteSparse "list"
โ โ โโโ <matrix_0>
โ โ โโโ <matrix_0>.mtx
โ โโโ <SuiteSparse_group_1>
โ โ โโโ <matrix_0>
โ โ โ โโโ <matrix_0>.mtx
โ โ โโโ <matrix_1>
โ โ โโโ <matrix_1>.mtx
| ...
| |
| โโโ Graph500
โ โ โโโ graph500_<scale_0>_<edge_factor0>
โ โ โโโ graph500_<scale_1>_<edge_factor1>
โ โ ...
| |
| โโโ PaRMAT
โ โ โโโ parmat_N<N_0>_M<M_0>_<other parmat parameters 0>
โ โ โโโ parmat_N<N_1>_M<M_1>_<other parmat parameters 1>
โ โ ...
| |
โ โโโ SuiteSparse_<min_nnz>_<max_nnz>_<limit> # Matrices from SuiteSparse "range"
| โ โโโ <SuiteSparse_group_0> # Matrices from SuiteSparse "list"
| โ โ โโโ <matrix_0>
| โ โ โโโ <matrix_0>.mtx
| | ...
| โโโ matrices_list.txt # Summary file, contains all matrices paths for <category_0>
โโโ <category_1>
โ |
| ... # Same structure
...
โโโ matrices_list.txt # Summary file, contains all matrices paths
โโโ matrices_metadata.csv # Summary file, contains all matrices metadata (number of rows, columns, non-zeros etc.)
Optimize Required Disk Space and Read Time
To optimize space requirements, run the sync command as follows:
mtxman sync <your_config_file>.yaml --binary-mtx
This will convert .mtx files to .bmtx saving 50 to 80% disk space.
The reading of .bmtx files is handled by https://github.com/HicrestLaboratory/distributed_mmio. Check it out!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mtxman-0.0.5.tar.gz.
File metadata
- Download URL: mtxman-0.0.5.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ebed3a40c982457191b909cd5f9a47314baca311175aeb78fad035da15521f0
|
|
| MD5 |
e34929e49659de3b9b6d971f1462723a
|
|
| BLAKE2b-256 |
a6aebc256f3fb4e0deb5fbc0ff27e64bac5f4a7a6c32ea96fa9c3edabf55b2a7
|
Provenance
The following attestation bundles were made for mtxman-0.0.5.tar.gz:
Publisher:
pypi-publish.yml on ThomasPasquali/MtxMan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtxman-0.0.5.tar.gz -
Subject digest:
9ebed3a40c982457191b909cd5f9a47314baca311175aeb78fad035da15521f0 - Sigstore transparency entry: 336219958
- Sigstore integration time:
-
Permalink:
ThomasPasquali/MtxMan@2be912a7d8c0c323725498fcd530d7ec15e27ab0 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/ThomasPasquali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2be912a7d8c0c323725498fcd530d7ec15e27ab0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mtxman-0.0.5-py3-none-any.whl.
File metadata
- Download URL: mtxman-0.0.5-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc1166d4862a75a2b326dec6e95495f74fcfa225bd168cbb28450ed981bcb693
|
|
| MD5 |
e646844955b16716222392cd8bdd4e7e
|
|
| BLAKE2b-256 |
399b89073f9c870a995a1d688a48e3019ac0dbae6f5886a27b190c248a295dbb
|
Provenance
The following attestation bundles were made for mtxman-0.0.5-py3-none-any.whl:
Publisher:
pypi-publish.yml on ThomasPasquali/MtxMan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mtxman-0.0.5-py3-none-any.whl -
Subject digest:
dc1166d4862a75a2b326dec6e95495f74fcfa225bd168cbb28450ed981bcb693 - Sigstore transparency entry: 336219973
- Sigstore integration time:
-
Permalink:
ThomasPasquali/MtxMan@2be912a7d8c0c323725498fcd530d7ec15e27ab0 -
Branch / Tag:
refs/tags/v0.0.5 - Owner: https://github.com/ThomasPasquali
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-publish.yml@2be912a7d8c0c323725498fcd530d7ec15e27ab0 -
Trigger Event:
release
-
Statement type: