Doubt in LAMMPS: Asynchronous Checkpointing

​please always reply to the mailing list.​

Hey, Axel
I am actually a comp. sci. student with little/no knowledge of chemistry.

​this has *nothing* to do with chemistry. the problem is a parallel
programming ​problem for manipulating a stateful system in parallel.

Will my code work for atleast a single processsor?

​no.​ i already explained why.

What modifications do I need to make?

​i already told you as well.​

And The part you said of applying a new fix ? Can you guide me through
that process? I am unable to understand how it works

sorry, but ​i am not your advi​ser and particularly don't have the time to
give random people custom tutorials unless i get paid for my time and
effort.

that being said, all the information you need is readily available, it just
takes some effort, since you are trying something that requires some
understanding of how LAMMPS is implemented and what happens when you run in
parallel. you have to read the available documentation *and* the source
code. what you are trying to do is not very complicated, but requires to be
done the right way. ...and as i already explained, is unlikely to be of
much value for the kind of simulations that LAMMPS supports.

One thing that bothers me is from the new function I have defined in the output.cpp, I am unable to access any variables of other classes. Like If I am trying to access update->ntimestep , I am getting a segmentation fault.
Is there a problem in the way I have declared “Output * async_output” i.e a pointer to output class so that I can access its member function (aysnc_write_restart()) from inside a static method (async_catch()).

One thing that bothers me is from the new function I have defined in the
output.cpp, I am unable to access any variables of other classes. Like If I
am trying to access update->ntimestep , I am getting a segmentation fault.

​yes, and you should. you cannot pass a member function to a signal
handler. you have to pass a function with C bindings to sigaction()
the is a C++ problem and shows that you haven't even done your homework as
far as the comp. sci. part of the problem goes.
please use a debugger and see for yourself. read about the C++ ABI and how
member functions access their respective class members. this is something a
competent comp. sci. student *should* know.

and let me repeat: your approach to the problem is wrong on multiple levels
and *cannot* work. i gave you a strategy, that *can* work. it has been
employed in several parallel applications (and i've implemented it in a
few, too). and there is already a facility in LAMMPS that provides a
solution to this kind of problem in a (mostly) satisfactory way (nobody has
specifically asked for what you try to do so far), so there is not much use
to implement it.

Is there a problem in the way I have declared "Output * async_output"
i.e a pointer to output class so that I can access its member function
(aysnc_write_restart()) from inside a static method (async_catch()).

​talk to your adviser. this is not a mailing list for C++ problems.

axel.​