OpenMEEG error #134

Hello, I got the error posted below but I can't find a way to fix the problem. It occurs when trying to use Brainstorms BEM source reconstruction for EEG. It only occur on this subject, If I run it with a different subject there is no error, and if I do the MEG version there is no error as well. Could you assist me in determining what the problem is and how to fix it?

Nicholas

./om_gain -EEG "/Lab Applications/Brainstorm_db/SFN_MEG_EEG_analysis/anat/4138_analysis/tess_innerskull_bem_openmeeg.bin" "/Users/nheugel/.brainstorm/tmp/openmeeg_dsm.bin" "/Users/nheugel/.brainstorm/tmp/openmeeg_h2em.bin" "/Users/nheugel/.brainstorm/tmp/openmeeg_gain_eeg.bin": Aborted


** Error: OpenMEEG call: ./om_gain -EEG
** "/Lab Applications/Brainstorm_db/SFN_MEG_EEG_analysis/anat/4138_analysis/tess_innerskull_bem_openmeeg.bin"
** "/Users/nheugel/.brainstorm/tmp/openmeeg_dsm.bin"
** "/Users/nheugel/.brainstorm/tmp/openmeeg_h2em.bin"
** "/Users/nheugel/.brainstorm/tmp/openmeeg_gain_eeg.bin"
** OpenMEEG error #134:
** ./om_gain version 2.2.0 (exported) compiled at Feb 22 2013 18:41:19
**
** | ------ ./om_gain
** | -EEG
** | /Lab Applications/Brainstorm_db/SFN_MEG_EEG_analysis/anat/4138_analysis/tess_innerskull_bem_openmeeg.bin
** | /Users/nheugel/.brainstorm/tmp/openmeeg_dsm.bin
** | /Users/nheugel/.brainstorm/tmp/openmeeg_h2em.bin
** | /Users/nheugel/.brainstorm/tmp/openmeeg_gain_eeg.bin
** | -----------------------
** Exception: Bad storage type in file /Users/nheugel/.brainstorm/tmp/openmeeg_dsm.bin. Doing my best....
** terminate called after throwing an instance of 'OpenMEEG::maths::BadStorageType'
** what(): Exception: Bad storage type in file /Users/nheugel/.brainstorm/tmp/openmeeg_dsm.bin.
** Abort
**


Alex, Francois?

Interesting, no reply to this old post! However, tonight, while working on a deadline (of course), I too hit OpenMEEG error #134, with a similar error message, on an otherwise yet another routine subject. However, there is nothing wrong with my “/Users/mosher/.brainstorm/tmp” folder, and it has several OpenMEEG generated files in it from this run, before hitting the below error message.

I let OpenMEEG generate the internal surfaces from the Freesurfer generated cortex and scalp. I have 32GB of ram on a Mac.

Ideas? I’ve already rebooted, my first hammer of choice.

  • John

./om_assemble -DS2IPM “/Users/mosher/.brainstorm/tmp/openmeeg.geom” “/Users/mosher/.brainstorm/tmp/openmeeg.cond” “/Users/mosher/.brainstorm/tmp/openmeeg_dipoles.txt” “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_gain_ecog.bin” 2>&1: Aborted


** Error: OpenMEEG call: om_assemble -DS2IPM
** “/Users/mosher/.brainstorm/tmp/openmeeg.geom”
** “/Users/mosher/.brainstorm/tmp/openmeeg.cond”
** “/Users/mosher/.brainstorm/tmp/openmeeg_dipoles.txt”
** “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin”
** “/Users/mosher/.brainstorm/tmp/openmeeg_gain_ecog.bin”
** OpenMEEG error #134:
** ./om_assemble version 2.2.0 (exported) compiled at Feb 22 2013 18:41:19
**
** | ------ ./om_assemble
** | -DS2IPM
** | /Users/mosher/.brainstorm/tmp/openmeeg.geom
** | /Users/mosher/.brainstorm/tmp/openmeeg.cond
** | /Users/mosher/.brainstorm/tmp/openmeeg_dipoles.txt
** | /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin
** | /Users/mosher/.brainstorm/tmp/openmeeg_gain_ecog.bin
** | -----------------------
** Sorted List : 1 0 2
** Sorted Domains : Brain Skull Scalp Air
** Total number of points : 5766
** Total number of triangles : 11520
** Checking
** Mesh 0 : internal conductivity = 1 and external conductivity = 0.0125
** Mesh 1 : internal conductivity = 0.0125 and external conductivity = 1
** Mesh 2 : internal conductivity = 1 and external conductivity = 0
** Exception: Unable to open the file /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin for reading Doing my best…
** libc++abi.dylib: terminating with uncaught exception of type OpenMEEG::maths::BadFileOpening: Exception: Unable to open the file /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin for reading
** /bin/bash: line 1: 1069 Abort trap: 6 ./om_assemble -DS2IPM “/Users/mosher/.brainstorm/tmp/openmeeg.geom” “/Users/mosher/.brainstorm/tmp/openmeeg.cond” “/Users/mosher/.brainstorm/tmp/openmeeg_dipoles.txt” “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_gain_ecog.bin” 2>&1
**
** Many OpenMEEG crashes are due to a lack of memory.
** Reduce the number of vertices on each BEM layer and try again.


Update: I ran OpenMEEG on a different subject with scalp electrodes only, no problem. But I tried to repeat a different SEEG case, that I ran successfully on Nov 14, 2014, but now gives a very similar error message, below. Yet nothing changed in that subject, that I recall.

This error says “bad storage type,” (like the original post from 2013), but the earlier one said “unable to open.”

So I have to wonder if something in Brainstorm and SEEG electrodes has changed?

  • John

./om_gain -IP “/Volumes/Local_Shed_4TB/brainstorm_db_dev/SEEG/anat/Robinson_Juliana/tess_innerskull_warped_openmeeg.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_dsm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_h2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_gain_seeg.bin” 2>&1: Aborted


** Error: OpenMEEG call: om_gain -IP
** “/Volumes/Local_Shed_4TB/brainstorm_db_dev/SEEG/anat/Robinson_Juliana/tess_innerskull_warped_openmeeg.bin”
** “/Users/mosher/.brainstorm/tmp/openmeeg_dsm.bin”
** “/Users/mosher/.brainstorm/tmp/openmeeg_h2ipm.bin”
** “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin”
** “/Users/mosher/.brainstorm/tmp/openmeeg_gain_seeg.bin”
** OpenMEEG error #134:
** ./om_gain version 2.2.0 (exported) compiled at Feb 22 2013 18:41:19
**
** | ------ ./om_gain
** | -IP
** | /Volumes/Local_Shed_4TB/brainstorm_db_dev/SEEG/anat/Robinson_Juliana/tess_innerskull_warped_openmeeg.bin
** | /Users/mosher/.brainstorm/tmp/openmeeg_dsm.bin
** | /Users/mosher/.brainstorm/tmp/openmeeg_h2ipm.bin
** | /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin
** | /Users/mosher/.brainstorm/tmp/openmeeg_gain_seeg.bin
** | -----------------------
** Exception: Bad storage type in file /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin. Doing my best…
** libc++abi.dylib: terminating with uncaught exception of type OpenMEEG::maths::BadStorageType: Exception: Bad storage type in file /Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin.
** /bin/bash: line 1: 1401 Abort trap: 6 ./om_gain -IP “/Volumes/Local_Shed_4TB/brainstorm_db_dev/SEEG/anat/Robinson_Juliana/tess_innerskull_warped_openmeeg.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_dsm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_h2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_ds2ipm.bin” “/Users/mosher/.brainstorm/tmp/openmeeg_gain_seeg.bin” 2>&1
**
** Many OpenMEEG crashes are due to a lack of memory.
** Reduce the number of vertices on each BEM layer and try again.


Hi Francois,

I happen to have handy an old version of Brainstorm from May of 2014 (an old path on my desktop). I setup a small Brainstorm database with just this subject (i.e. did not want to risk my larger newer database), confirmed again that the current (Jan 19 2015) brainstorm and OpenMEEG failed on this toy database, then switched to the May 2014 Brainstorm.

Success in running OpenMEEG.

I switched back from the old version to the new version of Brainstorm to get the rest of my project done tonight.

Hmmm. I leave this mystery to you. I’m guessing with all of the recent changes made in the way that we process and visualize SEEG data, something broke?

  • John

Hi John,

This is all with the same version of Matlab, on the same computer?
Have you checked if those different versions of Brainstorm were using the same version of OpenMEEG? (file: $HOME/.brainstorm/openmeeg/<arch>/url)
Can you tell me what is the exact release day of the Brainstorm version with which it works?
How many vertices are you using for your BEM layers, and many source points do you have?
Have you tried with a slightly lower number of vertices?

Can you zip this small database and send it to me (dropbox or equivalent)?
Please add an exact description of how to reproduce this crash.

If both versions of Brainstorm use the same version of OpenMEEG, there are two options:

  • it is a bug on the Brainstorm side due to a different list of OpenMEEG calls (but it is happening at a stage where all the files are either created by OpenMEEG or have already been used by OpenMEEG...)
  • there is some memory issue and the system responds differently at different moments to faulty mallocs or memory access, and the fact that it appeared to crash twice with one version and worked once with another is just purely random

As a side note, there are also some reproducible bugs in OpenMEEG with the processing of SEEG models.
I posted messages on their GitHub issue tracker but did not get any answer.
https://github.com/openmeeg/openmeeg/issues

Cheers,
Francois

Thanks, Francois, I’m testing various combinations now. I tried earlier reducing the vertices to around 1400 per surface, but still crashed. I’m using the typical 15,000 dipolar cortical grid.

In testing various other configurations, I got one successful run (noted in the earlier post), but then I ran into general problems trying to run the May 2014 version of Brainstorm under Matlab 2014b, because, as we all know, of all of the changes Mathworks made between 2014a and 2014b. So trying to separate the confounds here! I’ve retrieved a more recent Fall version, and I’m stepping back to 2014a, to see if I can thread these changes.

My OpenMEEG version has been constant for awhile, a 2013 compile:
http://openmeeg.gforge.inria.fr/download/OpenMEEG-2.2.0-MacOSX-Intel-gcc-4.2.1-static.tar.gzmegmac2:mac64

My workstation is a Mac Pro with 32GB of physical RAM and no excess RAM pressure or commitment at the time of crash. Only one of my eight processors humming along.

I will have to de-identify the subject before providing you a sample, but I’ll first see if I can find a magic combination of versions that works.

UPDATE: It just worked under Matlab 2014A and Brainstorm Version: 3.2.141008 (08-Oct-2014). I’ll keep testing.

  • John

Note that the OpenMEEG functions are called in separate processes through system calls. For the OS, the Matlab process and the OpenMEEG process are not even related.
It is very unlikely that different versions of Matlab or Brainstorm, if they are calling the same OpenMEEG functions, would behave differently.
If you obtain different behaviors, it is because the system responds differently to what OpenMEEG is doing… I guess you could run twice the exact same command and have it working once and crash once.

The parameters of interest from the Brainstorm perspective are the number of vertices per BEM layer and the position of the sensors wrt the those layers.

John: Could you zip all the contents of the $HOME/.brainstorm/tmp folder and post it on the OpenMEEG issue page?
Alex: Could you test it?

[QUOTE=Francois;7824]
Alex: Could you test it?
[/QUOTE]

yes please share the files.

A

Did someone found an explanation for this error? I just got the same error trying to build a “custom source model” on high-density EEG data using Brainstorm version 3.2 (03-Feb-2015). My OpenMEEG has been downloaded today by Brainstorm (so it is up-to-date). I’m working with Matlab 2012a. Memory and processor have enough margin at the time of the crash, only the HDD are running at full capacity. HDD has enough storage capacity. Full error message below:

BST> Cortex L: 7501 vertices
BST> Cortex R: 7501 vertices
BST> Thalamus L: 108 vertices
BST> Thalamus R: 88 vertices


** Error: OpenMEEG call: om_gain -EEG
** “C:\Users\Christian\brainstorm_db\EEG_HD\anat\1323 ess_innerskull_bem_1922V_openmeeg.bin”
** “C:\Users\Christian.brainstorm mp\openmeeg_dsm.bin”
** “C:\Users\Christian.brainstorm mp\openmeeg_h2em.bin”
** “C:\Users\Christian.brainstorm mp\openmeeg_gain_eeg.bin”
** OpenMEEG error #255:
** om_gain version 2.2.0 (exported) compiled at Feb 19 2013 14:00:34
**
** | ------ om_gain
** | -EEG
** | C:\Users\Christian\brainstorm_db\EEG_HD\anat\1323 ess_innerskull_bem_1922V_openmeeg.bin
** | C:\Users\Christian.brainstorm mp\openmeeg_dsm.bin
** | C:\Users\Christian.brainstorm mp\openmeeg_h2em.bin
** | C:\Users\Christian.brainstorm mp\openmeeg_gain_eeg.bin
** | -----------------------
** Exception: Bad storage type in file C:\Users\Christian.brainstorm mp\openmeeg_dsm.bin. Doing my best…
**
** Many OpenMEEG crashes are due to a lack of memory.
** Reduce the number of vertices on each BEM layer and try again.


I was unable to get a consistent crash last week. I’m on a grant writing deadline, and to share the data over to Alex’s site requires some de-identification efforts first for my data, which will have to wait until we get through our deadlines here.

Interesting that you have jumped to OpenMEEG error #255, but with basically the same complaint: “Bad storage type.”

Thanks for the feedback. Yes, same exception, different error number. Maybe the causes of both are not related but it seems like very similar situations… Anyways, I’ll check it more in more details in the next days/weeks and if I found anything interesting I’ll post it here.

@John: There is no identification information in the openmeeg temporary folder.
After a crash, just zip the whole folder $HOME/.brainstorm/tmp folder and post it on the OpenMEEG issue page:
https://github.com/openmeeg/openmeeg/issues

@Christian: Have you tried with less vertices for the BEM layers (~600V) and with different computation options?
If the error is reproducible with multiple configuration, please zip $HOME/.brainstorm/tmp, upload it somewhere (ie dropbox) and post the link, the full error message and the list of parameters you tried on the OpenMEEG issue page.

Francois

Thanks for the feedback François. For some reason, it worked well when I checked “use adjoint formulation”. I guess it must have been related to memory availability issues but I’m surprised since I have 16GB of RAM and only about half was in use when at crashing times… I’m running it on a 64-bit version of Matlab of I guess there is no reason why it shouldn’t get access to the rest of the memory and with almost 8GB free, it should not be difficult to find large blocks of contiguous memory…

Those are questions for the OpenMEEG developers.
This program is executed through a system call and runs in a separate process. From the Matlab/Brainstorm side, we have no control over what it does with the memory.
Francois

Associated issue on github:

It started working when I switched to version 2.2.

http://openmeeg.gforge.inria.fr/download/release-2.2/

@christianoreilly @gunnarinn you should now be able to update brainstorm and get an updated version (2.4.1) of OpenMEEG that should work out of the box.

Alex

To update Brainstorm manually, use the menu Update > Update Brainstorm.
The next time you use OpenMEEG to compute a forward model, the newest version (2.4.1) should be downloaded and installed automatically.