Atomfile variable could not read values

Submitted by lfaguinsky on Wed, 11/15/2017 - 16:07

Hello y'all,

I'm running several LIGGGHTS simulations inside a for-loop in a Bash script. After every simulation a write a restart file, which is read in the beginning of the next one. The only difference is that I change the file which is read in a variable as an atomfile:

variable heatSourceIn atomfile post/atom_file/whatever.atomfile

After about ~50 perfect iterations, I suddenly got the error:
ERROR: Atomfile variable could not read values (../variable.cpp:375)

I have tried changing the variable name after every iteration, but it doesn't help. Does anyone have any idea?

Best,
Luiz

lfaguinsky | Thu, 11/16/2017 - 10:53

After some more investigation, this seems to happen when particles "dissapear" after leaving the simulation box. I still haven't figured a way around it.

Bernhard | Thu, 11/16/2017 - 11:07

Hi,

I'm running similar simulations with atomfiles. I use a python wrapper to LIGGGHTS scripts and write textfiles with python, which are then being used by the atomfiles variables in the LIGGGHTS script.

I've experienced similar and different issues with atomfiles (for example atomfiles variables inserting random values into the LIGGGHTS script). I think there are some bugs that make atomfiles read wrong values, when there's a large processor utilization. For example, the issue I have and had differ when i use random time.sleep() function in my python script. For example a script would work if i use a time.sleep(20) between runs, but not when i use a time.sleep(5) or time.sleep(120).

As you dont increment your atomfile variables and dont couple your code, my solution probably doesnt work for you.

If I understand you correctly you do write a new file with your Simulation and then use that file for your next Simulation. I would try to wait some time within your for-loop after a Simulation has finished and before you start the next one.

Best regards,
Bernhard

lfaguinsky | Thu, 11/16/2017 - 14:02

Thank you for your suggestion, but it doesn't seem to be working on my case.

I am using this Bash script to couple another code to LIGGGHTS. The gist of the loop is:

{
1) Run my code->output a new file with (atom_ID heat source)
2) LIGGGHTS->Read restart file->read the previous file into atomfile variable->set new heat sources->run a few times->write restart
}

This works perfectly until the first particle moves to the outside of the simulation box and subsequently is removed from the list. I have tried "sleep 20" both before and after running LIGGGHTS.

Any ideas are appreciated!
Luiz

arnom's picture

arnom | Fri, 11/17/2017 - 14:34

Hi,
two things:
1.) Are your lines shorter than 256 characters?
2.) As you say you have troubles with particles disappearing, are you sure that the first entry in your atomfile was reduced by 1? I.e. to reflect properly the number of lines inside the file.
If you are certain that the remainder of your code is correct, please provide a minimal working example for us to reproduce this bug and we will try and investigate it for the next release. Please not that the case should not run longer than around 10 minutes.
Best,
Arno

DCS team member & LIGGGHTS(R) core developer

lfaguinsky | Fri, 11/17/2017 - 15:25

Hello Arno,
1) There are some lines larger than 256 characters, but none of them related to the atomfile (or the heat sources). LIGGGHTS runs fine for all of other the steps, with that long line enabled in all cases.
2) The atomfile is generated based on a dump/custom produced on the final step. Is there a way of guaranteeing that the dump is generated *after* the run has finished? This way I could be more certain that the number of items is correct.

Also, I will try tro provide a minimal example for the problem. Should I post it here or send it somewhere?

arnom's picture

arnom | Mon, 11/20/2017 - 10:08

Hi Luiz,

I was only talking about the atomfile wrt the line numbers. So it should be fine.

There should not be any particle deletion after the dump, so that should not be the issue.

Please post your example here.

Thanks,
Arno

DCS team member & LIGGGHTS(R) core developer

lfaguinsky | Mon, 11/20/2017 - 15:58

I really couldn't make a pure-LIGGGHTS example in order to put here - the overall simulation is just too convoluted.

I managed to fix the issue by creating a small region near the edge of the simulation box. Before outputing the dump, I am manually deleting the particules using a delete_atoms for that region. This makes reading the atomfile work perfectly.

Thank you for your help!

Best,
Luiz