Add C bindings for MtxLoader (expose .mtx loading to Python)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Start by reading the existing loader in include/spla/io.hpp and src/io.cpp, then inspect the C API pattern in include/spla.h and the Python bindings. The issue also points to python/algorithms/graph_spla.py and examples/tc.cpp and examples/sssp.cpp as usage references. Done means the loader is exposed through C and pyspla, the algorithm script uses it, and tests cover the bindings.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Background
Review comment on PR #282 (gsvgit, on python/algorithms/graph_spla.py):
I hope, Spla (C++ core) has own loaders. May they be shared?
The C++ core has a Matrix Market loader — spla::MtxLoader
(include/spla/io.hpp, src/io.cpp) — which is more capable than the
ad-hoc Python loader currently used by the algorithm scripts:
| Feature | C++ MtxLoader |
Python (graph_spla.py) |
|---|---|---|
| .mtx parsing | yes | yes (via scipy mmread) |
| Edge weights | yes (added in #282) | yes |
Index-base handling (offset_indices) |
yes | yes (scipy converts) |
Symmetrization (make_undirected) |
yes | no |
Loop removal (remove_loops) |
yes | no |
Degree stats (calc_stats / output_stats) |
yes | no |
save() |
yes | no |
However, MtxLoader is currently consumed only by the C++ examples
(examples/tc.cpp, examples/sssp.cpp): there are no spla_MtxLoader_*
functions in the C API (include/spla.h), no src/binding/c_io.cpp, and no
pyspla bindings. As a result the Python side has to implement its own loader
on top of scipy — although pyspla declares no runtime dependencies at all
(scipy is a dev-group package, used for test cross-checks).
Proposed scope
- C API:
spla_MtxLoader_*functions (create / load / getters / free)
following the existing binding pattern - pyspla binding, e.g. a
Matrix.from_mtx(path, ...)classmethod - Refactor
python/algorithms/graph_spla.pyonto the shared loader and drop
the scipy import from the algorithm scripts - Tests for the new bindings
Notes
- The C++ loader stores weights as
floatonly; unit-weight INT graphs need
a cast on the Python side make_undirected/remove_loopsare directly useful for the frontier
algorithms (bfs / sssp), which assume undirected graphs in pull mode
References
- PR #282 (Python graph algorithms) — the review comment that motivated this
- Lenguaje dominante
- C++
- Estrellas
- 37
- Forks
- 21
- Merge medio
- 11 h 3 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de SparseLinearAlgebra/spla
-
task
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
SparseLinearAlgebra/spla#316 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
task
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
SparseLinearAlgebra/spla#249 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
task
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
SparseLinearAlgebra/spla#315 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
task
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
SparseLinearAlgebra/spla#314 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Optimize compute_spgemm_part chunk flushes, atomics, radix sort, SLM, restrict, and subgroup shuffleAbiertotask
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
SparseLinearAlgebra/spla#313 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de SparseLinearAlgebra/spla
Issues similares
-
[Bug]: pip install -U cudaq-qec fails with a conflict that names cudaq-qec itselfPosiblemente ocupada @fedonman la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
gofractally/psibase#2379 ·
Los mantenedores suelen responder en 3 días