simphony / simphony-lammps

The LAMMPS engine-wrapper for the SimPhoNy framework
http://www.simphony-project.eu/
BSD 2-Clause "Simplified" License
8 stars 0 forks source link

optimize FILE-IO #37

Open nathanfranklin opened 9 years ago

nathanfranklin commented 9 years ago

An earlier approach and goal of LAMMPS-MD FILE-IO was to avoid reading from file unless required.

We were originally writing to particle data (ABCParticle related information) to just one file. The idea was that we would write to the file, lammps would run and read this file..and write new results in the same file. If no data related changes occurs (i.e. wrapper.SP[TIME_STEP]=.2 can occur but particles.update_particle does not), there we can avoid reading the data file unless someone queries or changes the data (particles.update_particleor particles.update_particle ).

The idea was to avoid unneeded file reading:

part = md.get_part("foo")
md.run()
md.run()
p = part.get_particle(123)  # reading of file by SimPhoNy first occurs
p = part.get_particle(234)   
md.run() 
wrapper.SP[TIME_STEP]=.1
md.run()
md.run()
p = part.get_particle(123)  # reading of file by SimPhoNy occurs for the second time

However, along the way or even from the beginning this wasnt implemented correctly or tested so this was removed in 423d91291d6a9012b7bc3d4edd9b827930fcebc0

itziakos commented 9 years ago

Welcome to cache invalidation hell :smile:

nathanfranklin commented 9 years ago

ha! definitely.

I realized today that it wouldn't work since I moved to two files.. then I looked more closely and realized that all my logic didn't make sense.