gfrd / modern_egfrd

modern C++ implementation of eGfrd
GNU General Public License v2.0
7 stars 9 forks source link

Error during maintenance #4

Closed PhilippH91 closed 6 years ago

PhilippH91 commented 6 years ago

Hi,

I currently compare the capability of different tools to simulate crowded systems. With eGFRD I have the problem, that the simulation sometimes fails during some maintenance steps. (MaintenanceStep = 100) 11:31:59.373 RunGfrd [FATAL] : Check failed in simulation, at time: 4.6575e-07, step: 7500, fault: EXCEPTION: illegal_state in c:\users\ph\documents\modern_egfrd\src\egfrd\egfrdsimulator.hpp:1322 - EGFRDSimulator::check_particles() Particle:PID(931) overlaps with an other particle. 11:31:59.430 RunGfrd [INFO] : Simulation failed after : 1912.861 seconds / 7500 steps.

(MaintenanceStep = 10000) 01:43:05.718 RunGfrd [FATAL] : Check failed in simulation, at time: 6.21113e-06, step: 100000, fault: EXCEPTION: illegal_state in c:\users\ph\documents\modern_egfrd\src\egfrd\egfrdsimulator.hpp:1392 - EGFRDSimulator::check_shell() Single Domain:DID(237317519) shell may enclose only one particle. 01:43:05.797 RunGfrd [INFO] : Simulation failed after : 57245.227 seconds / 100000 steps.

For the latter error I am not sure what's wrong. Anyway, my actual questions is, if these errors only occur at a maintenance step and the simulation is correct before those steps (then I just can stop using the maintenance function) or are the results before the maintenance incorrect, too? In my understanding of the eGFRD approach the particles didn't have a position at any time. But since the "sim_check_failed_atstep....." file includes a position for each particle, I assume (or hope) that the maintenance step burst all domains, which maybe leads to the error and the results are correct before these events.

Thanks, Philipp

Seynen commented 6 years ago

Hello Philipp,

The maintenance cycle checks the internal data-structures to be valid. Failure is a bad thing. Since the check takes a lot of cpu-power it is run at every N simulation steps (the maintenance-step). In your example a fault has occurred somewhere between step 7400 and 7500 (or 90000 and 100000).

Obviously this should not happen, if the simulator would be bug-free and robust enough for every input-model you could trow at it. Which is in practice impossible, hence the maintenance-cycle.

Could you send me the model that you use? So I can debug and try to fix this. Maybe also tell me what platform and compiler versions you use.

Side note: the maintenance cycle does not bust the domains. For the particle-overlap-check it uses last known positions (latest burst).

Side note2: eGFRD may not be the best simulator for 'crowded systems'.

Best Regards, Marco

PhilippH91 commented 6 years ago

Hello Marco,

I'm using Windows 7 with Visual Studio Community 2017 (15.7.4), CMake 3.8.0 and gsl 2.4-3.

crowding_test.txt In the model attached, I only vary the seed and the number of C particles. I choose Nc in a way, that A+B+C fill 0.84% (Nc=0), 5%, ..., 20% of the volume. The model attached is the one which fails between 7400 and 7500 steps with the error “Particle:PID(931) overlaps with an other particle”.

Side note: I know that eGFRD is not the best choice to simulate crowded systems, but since it should handle reaction and excluded volumes exact, I want to compare it with other approaches.

Best Regards, Philipp

Seynen commented 6 years ago

Hello Philipp,

I fixed the overlap problem. Thanks for finding this bug :-) Let me know if you have anymore questions.

Regards, Marco