Same version unable to load .yade file

Asked by Sacha Duverger

Hello,

I saved a simulation with yadedaily (git revision f3c2fc3) using the ".yade" extension. Immediately after I tried to load it and it worked well. Recently I updated yadedaily and now want to load this simulation, so I compiled yade from the git revision f3c2fc3 but when I tried to load the simulation I get a MemoryError.

Shouldn't it be enough to use the same version of yade to load a ".yade" file?

Thanks in advance,

Sacha

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Bruno Chareyre
Solved:
Last query:
Last reply:
Revision history for this message
Best Bruno Chareyre (bruno-chareyre) said :
#1

Hi,

> Shouldn't it ...

Well... apparently it "doesn't " :)
I don't think we ever anticipated that particular situation so I'm unsure it "should".
You probably need to compile with exactly the same options as the debian build, since many class attributes exist or not depending on compile flags.
Even in that case I'm not sure it is guaranteed to work.
Bruno

Revision history for this message
Sacha Duverger (schmxprr) said :
#2

I tried to compile yade with the default cmake options and this time it worked. So apparently a ".yade" file has to be loaded with the same version of yade but also the same features as the yade used to save it.

Thank you !

Revision history for this message
Sacha Duverger (schmxprr) said :
#3

Thanks Bruno Chareyre, that solved my question.

Revision history for this message
Bruno Chareyre (bruno-chareyre) said :
#4

Yes.
From the save/load point of view the problem is obvious. Objects are archived in some format (binary or xml) then reloaded. If the archive for one object doesn't have the expected content it can't work.

For instance loading a scene with mpi support implies that each body has an integer "subdomain" defined. If it was saved without mpi support then that attribute doesn't exist in the archive: crash.

Bruno

Revision history for this message
Sacha Duverger (schmxprr) said (last edit ):
#5

An update for future references: versions of the python modules installed also matters.

For example: I saved a ".xml.bz2" file with some version of Yade (see [*] for printAllVersions output) and numpy 1.17.4. Soon after I updated numpy to 1.22.3 and couldn't open the ".xml.bz2" file anymore (I got a segmentation fault a couple lines after calling O.load), even though the output of printAllVersions was exactly the same (version + features). Reinstalling numpy 1.17.4 was enough to be able to load the ".xml.bz2" file again.

[*] : printAllVersions output

```
Yade version : 2022-03-22.git-bac0ffb
Yade features : LOGGER USEFUL_ERRORS COMPLEX_MP VTK OPENMP GTS QT5 CGAL LS_DEM GL2PS POTENTIAL_PARTICLES
Yade config dir: ~/.yadenc
Yade precision : 53 bits, 15 decimal places, without mpmath, PrecisionDouble
```

Libraries used :

| library | cmake | C++ |
| ------------- | -------------------- | ------------------ |
| boost | 107100 | 1.71.0 |
| cgal | | 5.0.2 |
| cmake | 3.16.3 | |
| compiler | /usr/bin/c++ 9.4.0 | gcc 9.4.0 |
| eigen | 3.3.7 | 3.3.7 |
| freeglut | 2.8.1 | |
| gl | | 20190805 |
| ipython | 7.13.0 | |
| mpi4py | 3.0.3 | |
| mpmath | 1.1.0 | |
| openblas | | OpenBLAS 0.3.8 |
| python | 3.8.10 | 3.8.10 |
| qglviewer | | 2.6.3 |
| qt | | 5.12.8 |
| sphinx | 1.8.5-final-0 | |
| sqlite | | 3.31.1 |
| vtk | 6.3.0 | 6.3.0 |

```
Linux version : Ubuntu 20.04.3 LTS
Architecture : amd64
Little endian : True
```