I found that fix balance and energy minimization can’t be used simultaneously, is it really ? Why ? If I want to optimize the CPU, how can I minimize the energy ？
You can obtain a similar effect as an energy minimization without using the minimize command of LAMMPS, for instance by using a thermostat with a very low temperature, a very short damping, and eventually a small timestep, like:
fix 1 all nve
fix 2 all temp/berendsen 1 1 1
I suspect that you cost more computation time than it would save from fix balance.
You can always use the “balance” command before the minimization. Your system is not supposed to change much during minimization (if it does, you did something wrong with your system setup or force field assignment).
Besides, do you have some dependable numbers on how much time you are saving with fix balance? It is not without cost and thus can cost you more time than it saves. When trying to address load imbalance issues, the biggest gain is from using the “processors” command. Fix balance is really only needed when the system changes significantly during the simulation. That is rarely the case.
Dear akohlmey, thank you for your generous help. I am doing atoms deposition on substrate now. As you know, only part of the box region has atoms. If I use balance command, It does save time for about 25%. But fix balance command can’t be used unless there is no energy minimization in my script.
Fix balance only makes sense during MD as already explained.
And if you use the processors command so that you have only 1 layer of MPI ranks in the direction where you deposit you may not get a significant load imbalance at all.
The original domain decomposition is selected based on volume, but with fix deposit or fix pour you need to keep excess vacuum in one direction so the domain decomposition is suboptimal.
Dear akonlmey, thank you for your careful reply.