radical-collaboration / CyberManufacturing

CDSE Multi-scale CI Project
1 stars 0 forks source link

Update executor to accommodate restarting DEM after a DEM simulation #55

Open iparask opened 6 years ago

iparask commented 6 years ago

We need to update the executor class to allow restarting a DEM simulation after a DEM simulation.

iparask commented 6 years ago

AFAIR, the codes that are being reported from the DEM controller are:

I propose to use value 0 as the value that informs the executor that it should restart the DEM simulation. That way, there is no need to increase the possible values used to describe the execution and we are using a value that is not currently used.

csampat commented 6 years ago

Yes you got the partly correct. 0 was actually for the simulations to continue and wait for either of 1 or 2 to be printed from the controller. Yes 0 still would now mean that it needs to be restarted and that needs to continue till we get a 1 or a 2. I will need to modify the controller a bit so that it only dumps the DEM_status.json right after the restart timestep is reached

iparask commented 6 years ago

Okay!

So DEM's unit will use the granulator restart files from the previous iteration. The controller will produce the restart in file that will be read?

csampat commented 6 years ago

Yes you got that right!

iparask commented 6 years ago

I am pushing some initial changes in the branch fix/issue_55.

csampat commented 6 years ago

I checked the new commit and these are things we will be needing to continue the restart.

  1. First we need to store the initial DEM timestep i.e. the first timestep. Currently it keeps changing with everystep restart. Thus providing this to the DEM controller will make the controller start from that timestep rather than the original timestep. ( eg if DEM is restarted at 100,000 with a step of 20,000 the next iteration should start from 120,000 for the DEM but the DEM controller should also read files from the 100,000 since that is the point of "actual " start of the DEM).

  2. In the cud input staging for the DEM step restart, it should also transfer the collision and impact files from all the units from the "actual" start timestep, since DEM controller should be reading from there instead of the just from the steprestart initial timestep

    I shall also be adding an extra variable to the DEM controller so that we can incorporate this actuall start timestep.

iparask commented 6 years ago

Can you document the changes you are going to do in this ticket? Along with their purpose? Otherwise, any commit I make is on the air.

csampat commented 6 years ago

Okay I shall update the changes on the thread by the tomorrow evening.

csampat commented 6 years ago

I have updated the controllers such that now the DEM controller more number of arguments ( refer wiki)

You need to implement one more variable to save the initial time step of the DEM simulation in the executor such that it stores the time step of the simulation if there are multiple restarts. The time step will also be dumped in the DEM status file once the DEM controller stops. The DEM controller will not only print the DEM status file when it stops. I have programmed it to stop after 4 minutes if it detects no more files.

I have edited cud.pre_exec in start_dem_unit since the restart dir was already being made due to a link in the input_staging.