Gavy Littlewolf Gavy Littlewolf - 2 months ago 29
Java Question

modify a simulation program written in java-maven project into a restartable one

I have a simulation program coded in java - maven, I'm running it on a cluster machine, but there's a wall-time limit. So ideally I'd like to modify the code to make it restartable (i.e. it is able to stop at one point and restart from the point), I have never done this before, can someone give me some hint what process I should follow, that would be greatly appreciated!

Alp Alp

First thing comes to my mind is to serialize your object model. What i mean is, when you start your simulation, first of all, it looks for a special file, which holds serialized form of your entire object tree. If there is any, it de-serializes it, and goes on from there. If not starts as usual, and before stopping, it again serializes its state, writing into that special file and then quits.

I hope it makes sense.