Specified RandomSeed yields different results

14 views
Skip to first unread message

Lieke van Woerden

unread,
Oct 27, 2023, 4:32:42 AM10/27/23
to Morpheus users
Hello,

I'm working in a model for cell migration and I've found that runs with the same parameters give me different results, even though the RandomSeed is set to a specified value (1). The same happens in Morpheus Examples, such as CellSorting_2D and Proliferation_2D (when I add a RandomSeed there). I'm quite new to Morpheus, so I might be overlooking something, but is this something that can be fixed? I would like to compare the parameter changes that I make.

Thank you!

Kind regards,
Lieke

Lutz Brusch

unread,
Oct 27, 2023, 4:51:56 PM10/27/23
to Morpheus users
Hi Lieke,

thank you for this relevant question! Morpheus must have been running multiple threads in parallel to speed up (see below why) and then the same sequence of random numbers got used in different orders by the parallel steps. 
To switch off multi-threading and obtain exactly the same sequence of CPM spin flips again and again, please go to your Morpheus GUI/Settings(or Preferences)/Local/Threads per job: and set this parameter to 1.
I just checked that here with the latest Morpheus 2.3.5 and it works as it should but please let us know here if it works for you or not (then also which release you are using on which OS version).

Best wishes,
Lutz

PS. The parallel solver from release 2.3.0 onward speeds up CPM simulations (likewise PDEs and ODEs in multiple cells) the more threads your processor supports. Upon a fresh installation of Morpheus (only once forever), it asks your processor how many cores it has and allows itself half that number of threads to run in parallel. This sets the initial entry in your GUI/Settings. You may increase that number further (when knowing your processor and reducing other workloads) or go back to 1 in your current case for reproducible stochastic steps. Whatever you choose in Settings is stored in a file and applied upon next starts and release updates again until you manually choose a different setting. Further details are given in the sections "Multithreading heuristics" and "Parallel CPM" in the Release Notes:

Lieke van Woerden

unread,
Oct 28, 2023, 9:35:33 AM10/28/23
to Morpheus users
Hi Lutz,

Thank you so much for taking the time to respond! I have followed your instructions and the fix works for both the Morpheus Examples and the model I am working with. :)

Again, thank you!

Kind regards,
Lieke
Op vrijdag 27 oktober 2023 om 22:51:56 UTC+2 schreef Lutz Brusch:
Reply all
Reply to author
Forward
0 new messages