lab-cosmo / i-pi-dev_archive

Development version of i-PI
21 stars 12 forks source link

Clean exit with LAMMPS #192

Closed duran closed 5 years ago

duran commented 6 years ago

I cannot use I-PI with LAMMPS without getting an error code. I-PI seems to need an extra iteration to close the server but if you actually do the the extra iteration LAMMPS registers an error. Let's say that we have N timesteps and P beads.

<total_steps>N</total_steps>
...
<initialize nbeads='P'>

We need P * (N + 1) force evaluations.

run P * (N + 1)

Everything seems correct, but the server does not go down. But if we add an additional step:

run P * (N + 1) + 1

The server closes, but LAMMPS register an error:

ERROR on proc 0: Got EXIT message from i-PI. Now leaving! (../fix_ipi.cpp:300)  

Is there any way to do a "clean" exit with LAMMPS without manually killing the I-PI server?

ceriottm commented 6 years ago

Uhm. I think we had just thought that the normal course of action for i-PI exiting before run XXXX had finished was to throw an error. Simple answer would be to use exactly the same run value in LAMMPS as the force evaluations you need in i-PI (most likely nsteps+1). What would be your expected behavior and why would you need LAMMPS to carry on rather than exit?

On 21 July 2017 at 15:21, Bruno Durán notifications@github.com wrote:

I cannot use I-PI with LAMMPS without getting an error code. I-PI seems to need an extra iteration to close the server but if you actually do the the extra iteration LAMMPS registers an error. Let's say that we have N timesteps and P beads.

N

...

We need $P * (N + 1)$ force evaluations. run P * (N + 1) Everything seems correct, but the server does not go down. But if we add an additional step: run P * (N + 1) + 1 The server closes, but LAMMPS register an error: ERROR on proc 0: Got EXIT message from i-PI. Now leaving! (../fix_ipi.cpp:300) Is there any way to do a "clean" exit in LAMMPS without manually killing the I-PI server? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
duran commented 6 years ago

Simple answer would be to use exactly the same run value in LAMMPS as the force evaluations you need in i-PI (most likely nsteps+1).

I do not think that it is possible, at least with LAMMPS. If you want to finish the simulation you get a status code of 1 in you clients.

LAMMPS evaluations <= Total number of evaluations --> I-PI server does not shut down LAMMPS evaluations > Total number of evaluations --> Clients end with a status code of 1

It is not an important issue, but I can upload a reproducible example if you want.

ceriottm commented 6 years ago

OK, so basically this is a (minor) issue on the LAMMPS interface side. I guess the main problem might be it makes it hard to detect whether an error has occurred during the simulation. Honestly we're a bit snowed under making the v2.0 release of i-PI so this is not top of the list - but if you can see a simple way to change the driver to exit gracefully rather than brutally, I'd be glad to package that into a parch and pass it on to Axel and the other LAMMPS developers.

On 11 September 2017 at 11:58, Bruno Durán notifications@github.com wrote:

Simple answer would be to use exactly the same run value in LAMMPS as the force evaluations you need in i-PI (most likely nsteps+1).

I do not think that it is possible, at least with LAMMPS. If you want to finish the simulation you get a status code of 1 in you clients.

LAMMPS evaluations <= Total number of evaluations --> I-PI server does not shut down LAMMPS evaluations > Total number of evaluations --> Clients end with a status code of 1

It is not an important issue, but I can upload a reproducible example if you want.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cosmo-epfl/i-pi-dev/issues/192#issuecomment-328481893, or mute the thread https://github.com/notifications/unsubscribe-auth/ABESZ2pc_94poZzBdsxNJyzzvRJNwbU1ks5shQRKgaJpZM4OfZQn .