About calling variables by loop

Hello guys,

Here I declare some variables, for example, by

variable i loop 10
label i_start
    variable b_${i} equal ${i}^2
next i
jump SELF i_start

My question is how to call those variables in another loop? For example, I tried

variable j loop 10
label j_start
    print "b_${j} = ${b_${j}}"
next j
jump SELF j_start

I know that this is incorrect. But how can I do it???


My real question is the following:

variable i loop 100
label i_start
    ...
    shell python3.7 ./compute_volume.py ./folder/$(elaplong).dump ${sigma} > total_volume_of_grains.txt
    variable total_volume_of_grains file total_volume_of_grains.txt
    ....
next i
jump SELF i_start

I am trying to use python to compute the total volume of grains in the system. If the volume reaches a value V, then stop the simulation.

However, the variable with the keyword ‘file’ cannot be redefined. So I tried something like

variable V_${i} file V.txt

Now I have a problem about calling those variables V_i.


Thanks for your replies!!!

Why don’t you use a python style variable instead of calling a python script?
Then you don’t have to read the result from a file.

In addition, you can also load the LAMMPS python module inside your python script associated with the python style variable and in there call “gather_atoms” or “gather_atoms_subset” to get data of atoms and then process them instead of reading them from a dump file.

Reading, writing, and parsing files are very slow operations and can overload networked file systems when run in parallel on a cluster. By comparison, accessing the memory is fast.

So you just delete the variable before re-defining it.

Thank you very much !!!

Sorry to bother you again.

I use

variable a equal 19193

variable i loop 10
label i_start
    variable a equal ${a}*1.1
    shell echo ${a} > a.txt
    variable b file a.txt
    print "a = ${a}, b = ${b}"
    if "${b}>30000" then "jump SELF i_end"
    variable b delete
next i
jump SELF i_start

label i_end

It works. However, in my real script

    ...
    shell python3.7 ./compute_volume.py ${DIMENSION} ./${DIMENSION}D-packing/LS/E_${epsilon}_G_${i}_config_${config}/$(v_ls*100).dump ${sigma} > phi_of_sys.txt
    variable phi_of_sys file phi_of_sys.txt

    if "${phi_of_sys} >= ${phi}" then "jump SELF LS_end"
    shell echo $(v_ls*100) ${phi_of_sys} >> phi_of_sys.csv

    variable phi_of_sys delete

next ls
jump SELF LS_start

label LS_end

It shows

[RemoteHost:157288] *** Process received signal ***
[RemoteHost:157294] *** Process received signal ***
[RemoteHost:157302] *** Process received signal ***
[RemoteHost:157314] *** Process received signal ***
[RemoteHost:157320] *** Process received signal ***
[RemoteHost:157320] Signal: Aborted (6)
[RemoteHost:157320] Signal code:  (-6)
[RemoteHost:157324] *** Process received signal ***
[RemoteHost:157324] Signal: Aborted (6)
[RemoteHost:157324] Signal code:  (-6)
[RemoteHost:157289] *** Process received signal ***
[RemoteHost:157289] Signal: Aborted (6)
[RemoteHost:157289] Signal code:  (-6)
[RemoteHost:157290] *** Process received signal ***
[RemoteHost:157290] Signal: Aborted (6)
[RemoteHost:157290] Signal code:  (-6)
[RemoteHost:157291] *** Process received signal ***
[RemoteHost:157291] Signal: Aborted (6)
[RemoteHost:157291] Signal code:  (-6)
[RemoteHost:157288] Signal: Segmentation fault (11)
[RemoteHost:157288] Signal code: Address not mapped (1)
[RemoteHost:157288] Failing at address: (nil)
[RemoteHost:157298] *** Process received signal ***
[RemoteHost:157298] Signal: Aborted (6)
[RemoteHost:157298] Signal code:  (-6)
[RemoteHost:157298] [RemoteHost:157294] Signal: Aborted (6)
[RemoteHost:157294] Signal code:  (-6)
[RemoteHost:157304] *** Process received signal ***
[RemoteHost:157304] Signal: Aborted (6)
[RemoteHost:157304] Signal code:  (-6)
[RemoteHost:157304] [ 0] [RemoteHost:157306] *** Process received signal ***
[RemoteHost:157306] Signal: Aborted (6)
[RemoteHost:157306] Signal code:  (-6)
[RemoteHost:157306] [ 0] [RemoteHost:157312] *** Process received signal ***
[RemoteHost:157312] Signal: Aborted (6)
[RemoteHost:157312] Signal code:  (-6)
[RemoteHost:157302] Signal: Aborted (6)
[RemoteHost:157302] Signal code:  (-6)
[RemoteHost:157316] *** Process received signal ***
[RemoteHost:157316] Signal: Aborted (6)
[RemoteHost:157316] Signal code:  (-6)
[RemoteHost:157316] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7ffafff193d0]
[RemoteHost:157316] [ 1] [RemoteHost:157317] *** Process received signal ***
[RemoteHost:157317] Signal: Aborted (6)
[RemoteHost:157317] Signal code:  (-6)
[RemoteHost:157317] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fd0a7ef03d0]
[RemoteHost:157317] [ 1] [RemoteHost:157314] Signal: Aborted (6)
[RemoteHost:157314] Signal code:  (-6)
[RemoteHost:157314] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fd5ca0f03d0]
[RemoteHost:157314] [ 1] [RemoteHost:157320] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fcb9653c3d0]
[RemoteHost:157320] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fcb9558b418]
[RemoteHost:157320] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fcb9558d01a]
[RemoteHost:157320] [RemoteHost:157324] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fb7eebcc3d0]
[RemoteHost:157324] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fb7edc1b418]
[RemoteHost:157324] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fb7edc1d01a]
[RemoteHost:157324] [ 3] [RemoteHost:157289] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f0f490303d0]
[RemoteHost:157289] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f0f4807f418]
[RemoteHost:157289] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f0f4808101a]
[RemoteHost:157289] [ 3] [RemoteHost:157290] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f19865c83d0]
[RemoteHost:157290] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f1985617418]
[RemoteHost:157290] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f198561901a]
[RemoteHost:157290] [ 3] [RemoteHost:157291] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fee404d53d0]
[RemoteHost:157291] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fee3f524418]
[RemoteHost:157291] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fee3f52601a]
[RemoteHost:157291] [ 3] [RemoteHost:157288] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f72f85b63d0]
[RemoteHost:157288] [ 1] /lib/x86_64-linux-gnu/libc.so.6(fclose+0x4)[0x7f72f763d214]
[RemoteHost:157288] [ 2] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f956cb053d0]
[RemoteHost:157298] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f956bb54418]
[RemoteHost:157298] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f956bb5601a]
[RemoteHost:157298] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f956bb9672a]
[RemoteHost:157298] [ 4] [RemoteHost:157294] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f2d215653d0]
[RemoteHost:157294] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f2d205b4418]
[RemoteHost:157294] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f2d205b601a]
[RemoteHost:157294] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f2d205f672a]
[RemoteHost:157294] [ 4] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7fede8a6b3d0]
[RemoteHost:157304] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fede7aba418]
[RemoteHost:157304] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fede7abc01a]
[RemoteHost:157304] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fede7afc72a]
[RemoteHost:157304] [ 4] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f7cfa47c3d0]
[RemoteHost:157306] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f7cf94cb418]
[RemoteHost:157306] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f7cf94cd01a]
[RemoteHost:157306] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f7cf950d72a]
[RemoteHost:157306] [ 4] [RemoteHost:157312] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f1e647ad3d0]
[RemoteHost:157312] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f1e637fc418]
[RemoteHost:157312] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f1e637fe01a]
[RemoteHost:157312] [ 3] [RemoteHost:157302] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f9f9acc03d0]
[RemoteHost:157302] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f9f99d0f418]
[RemoteHost:157302] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f9f99d1101a]
[RemoteHost:157302] [ 3] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7ffafef68418]
[RemoteHost:157316] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7ffafef6a01a]
[RemoteHost:157316] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7ffafefaa72a]
[RemoteHost:157316] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7ffafefb3679]
[RemoteHost:157316] [ 5] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fd0a6f3f418]
[RemoteHost:157317] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fd0a6f4101a]
[RemoteHost:157317] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fd0a6f8172a]
[RemoteHost:157317] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7fd0a6f89f4a]
[RemoteHost:157317] [ 5] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fd5c913f418]
[RemoteHost:157314] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fd5c914101a]
[RemoteHost:157314] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fd5c918172a]
[RemoteHost:157314] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x805b7)[0x7fd5c918a5b7]
[RemoteHost:157314] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd5c918dabc]
[RemoteHost:157314] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157314] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157314] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157314] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157314] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157314] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd5c912a830]
[RemoteHost:157314] [12] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fd0a6f8dabc]
[RemoteHost:157317] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157317] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157317] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157317] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157317] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157317] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fd0a6f2a830]
[RemoteHost:157317] [12] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fcb955cd72a]
[RemoteHost:157320] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7fcb955d6679]
[RemoteHost:157320] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fcb955d9abc]
[RemoteHost:157320] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157320] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157320] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157320] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157320] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157320] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fcb95576830]
[RemoteHost:157320] [12] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fb7edc5d72a]
[RemoteHost:157324] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x805b7)[0x7fb7edc665b7]
[RemoteHost:157324] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fb7edc69abc]
[RemoteHost:157324] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157324] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157324] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157324] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157324] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157324] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fb7edc06830]
[RemoteHost:157324] [12] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f0f480c172a]
[RemoteHost:157289] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x805b7)[0x7f0f480ca5b7]
[RemoteHost:157289] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f0f480cdabc]
[RemoteHost:157289] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157289] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157289] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157289] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157289] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157289] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f0f4806a830]
[RemoteHost:157289] [12] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f198565972a]
[RemoteHost:157290] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f1985662679]
[RemoteHost:157290] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f1985665abc]
[RemoteHost:157290] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157290] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157290] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157290] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157290] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157290] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f1985602830]
[RemoteHost:157290] [12] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7fee3f56672a]
[RemoteHost:157291] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7fee3f56ef4a]
[RemoteHost:157291] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fee3f572abc]
[RemoteHost:157291] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157291] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157291] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157291] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157291] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157291] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fee3f50f830]
[RemoteHost:157291] [12] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x31c)[0x865ddc]
[RemoteHost:157288] [ 3] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157288] [ 4] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157288] [ 5] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157288] [ 6] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f956bb9f679]
[RemoteHost:157298] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f956bba2abc]
[RemoteHost:157298] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157298] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157298] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157298] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157298] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157298] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f956bb3f830]
[RemoteHost:157298] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157298] *** End of error message ***
/lib/x86_64-linux-gnu/libc.so.6(+0x7ff4a)[0x7f2d205fef4a]
[RemoteHost:157294] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f2d20602abc]
[RemoteHost:157294] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157294] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157294] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157294] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157294] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157294] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f2d2059f830]
[RemoteHost:157294] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157294] *** End of error message ***
/lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7fede7b05679]
[RemoteHost:157304] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fede7b08abc]
[RemoteHost:157304] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157304] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157304] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157304] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157304] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157304] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fede7aa5830]
[RemoteHost:157304] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157304] *** End of error message ***
/lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f7cf9516679]
[RemoteHost:157306] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f7cf9519abc]
[RemoteHost:157306] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157306] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157306] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157306] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157306] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157306] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f7cf94b6830]
[RemoteHost:157306] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157306] *** End of error message ***
/lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f1e6383e72a]
[RemoteHost:157312] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f1e63847679]
[RemoteHost:157312] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f1e6384aabc]
[RemoteHost:157312] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157312] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157312] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157312] [ 9] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f9f99d5172a]
[RemoteHost:157302] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f9f99d5a679]
[RemoteHost:157302] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f9f99d5dabc]
[RemoteHost:157302] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157302] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157302] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157302] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157302] [10] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7ffafefb6abc]
[RemoteHost:157316] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157316] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157316] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157316] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157316] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157316] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7ffafef53830]
[RemoteHost:157316] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157316] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157314] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157317] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157320] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157324] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157289] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157290] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157291] *** End of error message ***
./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157288] [ 7] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f72f75f0830]
[RemoteHost:157288] [ 8] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157288] *** End of error message ***
./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157312] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157312] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f1e637e7830]
[RemoteHost:157312] [12] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157302] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f9f99cfa830]
[RemoteHost:157302] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157302] *** End of error message ***
./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157312] *** End of error message ***
[RemoteHost:157295] *** Process received signal ***
[RemoteHost:157295] Signal: Aborted (6)
[RemoteHost:157295] Signal code:  (-6)
[RemoteHost:157295] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0x113d0)[0x7f8107c6a3d0]
[RemoteHost:157295] [ 1] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7f8106cb9418]
[RemoteHost:157295] [ 2] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7f8106cbb01a]
[RemoteHost:157295] [ 3] /lib/x86_64-linux-gnu/libc.so.6(+0x7772a)[0x7f8106cfb72a]
[RemoteHost:157295] [ 4] /lib/x86_64-linux-gnu/libc.so.6(+0x80679)[0x7f8106d04679]
[RemoteHost:157295] [ 5] /lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f8106d07abc]
[RemoteHost:157295] [ 6] ./lmp_mpi(_ZN9LAMMPS_NS8Variable6removeEi+0x1e1)[0x865ca1]
[RemoteHost:157295] [ 7] ./lmp_mpi(_ZN9LAMMPS_NS8Variable4nextEiPPc+0x438)[0x86fa08]
[RemoteHost:157295] [ 8] ./lmp_mpi(_ZN9LAMMPS_NS5Input15execute_commandEv+0x9ab)[0x4ec4eb]
[RemoteHost:157295] [ 9] ./lmp_mpi(_ZN9LAMMPS_NS5Input4fileEv+0x28f)[0x4eccef]
[RemoteHost:157295] [10] ./lmp_mpi(main+0x46)[0x4e35a6]
[RemoteHost:157295] [11] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f8106ca4830]
[RemoteHost:157295] [12] ./lmp_mpi(_start+0x29)[0x4e3619]
[RemoteHost:157295] *** End of error message ***

What happened??

I already told you that file based processing is a bad idea with many disadvantages.

There is no way to debug this from remote. Since your minimal example does not crash, it would be safe to assume that the problem lies elsewhere.