File: log.1May25.python.wrap.g%2B%2B.4

package info (click to toggle)
lammps 20251210%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 465,808 kB
  • sloc: cpp: 1,031,565; python: 26,771; ansic: 8,808; f90: 7,302; sh: 5,316; perl: 4,171; fortran: 2,442; xml: 1,613; makefile: 1,119; objc: 238; lisp: 188; yacc: 58; csh: 16; awk: 14; tcl: 6; javascript: 2
file content (116 lines) | stat: -rw-r--r-- 4,035 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
LAMMPS (2 Apr 2025 - Development - patch_2Apr2025-270-g2351418c94-modified)
# 3d Lennard-Jones melt with equal- and atom-style variables which
#   use a Python function wrapper in their formulas

variable        x index 3
variable        y index 3
variable        z index 3

units           lj
atom_style      atomic

lattice         fcc 0.8442
Lattice spacing in x,y,z = 1.6795962 1.6795962 1.6795962
region          box block 0 $x 0 $y 0 $z
region          box block 0 3 0 $y 0 $z
region          box block 0 3 0 3 0 $z
region          box block 0 3 0 3 0 3
create_box      1 box
Created orthogonal box = (0 0 0) to (5.0387886 5.0387886 5.0387886)
  1 by 2 by 2 MPI processor grid
create_atoms    1 box
Created 108 atoms
  using lattice units in orthogonal box = (0 0 0) to (5.0387886 5.0387886 5.0387886)
  create_atoms CPU = 0.000 seconds
mass            1 1.0

velocity        all create 1.44 87287 loop geom

pair_style      lj/cut 2.5
pair_coeff      1 1 1.0 1.0 2.5

neighbor        0.3 bin
neigh_modify    delay 0 every 20 check no

fix             1 all nve

# define Python truncate() function

variable        foo python truncate
python          truncate return v_foo input 1 iv_arg format fi here """
def truncate(x):
  return int(x)
"""

# use in equal-style variable

variable        scalar equal py_foo(4.5)
print           "TRUNCATE ${scalar}"
TRUNCATE 4

# use in atom-style variable
# examine dump file to see truncated xyz coords of each atom

variable        xtrunc atom py_foo(x)
variable        ytrunc atom py_foo(y)
variable        ztrunc atom py_foo(z)

dump            1 all custom 100 tmp.dump id x y z v_xtrunc v_ytrunc v_ztrunc

# use in vector-style variable

compute         ke all temp
variable        ke vector c_ke
variable        ketrunc vector py_foo(v_ke)
thermo_style    custom step temp epair v_ketrunc[*6]

run             100
Generated 0 of 0 mixed pair_coeff terms from geometric mixing rule
Neighbor list info ...
  update: every = 20 steps, delay = 0 steps, check = no
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 2.8
  ghost atom cutoff = 2.8
  binsize = 1.4, bins = 4 4 4
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair lj/cut, perpetual
      attributes: half, newton on
      pair build: half/bin/atomonly/newton
      stencil: half/bin/3d
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 2.59 | 2.59 | 2.59 Mbytes
   Step          Temp          E_pair      v_ketrunc[1]   v_ketrunc[2]   v_ketrunc[3]   v_ketrunc[4]   v_ketrunc[5]   v_ketrunc[6] 
         0   1.44          -6.7733681      155            152            154           -10            -4             -6            
       100   0.82217015    -5.8614684      113            65             84             7             -1             -12           
Loop time of 0.00268845 on 4 procs for 100 steps with 108 atoms

Performance: 16068745.964 tau/day, 37196.171 timesteps/s, 4.017 Matom-step/s
66.7% CPU use with 4 MPI tasks x no OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 0.00043389 | 0.00051695 | 0.00061255 |   0.0 | 19.23
Neigh   | 0.00017121 | 0.00018976 | 0.00019891 |   0.0 |  7.06
Comm    | 0.0017423  | 0.0018487  | 0.0019509  |   0.2 | 68.76
Output  | 6.7449e-05 | 6.9998e-05 | 7.5195e-05 |   0.0 |  2.60
Modify  | 2.1329e-05 | 2.2855e-05 | 2.4821e-05 |   0.0 |  0.85
Other   |            | 4.018e-05  |            |       |  1.49

Nlocal:             27 ave          30 max          25 min
Histogram: 1 0 1 0 1 0 0 0 0 1
Nghost:            614 ave         616 max         612 min
Histogram: 1 0 1 0 0 0 0 1 0 1
Neighs:        1017.75 ave        1149 max         894 min
Histogram: 1 1 0 0 0 0 0 1 0 1

Total # of neighbors = 4071
Ave neighs/atom = 37.694444
Neighbor list builds = 5
Dangerous builds not checked

print           "KE TENSOR ${ketrunc}"
KE TENSOR [113,65,84,7,-1,-12]


Total wall time: 0:00:00