Morpho-lang / morpho

The Morpho language 🦋. Morpho is a small embeddable language for scientific computing applications.
MIT License
30 stars 10 forks source link

[Bug] Checking if all threads are finished when using multi-processors. #226

Closed ancaandrei closed 1 year ago

ancaandrei commented 1 year ago

Describe the bug When using multiple processes, say with -w4, the code does not check if all threads are complete.

To Reproduce Steps to reproduce the behavior:

  1. run morpho5 -w4 filename.morpho
  2. Check result
  3. run step 1 again, without clearing anything
  4. Check result
  5. Notice the results are different.

Expected behavior We expect steps 2 and 4 to be the same.

Screenshots n/a

Additional context n/a

softmattertheory commented 1 year ago

Thanks for this @ancaandrei! We've reproduced the bug, and it appears to actually be caused by the unsafe linearize() method on the Field class rather than threads not completing. This is fixed by #225 and will work in the next release. Thanks for bringing this to our attention!