Closed U8NWXD closed 3 years ago
When I run the tests locally on master
, test_flagella
fails.
It's been a while since I've written C code, so please check the C code in this PR extra carefully
@1fish2 Thanks for your comments! I've addressed them. Could you take another look?
Sorry! I wrote this snippet wrong:
copy_c_array(
&state, mersenne.TWISTER_SIZE, sizeof(MTState),
np.NPY_UINT32)
It should be more like:
copy_c_array(
&state, sizeof(mersenne.MTState) / sizeof(uint32_t), sizeof(uint32_t),
np.NPY_UINT32)
@1fish2 thanks! I've made the changes you requested. I decided to not copy the whole MTState struct into a single numpy array though since doing so doesn't make the code that much simpler but adds some unnecessary conceptual overhead. Please let me know if you have any other comments!
@eagmon deferred offline to @1fish2 for review
It's great!
And it reminds me how awful C is, not to speak of C++. We'll never have secure computing with so much C/C++ code in the world. Hmm, maybe the seed of a scary pumpkin idea...
Sometime I'd like to hear about the Vivarium parallelization strategy.
When serializing a
StochasticSimulation
, we should also serialize the state of the Mersenne Twister pseudo-random number generator so that a simulation can be serialized mid-simulation without losing any state.