Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rerun (-l_from) simulation inside openworm container #154

Closed
lungd opened this issue Jan 16, 2019 · 4 comments
Closed

Rerun (-l_from) simulation inside openworm container #154

lungd opened this issue Jan 16, 2019 · 4 comments
Assignees

Comments

@lungd
Copy link
Contributor

lungd commented Jan 16, 2019

There is an issue with the rerun of the Sibernetic simulatoin: openworm/OpenWorm#291
(Sibernetic crashes while rerunning simulation)

It seems like that issue starts with 688a717 (compile error) and 1b63814

I did some debugging and figuered out the following:
Sibernetic crashes at line

((p_cpp[i * 4] + p_cpp[j * 4] + 4 * p_cpp[k * 4]) / 6 -

'i' (
i = md_cpp[i_m * 3 + 0];
) is a random int.
I think the random value comes from an array initialization with 0 elements
membranes = new int[4 * m_count];

After removing the comment from

// membranesFile >> m_count;
, the recording of the Sibernetic simulation (startet with -l_from) works but there is an issue with the membranes.
The recorded output looks like the following
with_membranes

If I remove the loop for drawing the membranes

for (unsigned int i_m = 0; i_m < localConfig->numOfMembranes; ++i_m) {
, the recorded output looks more like it is supposed to look like
without_membranes

I am not sure whether the membrane issue is related to the code of Sibernetic (loadTo / loadFrom) or to a misconfigured system.

Any ideas?

@lungd
Copy link
Contributor Author

lungd commented Jan 16, 2019

And I think there is an issue with the code starting with

int m_count = 0;
:

I think it should be:

      int m_count = 0;
      membranesFile >> m_count;
      int i = 0;
      membranes = new int[3 * m_count];
      while (membranesFile.good() && i < m_count) {
        membranesFile >> membranes[3 * i + 0] >> membranes[3 * i + 1] >> membranes[3 * i + 2];
        i++;
      }

and not:

      int m_count = 0;
      membranesFile >> m_count;
      int i = 0;
      membranes = new int[4 * m_count];
      while (membranesFile.good() && i < m_count) {
        membranesFile >> membranes[4 * i + 0] >> membranes[4 * i + 1] >> membranes[4 * i + 2] >> membranes[4 * i + 3];
        i++;
      }

But this patch doesn't change the membrane issue described above

@lungd
Copy link
Contributor Author

lungd commented Jan 17, 2019

Update:
The membrane issue is most likely related to the implementation of OpenGL.

I think with a prev version of Sibernetic, the membranes didn't get displayed while rerunning a simulation.
With the current version, including the changes described above, the membranes get displayed but the result looks pretty bad because of the CPU only docker container.

@a-palyanov @skhayrulin, what do you think about adding a parameter defining whether the membranes should get displayed?

@skhayrulin
Copy link
Member

Hi @lungd sorry for late answer, I'll review this at the near time

@lungd
Copy link
Contributor Author

lungd commented Feb 9, 2019

Fixed

@lungd lungd closed this as completed Feb 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants