Save computational time for variable command

Dear all,
Just a quick question.

I am using some variable commands in my input file to count atoms in a region,
I have a very costly case to do and just wondering if I can make the variable commands more efficient by counting the atoms every 1e5 timesteps instead of counting them every timestep, because I dont need the to know the count every step.
Is there any way to do that?
Thank you in advance

Dear all,
Just a quick question.

I am using some variable commands in my input file to count atoms in a region,
I have a very costly case to do and just wondering if I can make the variable commands more efficient by counting the atoms every 1e5 timesteps instead of counting them every timestep, because I dont need the to know the count every step.
Is there any way to do that?

variables are only evaluated when they are read. so don’t do any operation that reads/evaluates them, and then it will not be called.

axel

Dear all,
Just a quick question.

I am using some variable commands in my input file to count atoms in a region,
I have a very costly case to do and just wondering if I can make the variable commands more efficient by counting the atoms every 1e5 timesteps instead of counting them every timestep, because I dont need the to know the count every step.

also, please explain how counting of atoms in a region is a very costly operation. the count(group,region) function is well parallelized, is an O(N) operation plus one reduction and thus not more expensive then summing the total energy. this is cheap compared to the force computation.

axel.

Thank you dr. axel
I thought it can be expensive, apparently as you said it is not because I call the variable every 1e5 steps
Thank you for your time