Comments (3)
Hi @pascalreinhold, thanks for opening the issue!
matio-cpp
is a cpp interface toward the matio
library, that takes care of dealing with the mat
file. When opening a mat
file, matio
loads its entire content in memory. Hence, when reading and writing variables, it always accesses the same portion of memory. Thus, there are possible concurrency issues, and by extension, also matio-cpp
is not thread-safe.
If your goal is to speed up the reading of the file, I would suggest splitting it in separate files, or to use a format that supports reading in chunks like hdf5
(see for example https://docs.hdfgroup.org/hdf5/v1_12/group___h5_d.html#gac1092a63b718ec949d6539590a914b60). Recent mat
files are compatible with hdf5
, but mat
files on their own do not support this option unfortunately.
from matio-cpp.
Hey thank you for the fast reply.
Does this is also apply to me, because I'm just reading the file and not writing?
Hence, when reading and writing variables [...] there are possible concurrency issues, and by extension, also
matio-cpp
is not thread-safe.
Not sure, but I think you are mistaken. In matio
there are the Mat_VarReadInfo()
and Mat_VarRead()
functions to avoid loading a variable into memory until you need it.
When opening a 'mat' file, 'matio' loads its entire content in memory
from matio-cpp.
Not sure, but I think you are mistaken. In
matio
there are theMat_VarReadInfo()
andMat_VarRead()
functions to avoid loading a variable into memory until you need it.When opening a 'mat' file, 'matio' loads its entire content in memory
Both those function require opening the mat
file first, i.e. loading it into memory. See:
- https://manpages.debian.org/testing/libmatio-doc/Mat_VarReadInfo.3.en.html
- https://manpages.debian.org/jessie/libmatio-doc/Mat_VarRead.3
Btw, Mat_VarRead
is the exact function that matio-cpp
uses to read a variable:
Line 322 in a0daf06
Note that Mat_VarRead
requires a non-const pointer to a mat_t
object. This means that even the read can potentially modify this object. Hence, there could be possible concurrent reads and writes. So to answer your question,
Does this is also apply to me, because I'm just reading the file and not writing?
unfortunately, yes.
from matio-cpp.
Related Issues (20)
- Test issue for auto assignement HOT 1
- Yet another test issue HOT 1
- Some tests failed after new matio release HOT 1
- String16 and String32 do not have the assignement operator from the corresponding strings HOT 1
- Add path/name of the file that matio-cpp failed to create HOT 1
- Reading in sparse matrix HOT 1
- Missing deduction guides for Span object HOT 10
- Generated matfile are not hdf5 compatible HOT 7
- Investigate the possibility of automatically converting a struct into a matioCpp struct using reflection HOT 1
- Add system tests for reading/writing in matlab HOT 1
- *.tpp files throw syntax error HOT 16
- Build errors with MSVC /permissive- flag HOT 2
- Problem with linking library HOT 13
- Memory problem HOT 3
- Test #11 failing HOT 2
- Tests fail on Windows HOT 2
- Cannot read mat files saved from Python with `7.3` format HOT 15
- CI Failure April 2024 HOT 4
- Compilation failure with matio 1.5.27 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from matio-cpp.