ImportError Cython

Description of problem

Hello, my script has worked fine until some days ago. I’m running a long simulation that usually lasts around 4-5 hours. But two days ago I started getting this message at around half of the simulation:
ImportError: /home/federico/.cython/brian_extensions/ failed to map segment from shared object brian

What you have aready tried

I tried to reduce the simulation time at 100*ms and it work without any problem. The problem arise only if I try to do it long. (The simulation time is 300 seconds)
But with 300 seconds it worked fine until three days ago.

In this moment, I switched the codegen target in numpy, but I would like to keep generating the code in Cython…

I’m not sharing the code since it’s kinda long…

Hi @caccola816 I haven’t seen this error before, so I’m not sure where it is coming from. Is this the full error message or is there more information after it? Usually, I’d say an error that occurs for a long simulation but not for a short one would likely be a memory issue (i.e. you have monitors that take up too much space) – but that would be odd since you say it works with numpy which should have the same issue.
When you say it worked until a few days ago, do you mean for the same code, same version of Brian, and same environment in general (dependencies, etc.)?

At the end it didn’t work with numpy too, so It is possible that it’s a memory issue. But yes I didn’t change neither the code or the versions, so that’s why I think it’s strange. Anyway I printed the time at which the process is terminated and it’s always the same, so probably it’s a memory issue…

@caccola816 if you run on Linux, open another terminal and run top or, even better, htop, then press Shift-M to sort processes by memory consumption.