Some issues encountered during GCMC simulation

Dear all
Hi, the lammps users .I want to ask you a few questions about gcmc command.
I am simulating the adsorption of CO and H2 on the surface of Fe5C2 using LAMMPS. The system consists of Fe5C2 (504 atoms), one hydrogen molecule (2 atoms), one CO molecule (2 atoms), for a total of 508 atoms. I am using the NN potential developed by the research group of Zhipan Liu at Fudan University. My initial input file is as follows.


# ----- Structure settings -----
boundary	p p p          # 3D box
units       metal       	# do not change!
atom_style	atomic  	    # do not change!
atom_modify map array sort 99999 1.0  # Recommend
read_data       1.data
mass 1 55.845  # Fe
mass 2 12.0107  # C
mass 3 1.00794  # H  gcmc
mass 4 15.9994  # O  gcmc
mass 5 12.0107  # C  gcmc
timestep   0.0001
 # ----- Potential settings -----
pair_style      laspnn 		# do not change!
neighbor        2.0 bin
neigh_modify    every 1 delay 0 check yes # Recommend
# ----- Output setting -----
thermo_style    custom step etotal temp press 
thermo          100
# ----- Relax calculation (0 K) -----
print "----- Relax calculation (0 K) -----"
group           Fe5C2   id 1:504
minimize        1.0e-10 0.0 1000 100000
# ----- reset timestep and dt -----
reset_timestep  0
timestep        0.0001
# ----- GCMC Calculation-----
print "----- GCMC Calculation -----"
region          bottom block INF INF INF INF INF 6   side in units box#Fe5C2 fix
group           bottom region bottom
velocity        bottom set 0 0 0  
fix             1 bottom setforce 0 0 0 
region          mobile1 block INF INF INF INF 6.1 13 side in #Fe5C2 unfix
group           mobile1 region mobile1 #gcmc
region          mobile2 prism 0.0 18.6898 0.0 20.2274256471 6.1 20 -3.1459046475 0.0 0.0 side in #Fe5C2 unfix
group           mobile2 region mobile2 #gcmc

group           FeC type 1:2 # 1=Fe, 2=C
group           H type 3   # 3=H
group           O type 4   # 4=O
group           C type 5   # 5=C
group           gas type 3:5 #gas

fix             f1 mobile2 nvt temp 550 550 0.01
fix_modify      f1 dynamic/dof yes

fix             f2 H nvt temp 550 550 0.01
fix_modify      f2 dynamic/dof yes

fix             f3 O nvt temp 550 550 0.01
fix_modify      f3 dynamic/dof yes

fix             f4 C nvt temp 550 550 0.01
fix_modify      f4 dynamic/dof yes

fix             f5 H gcmc 10 2 2 3 7641 550 -5.46 0.1 pressure 10 region mobile2 group H 
fix             f6 O gcmc 10 1 1 4 6131 550 -5.46 0.1 pressure 10 region mobile2 group O
fix             f7 C gcmc 10 1 1 5 7634 550 -5.46 0.1 pressure 10 region mobile2 group C
# ----- atom count -----
variable        type1 atom "type==1" # Fe
variable        type2 atom "type==2" # C
variable        type3 atom "type==3" # H
variable        type4 atom "type==4" # O
variable        type5 atom "type==5" # C
group           type1 dynamic FeC var type1 # Fe
group           type2 dynamic FeC var type2 # C
group           type3 dynamic gas var type3 # H
group           type4 dynamic gas var type4 # O
group           type5 dynamic gas var type5 # C
variable        na  equal count(type1) # Fe
variable        nb  equal count(type2) # C
variable        nc  equal count(type3) # H
variable        nd  equal count(type4) # O
variable        ne  equal count(type5) # C
compute_modify  thermo_temp dynamic/dof yes
thermo_style    custom step temp press vol atoms v_na v_nb v_nc v_nd v_ne
thermo          100
# ----- Output setting -----
dump 1 all atom 100 dump.atom
run            30000

I have encountered the following problems or things that I don’t quite understand.

1.When I run this input file, it can run to completion, but there are multiple warning messages (WARNING: Library error in lammps_gather_atoms (…/library.cpp:838)) like the one below. I suspect that there may be an issue with normalization of the number of atoms or another issue, but I am not sure how to resolve this warning.

    2700    255.87073   -23885.167    10319.612      504          360          144            0            0            0 
    2800    217.20199   -24588.159    10319.612      504          360          144            0            0            0 
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)
    2900    872.46656   -16494.523    10319.612      508          360          144            1            1            2 

2.When I use parallel computing with 50 cores, the output file stops updating when reaching the line with “fix gcmc” and it keeps running without output.Without other options, I have to run this input file on a single core. I want to know if it is possible to run “fix gcmc” with multiple cores simultaneously.

3.When I change the group in the middle from HOC to gas, the input file looks like this:

$ diff 4/in.laspNN.1 5/in.laspNN.1
diff 4/in.laspNN.1 5/in.laspNN.1
18c18
< thermo_style    custom step etotal temp press
---
> thermo_style    custom step etotal temp press
47c47
< fix             f2 H nvt temp 550 550 0.01
---
> fix             f2 gas nvt temp 550 550 0.01
50,58c50,52
< fix             f3 O nvt temp 550 550 0.01
< fix_modify      f3 dynamic/dof yes
<
< fix             f4 C nvt temp 550 550 0.01
< fix_modify      f4 dynamic/dof yes
<
< fix             f5 H gcmc 10 2 2 3 7641 550 -5.46 0.1 pressure 10 region mobile2 group H
< fix             f6 O gcmc 10 1 1 4 6131 550 -5.46 0.1 pressure 10 region mobile2 group O
< fix             f7 C gcmc 10 1 1 5 7634 550 -5.46 0.1 pressure 10 region mobile2 group C
---
> fix             f5 gas gcmc 10 2 2 3 7641 550 -5.46 0.1 pressure 10 region mobile2 group gas
> fix             f6 gas gcmc 10 1 1 4 6131 550 -5.46 0.1 pressure 10 region mobile2 group gas
> fix             f7 gas gcmc 10 1 1 5 7634 550 -5.46 0.1 pressure 10 region mobile2 group gas

After running two similar input files separately, the corresponding log files for both show a warning similar to “WARNING: Library error in lammps_gather_atoms (…/library.cpp:838)”. After analyzing the dump file using a visualization software, I noticed that when the group is “gas”, the number of gas atoms seems to change slowly. I would like to know the difference in understanding between these two input files.

4.When I added three H2 molecules and seven CO molecules to the original data file, thereby increasing the total number of atoms to 528, the program generated a warning message and stopped executing during the read data process. I suspect that the warning message indicates a lack of memory. Could you tell me if my assumption is correct?

  528 atoms
  read_data CPU = 0.00118855 secs
WARNING: Library error in lammps_gather_atoms (../library.cpp:838)

===================================================================================
=   BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
=   RANK 0 PID 216066 RUNNING AT node69
=   KILLED BY SIGNAL: 11 (Segmentation fault)
===================================================================================


[node69:216066:0:216066] Caught signal 11 (Segmentation fault: address not mapped to object at address 0xffffffffb717fbac)
==== backtrace (tid: 216066) ====
 0 0x0000000000d8c4f0 LAMMPS_NS::PairLASPNN::settings()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
 1 0x00000000011ff41a LAMMPS_NS::Input::pair_style()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
 2 0x00000000011fbbe4 LAMMPS_NS::Input::execute_command()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
 3 0x00000000011fd328 LAMMPS_NS::Input::file()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
 4 0x000000000168f241 main()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
 5 0x00000000000223d5 __libc_start_main()  ???:0
 6 0x0000000000415ce9 _start()  /usr/include/c++/4.4.7/bits/stl_tree.h:1217
=================================
  1. I would like to know if it is still necessary to include the “group” keyword when using the “fix gcmc” command in my input file? Also, how should I understand the “group” keyword when there is already an existing group-ID? Is the “group” keyword necessarily a subset of the group-ID?
    Thank you.

Nothing in the LAMMPS distribution uses this function. So it has to be part of some additional code that you are including that may not be compatible with what you are doing in your simulation.

This is the most likely candidate.

And the stack trace confirms it.

For this you have to contact the developers of this pair style. Likelytheir implementation has one or more bugs or is not compatible with GCMC simulations.

OK, thank you very much for your answer. I am in contact with the Liu Zhipan research team who developed the NN potential function.
Would you mind answering questions 2 (is it possible to run “fix gcmc” with multiple cores simultaneously), 3 (What is the difference when group-ID is gas and CHO respectively), and 5(is it still necessary to include the “group” keyword when using the “fix gcmc” command in my input file?why? )

Fix gcmc can be run in parallel, but it strongly relies of the force computation via pair, bond, angle, dihedral, improper and kspace styles. So any problems there are likely also due to issues with your pair style.

What is required or not is explained in the fix gcmc documentation. This is a complex piece of code, so the documentation is complex, too. It may take some time to figure things out, but that is just as well, since if you have trouble to figure this out, you have likely trouble to do a meaningful GCMC calculation with LAMMPS altogether.