2-FFT PPPM
diff --git a/doc/Section_accelerate.txt b/doc/Section_accelerate.txt
index e4765d8641..a58747342a 100644
--- a/doc/Section_accelerate.txt
+++ b/doc/Section_accelerate.txt
@@ -81,10 +81,11 @@ NOTE: this sub-section is still a work in progress
Here is a list of general ideas for improving simulation performance.
Most of them are only applicable to certain models and certain
bottlenecks in the current performance, so let the timing data you
-intially generate be your guide. It is hard, if not impossible, to
-predict how much difference these options will make, since it is a
-function of your problem and your machine. There is no substitute for
-simply trying them out.
+generate be your guide. It is hard, if not impossible, to predict how
+much difference these options will make, since it is a function of
+problem size, number of processors used, and your machine. There is
+no substitute for identifying performance bottlenecks, and trying out
+various options.
rRESPA
2-FFT PPPM
diff --git a/doc/Section_start.html b/doc/Section_start.html
index e4f42bccac..0321152035 100644
--- a/doc/Section_start.html
+++ b/doc/Section_start.html
@@ -233,16 +233,16 @@ files for doing particle dumps in XTC format. This is only necessary
if your platform does have its own XDR files available. See the
Restrictions section of the dump command for details.
-Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG,
--D-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG.
-These settings refer to use of 4-byte (small) vs 8-byte (big) integers
+
Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG, -D-
+DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG. These
+settings refer to use of 4-byte (small) vs 8-byte (big) integers
within LAMMPS, as specified in src/lmptype.h. The only reason to use
the BIGBIG setting is to enable simulation of huge molecular systems
-with more than 2 billion atoms or to allow moving atoms to wrap back
-through a periodic box more than 512 times. The only reason to use
-the SMALLSMALL setting is if your machine does not support 64-bit
-integers. See the Additional build tips section below
-for more details.
+(which store bond topology info) with more than 2 billion atoms, or to
+track the image flags of moving atoms that wrap around a periodic box
+more than 512 times. The only reason to use the SMALLSMALL setting is
+if your machine does not support 64-bit integers. See the Additional
+build tips section below for more details.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or
MPI version does not recognize "long long" data types. In this case a
@@ -458,48 +458,53 @@ files created when LAMMPS is built, for either all builds or for a
particular machine.
(3) Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or
--DLAMMPS_BIBIG or -DLAMMPS_SMALLSMALL
+-DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
As explained above, any of these 3 settings can be specified on the
LMP_INC line in your low-level src/MAKE/Makefile.foo.
The default is -DLAMMPS_SMALLBIG which allows for systems with up to
-2^63 atoms and timesteps (about 9 billion billion). The atom limit is
-for atomic systems that do not require atom IDs. For molecular
-models, which require atom IDs, the limit is 2^31 atoms (about 2
-billion). With this setting, image flags are stored in 32-bit
-integers, which means for 3 dimensions that atoms can only wrap around
-a periodic box at most 512 times. If atoms move through the periodic
-box more than this limit, the image flags will "roll over", e.g. from
-511 to -512, which can cause diagnostics like the mean-squared
-displacement, as calculated by the compute msd
-command, to be faulty.
+2^63 atoms and 2^63 timesteps (about 9e18). The atom limit is for
+atomic systems which do not store bond topology info and thus do not
+require atom IDs. If you use atom IDs for atomic systems (which is
+the default) or if you use a molecular model, which stores bond
+topology info and thus requires atom IDs, the limit is 2^31 atoms
+(about 2 billion). This is because the IDs are stored in 32-bit
+integers.
-To allow for larger molecular systems or larger image flags, compile
-with -DLAMMPS_BIGBIG. This enables molecular systems with up to 2^63
-atoms (about 9 billion billion). And image flags will not "roll over"
-until they reach 2^20 = 1048576.
+
Likewise, with this setting, the 3 image flags for each atom (see the
+dump doc page for a discussion) are stored in a 32-bit
+integer, which means the atoms can only wrap around a periodic box (in
+each dimension) at most 512 times. If atoms move through the periodic
+box more than this many times, the image flags will "roll over",
+e.g. from 511 to -512, which can cause diagnostics like the
+mean-squared displacement, as calculated by the compute
+msd command, to be faulty.
-IMPORTANT NOTE: As of 6/2012, the BIGBIG setting does not yet enable
-molecular systems to grow as large as 2^63. Only the image flag roll
-over is currently affected by this compile option.
+
To allow for larger atomic systems with atom IDs or larger molecular
+systems or larger image flags, compile with -DLAMMPS_BIGBIG. This
+stores atom IDs and image flags in 64-bit integers. This enables
+atomic or molecular systems with atom IDS of up to 2^63 atoms (about
+9e18). And image flags will not "roll over" until they reach 2^20 =
+1048576.
If your system does not support 8-byte integers, you will need to
-compile with the -DLAMMPS_SMALLSMALL setting. This will restrict your
-total number of atoms (for atomic or molecular models) and timesteps
+compile with the -DLAMMPS_SMALLSMALL setting. This will restrict the
+total number of atoms (for atomic or molecular systems) and timesteps
to 2^31 (about 2 billion). Image flags will roll over at 2^9 = 512.
-Note that in src/lmptype.h there are also settings for the MPI data
-types associated with the integers that store atom IDs and total
-system sizes. These need to be consistent with the associated C data
-types, or else LAMMPS will generate a run-time error.
+
Note that in src/lmptype.h there are definitions of all these data
+types as well as the MPI data types associated with them. The MPI
+types need to be consistent with the associated C data types, or else
+LAMMPS will generate a run-time error. As far as we know, the
+settings defined in src/lmptype.h are portable and work on every
+current system.
-In all cases, the size of problem that can be run on a per-processor
-basis is limited by 4-byte integer storage to 2^31 atoms per processor
-(about 2 billion). This should not normally be a restriction since
-such a problem would have a huge per-processor memory footprint due to
-neighbor lists and would run very slowly in terms of CPU
-secs/timestep.
+
In all cases, the size of problem that can be run on a per-processor
+basis is limited by 4-byte integer storage to 2^31 atoms per processor
+(about 2 billion). This should not normally be a limitation since such
+a problem would have a huge per-processor memory footprint due to
+neighbor lists and would run very slowly in terms of CPU secs/timestep.
diff --git a/doc/Section_start.txt b/doc/Section_start.txt
index b11648ffe3..8f1b624fcd 100644
--- a/doc/Section_start.txt
+++ b/doc/Section_start.txt
@@ -227,16 +227,16 @@ files for doing particle dumps in XTC format. This is only necessary
if your platform does have its own XDR files available. See the
Restrictions section of the "dump"_dump.html command for details.
-Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG,
--D-DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG.
-These settings refer to use of 4-byte (small) vs 8-byte (big) integers
+Use at most one of the -DLAMMPS_SMALLBIG, -DLAMMPS_BIGBIG, -D-
+DLAMMPS_SMALLSMALL settings. The default is -DLAMMPS_SMALLBIG. These
+settings refer to use of 4-byte (small) vs 8-byte (big) integers
within LAMMPS, as specified in src/lmptype.h. The only reason to use
the BIGBIG setting is to enable simulation of huge molecular systems
-with more than 2 billion atoms or to allow moving atoms to wrap back
-through a periodic box more than 512 times. The only reason to use
-the SMALLSMALL setting is if your machine does not support 64-bit
-integers. See the "Additional build tips"_#start_2_4 section below
-for more details.
+(which store bond topology info) with more than 2 billion atoms, or to
+track the image flags of moving atoms that wrap around a periodic box
+more than 512 times. The only reason to use the SMALLSMALL setting is
+if your machine does not support 64-bit integers. See the "Additional
+build tips"_#start_2_4 section below for more details.
The -DLAMMPS_LONGLONG_TO_LONG setting may be needed if your system or
MPI version does not recognize "long long" data types. In this case a
@@ -452,48 +452,53 @@ files created when LAMMPS is built, for either all builds or for a
particular machine.
(3) Changing the LAMMPS size limits via -DLAMMPS_SMALLBIG or
--DLAMMPS_BIBIG or -DLAMMPS_SMALLSMALL
+-DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL
As explained above, any of these 3 settings can be specified on the
LMP_INC line in your low-level src/MAKE/Makefile.foo.
The default is -DLAMMPS_SMALLBIG which allows for systems with up to
-2^63 atoms and timesteps (about 9 billion billion). The atom limit is
-for atomic systems that do not require atom IDs. For molecular
-models, which require atom IDs, the limit is 2^31 atoms (about 2
-billion). With this setting, image flags are stored in 32-bit
-integers, which means for 3 dimensions that atoms can only wrap around
-a periodic box at most 512 times. If atoms move through the periodic
-box more than this limit, the image flags will "roll over", e.g. from
-511 to -512, which can cause diagnostics like the mean-squared
-displacement, as calculated by the "compute msd"_compute_msd.html
-command, to be faulty.
+2^63 atoms and 2^63 timesteps (about 9e18). The atom limit is for
+atomic systems which do not store bond topology info and thus do not
+require atom IDs. If you use atom IDs for atomic systems (which is
+the default) or if you use a molecular model, which stores bond
+topology info and thus requires atom IDs, the limit is 2^31 atoms
+(about 2 billion). This is because the IDs are stored in 32-bit
+integers.
-To allow for larger molecular systems or larger image flags, compile
-with -DLAMMPS_BIGBIG. This enables molecular systems with up to 2^63
-atoms (about 9 billion billion). And image flags will not "roll over"
-until they reach 2^20 = 1048576.
+Likewise, with this setting, the 3 image flags for each atom (see the
+"dump"_dump.html doc page for a discussion) are stored in a 32-bit
+integer, which means the atoms can only wrap around a periodic box (in
+each dimension) at most 512 times. If atoms move through the periodic
+box more than this many times, the image flags will "roll over",
+e.g. from 511 to -512, which can cause diagnostics like the
+mean-squared displacement, as calculated by the "compute
+msd"_compute_msd.html command, to be faulty.
-IMPORTANT NOTE: As of 6/2012, the BIGBIG setting does not yet enable
-molecular systems to grow as large as 2^63. Only the image flag roll
-over is currently affected by this compile option.
+To allow for larger atomic systems with atom IDs or larger molecular
+systems or larger image flags, compile with -DLAMMPS_BIGBIG. This
+stores atom IDs and image flags in 64-bit integers. This enables
+atomic or molecular systems with atom IDS of up to 2^63 atoms (about
+9e18). And image flags will not "roll over" until they reach 2^20 =
+1048576.
If your system does not support 8-byte integers, you will need to
-compile with the -DLAMMPS_SMALLSMALL setting. This will restrict your
-total number of atoms (for atomic or molecular models) and timesteps
+compile with the -DLAMMPS_SMALLSMALL setting. This will restrict the
+total number of atoms (for atomic or molecular systems) and timesteps
to 2^31 (about 2 billion). Image flags will roll over at 2^9 = 512.
-Note that in src/lmptype.h there are also settings for the MPI data
-types associated with the integers that store atom IDs and total
-system sizes. These need to be consistent with the associated C data
-types, or else LAMMPS will generate a run-time error.
+Note that in src/lmptype.h there are definitions of all these data
+types as well as the MPI data types associated with them. The MPI
+types need to be consistent with the associated C data types, or else
+LAMMPS will generate a run-time error. As far as we know, the
+settings defined in src/lmptype.h are portable and work on every
+current system.
-In all cases, the size of problem that can be run on a per-processor
-basis is limited by 4-byte integer storage to 2^31 atoms per processor
-(about 2 billion). This should not normally be a restriction since
-such a problem would have a huge per-processor memory footprint due to
-neighbor lists and would run very slowly in terms of CPU
-secs/timestep.
+In all cases, the size of problem that can be run on a per-processor
+basis is limited by 4-byte integer storage to 2^31 atoms per processor
+(about 2 billion). This should not normally be a limitation since such
+a problem would have a huge per-processor memory footprint due to
+neighbor lists and would run very slowly in terms of CPU secs/timestep.
:line
diff --git a/doc/atom_modify.html b/doc/atom_modify.html
index 2eaa729fbe..4a15940e75 100644
--- a/doc/atom_modify.html
+++ b/doc/atom_modify.html
@@ -1,5 +1,6 @@
-LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Commands
+LAMMPS WWW Site - LAMMPS Documentation - LAMMPS
+Commands
@@ -17,13 +18,14 @@
@@ -35,19 +37,58 @@ atom_modify first colloid
Description:
-Modify properties of the atom style selected within LAMMPS.
+
Modify certain attributes of atoms defined and stored within LAMMPS,
+in addition to what is specified by the atom_style
+command. The id and map keywords must be specified before a
+simulation box is defined; other keywords can be specified any time.
+
+The id keyword determines whether non-zero atom IDs can be assigned
+to each atom. If the value is yes, which is the default, IDs are
+assigned, whether you use the create atoms or
+read_data or read_restart
+commands to initialize atoms. If atom IDs are used, they must all be
+positive integers. They should also be unique, though LAMMPS does not
+check for this. Typically they should also be consecutively numbered
+(from 1 to Natoms), though this is not required. Molecular atom
+styles are those that store bond topology information
+(styles bond, angle, molecular, full). These styles require atom IDs
+since the IDs are used to encode the topology. Some other LAMMPS
+commands also require the use of atom IDs. E.g. some many-body pair
+styles use them to avoid double computation of the I-J interaction
+between two atoms.
+
+The only reason not to use atom IDs is if you are running an atomic
+simulation so large that IDs cannot be uniquely assigned. For a
+default LAMMPS build this limit is 2^31 or about 2 billion atoms.
+However, even in this case, you can use 64-bit atom IDs, allowing 2^63
+or about 9e18 atoms, if you build LAMMPS with the - DLAMMPS_BIGBIG
+switch. This is described in Section 2.2
+of the manual. If atom IDs are not used, they must be specified as 0
+for all atoms, e.g. in a data or restart file.
The map keyword determines how atom ID lookup is done for molecular
-problems. Lookups are performed by bond (angle, etc) routines in
+atom styles. Lookups are performed by bond (angle, etc) routines in
LAMMPS to find the local atom index associated with a global atom ID.
-When the array value is used, each processor stores a lookup table
-of length N, where N is the total # of atoms in the system. This is
-the fastest method for most simulations, but a processor can run out
-of memory to store the table for very large simulations. The hash
-value uses a hash table to perform the lookups. This method can be
-slightly slower than the array method, but its memory cost is
-proportional to N/P on each processor, where P is the total number of
-processors running the simulation.
+
+When the array value is used, each processor stores a lookup table
+of length N, where N is the largest atom ID in the system. This is a
+fast, simple method for many simulations, but requires too much memory
+for large simulations. The hash value uses a hash table to perform
+the lookups. This can be slightly slower than the array method, but
+its memory cost is proportional to the number of atoms owned by a
+processor, i.e. N/P when N is the total number of atoms in the system
+and P is the number of processors.
+
+When this setting is not specified in your input script, LAMMPS
+creates a map, if one is needed, as an array or hash. See the
+discussion of default values below for how LAMMPS chooses which kind
+of map to build. Note that atomic systems do not normally need to
+create a map. However, even in this case some LAMMPS commands will
+create a map to find atoms (and then destroy it), or require a
+permanent map. An example of the former is the velocity loop
+all command, which uses a map when looping over all
+atoms and insuring the same velocity values are assigned to an atom
+ID, no matter which processor owns it.
The first keyword allows a group to be specified whose
atoms will be maintained as the first atoms in each processor's list
@@ -111,10 +152,6 @@ if sorting is enabled.
Restrictions:
-The map keyword can only be used before the simulation box is defined
-by a read_data or create_box
-command.
-
The first and sort options cannot be used together. Since sorting
is on by default, it will be turned off if the first keyword is
used with a group-ID that is not "all".
@@ -123,10 +160,12 @@ used with a group-ID that is not "all".
Default:
-By default, atomic (non-molecular) problems do not allocate maps. For
-molecular problems, the option default is map = array. By default, a
-"first" group is not defined. By default, sorting is enabled with a
-frequency of 1000 and a binsize of 0.0, which means the neighbor
+
By default, id is yes. By default, atomic systems (no bond topology
+info) do not use a map. For molecular systems (with bond topology
+info), a map is used. The default map style is array if no atom ID is
+larger than 1 million, otherwise the default is hash. By default, a
+"first" group is not defined. By default, sorting is enabled with a
+frequency of 1000 and a binsize of 0.0, which means the neighbor
cutoff will be used to set the bin size.
diff --git a/doc/atom_modify.txt b/doc/atom_modify.txt
index b3992bb419..e738ba4275 100644
--- a/doc/atom_modify.txt
+++ b/doc/atom_modify.txt
@@ -1,4 +1,5 @@
-"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c
+"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS
+Commands"_lc :c
:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
@@ -13,12 +14,13 @@ atom_modify command :h3
atom_modify keyword values ... :pre
one or more keyword/value pairs may be appended :ulb,l
-keyword = {map} or {first} or {sort} :l
- {map} value = {array} or {hash}
- {first} value = group-ID = group whose atoms will appear first in internal atom lists
- {sort} values = Nfreq binsize
- Nfreq = sort atoms spatially every this many time steps
- binsize = bin size for spatial sorting (distance units) :pre
+keyword = {id} or {map} or {first} or {sort} :l
+ {id} value = {yes} or {no}
+ {map} value = {array} or {hash}
+ {first} value = group-ID = group whose atoms will appear first in internal atom lists
+ {sort} values = Nfreq binsize
+ Nfreq = sort atoms spatially every this many time steps
+ binsize = bin size for spatial sorting (distance units) :pre
:ule
[Examples:]
@@ -29,19 +31,58 @@ atom_modify first colloid :pre
[Description:]
-Modify properties of the atom style selected within LAMMPS.
+Modify certain attributes of atoms defined and stored within LAMMPS,
+in addition to what is specified by the "atom_style"_atom_style.html
+command. The {id} and {map} keywords must be specified before a
+simulation box is defined; other keywords can be specified any time.
+
+The {id} keyword determines whether non-zero atom IDs can be assigned
+to each atom. If the value is {yes}, which is the default, IDs are
+assigned, whether you use the "create atoms"_create_atoms.html or
+"read_data"_read_data.html or "read_restart"_read_restart.html
+commands to initialize atoms. If atom IDs are used, they must all be
+positive integers. They should also be unique, though LAMMPS does not
+check for this. Typically they should also be consecutively numbered
+(from 1 to Natoms), though this is not required. Molecular "atom
+styles"_atom_style.html are those that store bond topology information
+(styles bond, angle, molecular, full). These styles require atom IDs
+since the IDs are used to encode the topology. Some other LAMMPS
+commands also require the use of atom IDs. E.g. some many-body pair
+styles use them to avoid double computation of the I-J interaction
+between two atoms.
+
+The only reason not to use atom IDs is if you are running an atomic
+simulation so large that IDs cannot be uniquely assigned. For a
+default LAMMPS build this limit is 2^31 or about 2 billion atoms.
+However, even in this case, you can use 64-bit atom IDs, allowing 2^63
+or about 9e18 atoms, if you build LAMMPS with the - DLAMMPS_BIGBIG
+switch. This is described in "Section 2.2"_Section_start.html#start_2
+of the manual. If atom IDs are not used, they must be specified as 0
+for all atoms, e.g. in a data or restart file.
The {map} keyword determines how atom ID lookup is done for molecular
-problems. Lookups are performed by bond (angle, etc) routines in
+atom styles. Lookups are performed by bond (angle, etc) routines in
LAMMPS to find the local atom index associated with a global atom ID.
+
When the {array} value is used, each processor stores a lookup table
-of length N, where N is the total # of atoms in the system. This is
-the fastest method for most simulations, but a processor can run out
-of memory to store the table for very large simulations. The {hash}
-value uses a hash table to perform the lookups. This method can be
-slightly slower than the {array} method, but its memory cost is
-proportional to N/P on each processor, where P is the total number of
-processors running the simulation.
+of length N, where N is the largest atom ID in the system. This is a
+fast, simple method for many simulations, but requires too much memory
+for large simulations. The {hash} value uses a hash table to perform
+the lookups. This can be slightly slower than the {array} method, but
+its memory cost is proportional to the number of atoms owned by a
+processor, i.e. N/P when N is the total number of atoms in the system
+and P is the number of processors.
+
+When this setting is not specified in your input script, LAMMPS
+creates a map, if one is needed, as an array or hash. See the
+discussion of default values below for how LAMMPS chooses which kind
+of map to build. Note that atomic systems do not normally need to
+create a map. However, even in this case some LAMMPS commands will
+create a map to find atoms (and then destroy it), or require a
+permanent map. An example of the former is the "velocity loop
+all"_velocity.html command, which uses a map when looping over all
+atoms and insuring the same velocity values are assigned to an atom
+ID, no matter which processor owns it.
The {first} keyword allows a "group"_group.html to be specified whose
atoms will be maintained as the first atoms in each processor's list
@@ -105,10 +146,6 @@ if sorting is enabled.
[Restrictions:]
-The map keyword can only be used before the simulation box is defined
-by a "read_data"_read_data.html or "create_box"_create_box.html
-command.
-
The {first} and {sort} options cannot be used together. Since sorting
is on by default, it will be turned off if the {first} keyword is
used with a group-ID that is not "all".
@@ -117,10 +154,12 @@ used with a group-ID that is not "all".
[Default:]
-By default, atomic (non-molecular) problems do not allocate maps. For
-molecular problems, the option default is map = array. By default, a
-"first" group is not defined. By default, sorting is enabled with a
-frequency of 1000 and a binsize of 0.0, which means the neighbor
+By default, {id} is yes. By default, atomic systems (no bond topology
+info) do not use a map. For molecular systems (with bond topology
+info), a map is used. The default map style is array if no atom ID is
+larger than 1 million, otherwise the default is hash. By default, a
+"first" group is not defined. By default, sorting is enabled with a
+frequency of 1000 and a binsize of 0.0, which means the neighbor
cutoff will be used to set the bin size.
:line
diff --git a/python/examples/in.simple b/python/examples/in.simple
index 5f6ebdc4f2..3dc80bdfea 100644
--- a/python/examples/in.simple
+++ b/python/examples/in.simple
@@ -20,4 +20,6 @@ neigh_modify delay 0 every 20 check no
fix 1 all nve
+variable fx atom fx
+
run 10
diff --git a/python/examples/simple.py b/python/examples/simple.py
index 5a6157f87c..168ec94aa9 100755
--- a/python/examples/simple.py
+++ b/python/examples/simple.py
@@ -45,6 +45,12 @@ x[0] += epsilon
lmp.scatter_atoms("x",1,3,x)
lmp.command("run 1");
+f = lmp.extract_atom("f",3)
+print "Force on 1 atom via extract_atom: ",f[0][0]
+
+fx = lmp.extract_variable("fx","all",1)
+print "Force on 1 atom via extract_variable:",fx[0]
+
# uncomment if running in parallel via Pypar
#print "Proc %d out of %d procs has" % (me,nprocs), lmp
#pypar.finalize()
diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp
index aab7f3cd86..e4f58e0560 100644
--- a/src/CLASS2/dihedral_class2.cpp
+++ b/src/CLASS2/dihedral_class2.cpp
@@ -205,7 +205,9 @@ void DihedralClass2::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp
index 628a106300..b4ccd77e77 100644
--- a/src/CLASS2/improper_class2.cpp
+++ b/src/CLASS2/improper_class2.cpp
@@ -156,8 +156,9 @@ void ImproperClass2::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,
- "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp
index 59d8b5e8eb..08067d567d 100644
--- a/src/DIPOLE/atom_vec_dipole.cpp
+++ b/src/DIPOLE/atom_vec_dipole.cpp
@@ -512,7 +512,7 @@ void AtomVecDipole::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -541,7 +541,7 @@ void AtomVecDipole::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -625,7 +625,7 @@ int AtomVecDipole::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -716,7 +716,7 @@ int AtomVecDipole::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -781,10 +781,7 @@ void AtomVecDipole::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -872,9 +869,10 @@ int AtomVecDipole::pack_data_hybrid(int i, double *buf)
void AtomVecDipole::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
+ fprintf(fp,TAGINT_FORMAT \
+ " %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
"%-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4],
buf[i][5],buf[i][6],buf[i][7],buf[i][8],
(int) ubuf(buf[i][9]).i,(int) ubuf(buf[i][10]).i,
diff --git a/src/DIPOLE/atom_vec_dipole.h b/src/DIPOLE/atom_vec_dipole.h
index 1aec00580c..216cca5123 100644
--- a/src/DIPOLE/atom_vec_dipole.h
+++ b/src/DIPOLE/atom_vec_dipole.h
@@ -59,7 +59,8 @@ class AtomVecDipole : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *q,**mu,**omega,**torque;
diff --git a/src/FLD/pair_lubricateU.cpp b/src/FLD/pair_lubricateU.cpp
index 40761fcea1..146b033aa8 100644
--- a/src/FLD/pair_lubricateU.cpp
+++ b/src/FLD/pair_lubricateU.cpp
@@ -40,7 +40,6 @@
#include "memory.h"
#include "error.h"
-
using namespace LAMMPS_NS;
using namespace MathConst;
diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp
index 829a0b2dff..776bdd0b64 100644
--- a/src/GPU/fix_gpu.cpp
+++ b/src/GPU/fix_gpu.cpp
@@ -11,6 +11,10 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG is not yet supported by the GPU package
+#endif
+
#include "string.h"
#include "stdlib.h"
#include "fix_gpu.h"
diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp
index 562edd42c2..9a439d87d6 100644
--- a/src/GRANULAR/fix_pour.cpp
+++ b/src/GRANULAR/fix_pour.cpp
@@ -630,12 +630,16 @@ void FixPour::pre_exchange()
if (ninserted_atoms) {
atom->natoms += ninserted_atoms;
+ if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
+ error->all(FLERR,"Too many total atoms");
if (mode == MOLECULE) {
atom->nbonds += onemol->nbonds * ninserted_mols;
atom->nangles += onemol->nangles * ninserted_mols;
atom->ndihedrals += onemol->ndihedrals * ninserted_mols;
atom->nimpropers += onemol->nimpropers * ninserted_mols;
}
+ if (maxtag_all >= MAXTAGINT)
+ error->all(FLERR,"New atom IDs exceed maximum allowed ID");
if (atom->map_style) {
atom->nghost = 0;
atom->map_init();
@@ -661,13 +665,13 @@ void FixPour::pre_exchange()
void FixPour::find_maxid()
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *molecule = atom->molecule;
int nlocal = atom->nlocal;
- int max = 0;
+ tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
- MPI_Allreduce(&max,&maxtag_all,1,MPI_INT,MPI_MAX,world);
+ MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (mode == MOLECULE && molecule) {
max = 0;
diff --git a/src/GRANULAR/fix_pour.h b/src/GRANULAR/fix_pour.h
index c258315e2b..7f613c2b17 100644
--- a/src/GRANULAR/fix_pour.h
+++ b/src/GRANULAR/fix_pour.h
@@ -62,7 +62,8 @@ class FixPour : public Fix {
int *recvcounts,*displs;
int nfreq,nfirst,ninserted,nper;
double lo_current,hi_current;
- int maxtag_all,maxmol_all;
+ tagint maxtag_all;
+ int maxmol_all;
class RanPark *random,*random2;
void find_maxid();
diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp
index a6881c86f5..05aa14e2c6 100644
--- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp
+++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp
@@ -117,6 +117,7 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
@@ -144,8 +145,8 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -214,8 +215,8 @@ void PairLJCutTIP4PLong::compute(int eflag, int vflag)
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp
index 31623fc732..04723a27a1 100644
--- a/src/KSPACE/pair_lj_long_tip4p_long.cpp
+++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp
@@ -116,6 +116,7 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
@@ -144,8 +145,8 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
itype = type[i];
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -253,8 +254,8 @@ void PairLJLongTIP4PLong::compute(int eflag, int vflag)
if (itype == typeO || jtype == typeO) {
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -499,6 +500,7 @@ void PairLJLongTIP4PLong::compute_inner()
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
@@ -526,8 +528,8 @@ void PairLJLongTIP4PLong::compute_inner()
itype = type[i];
if (itype == typeO && order1) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -594,8 +596,8 @@ void PairLJLongTIP4PLong::compute_inner()
if (itype == typeO || jtype == typeO) {
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -749,6 +751,7 @@ void PairLJLongTIP4PLong::compute_middle()
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
@@ -777,8 +780,8 @@ void PairLJLongTIP4PLong::compute_middle()
itype = type[i];
if (itype == typeO && order1) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -849,8 +852,8 @@ void PairLJLongTIP4PLong::compute_middle()
if (itype == typeO || jtype == typeO) {
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -1017,6 +1020,7 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
double *special_lj = force->special_lj;
@@ -1053,8 +1057,8 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
itype = type[i];
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -1174,8 +1178,8 @@ void PairLJLongTIP4PLong::compute_outer(int eflag, int vflag)
if (itype == typeO || jtype == typeO) {
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp
index b6b6ef0034..c08b422229 100644
--- a/src/KSPACE/pair_tip4p_long.cpp
+++ b/src/KSPACE/pair_tip4p_long.cpp
@@ -115,6 +115,7 @@ void PairTIP4PLong::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
int newton_pair = force->newton_pair;
@@ -141,8 +142,8 @@ void PairTIP4PLong::compute(int eflag, int vflag)
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -185,8 +186,8 @@ void PairTIP4PLong::compute(int eflag, int vflag)
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp
index f6555063dc..be96881bc5 100644
--- a/src/MANYBODY/pair_airebo.cpp
+++ b/src/MANYBODY/pair_airebo.cpp
@@ -391,7 +391,8 @@ void PairAIREBO::REBO_neigh()
void PairAIREBO::FREBO(int eflag, int vflag)
{
- int i,j,k,m,ii,inum,itype,jtype,itag,jtag;
+ int i,j,k,m,ii,inum,itype,jtype;
+ tagint itag,jtag;
double delx,dely,delz,evdwl,fpair,xtmp,ytmp,ztmp;
double rsq,rij,wij;
double Qij,Aij,alphaij,VR,pre,dVRdi,VA,term,bij,dVAdi,dVA;
@@ -403,7 +404,7 @@ void PairAIREBO::FREBO(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
@@ -489,9 +490,10 @@ void PairAIREBO::FREBO(int eflag, int vflag)
void PairAIREBO::FLJ(int eflag, int vflag)
{
- int i,j,k,m,ii,jj,kk,mm,inum,jnum,itype,jtype,ktype,mtype,itag,jtag;
+ int i,j,k,m,ii,jj,kk,mm,inum,jnum,itype,jtype,ktype,mtype;
int atomi,atomj,atomk,atomm;
int testpath,npath,done;
+ tagint itag,jtag;
double evdwl,fpair,xtmp,ytmp,ztmp;
double rsq,best,wik,wkm,cij,rij,dwij,dwik,dwkj,dwkm,dwmj;
double delij[3],rijsq,delik[3],rik,deljk[3];
@@ -520,7 +522,7 @@ void PairAIREBO::FLJ(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
@@ -855,7 +857,8 @@ void PairAIREBO::FLJ(int eflag, int vflag)
void PairAIREBO::TORSION(int eflag, int vflag)
{
- int i,j,k,l,ii,inum,itag,jtag;
+ int i,j,k,l,ii,inum;
+ tagint itag,jtag;
double evdwl,fpair,xtmp,ytmp,ztmp;
double cos321;
double w21,dw21,cos234,w34,dw34;
@@ -880,7 +883,7 @@ void PairAIREBO::TORSION(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
inum = list->inum;
ilist = list->ilist;
diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp
index 2f72fc8be0..e9b41c2375 100644
--- a/src/MANYBODY/pair_bop.cpp
+++ b/src/MANYBODY/pair_bop.cpp
@@ -274,7 +274,8 @@ void PairBOP::compute(int eflag, int vflag)
int ago,delay,every;
int i,j,ii,jj,iij;
int n,inum,temp_ij,ks;
- int itype,jtype,i_tag,j_tag;
+ int itype,jtype;
+ tagint i_tag,j_tag;
int *ilist,*iilist,*numneigh;
int **firstneigh;
double dpr1,ps;
@@ -288,7 +289,7 @@ void PairBOP::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
int nlocal = atom->nlocal;
int nall = nlocal + atom->nghost;
@@ -846,7 +847,7 @@ void PairBOP::sigmaBo()
int n,i,j,k,kp,m,pp,kkp;
int iij,ji,ki;
int itmp,jtmp,ktmp,ltmp,mtmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int ngi,ngj,ngk,nglkp,ngli,nglj,ngl;
int ngji,ngjk,nikj,ngki,ngkj,ngjkp;
int ngkpk,ngkpj,ngkkp,nglk;
@@ -890,7 +891,7 @@ void PairBOP::sigmaBo()
double ftmp[3];
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
int *type = atom->type;
@@ -2401,7 +2402,7 @@ void PairBOP::sigmaBo_noa()
int n,i,j,k,kp,m,pp;
int iij,ji,ki;
int itmp,jtmp,ktmp,ltmp,mtmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int ngi,ngj,ngk,ngli,nglj,ngl;
int ngji,ngjk,nikj,ngki,ngkj;
int njik,nijk,nikkp,nkp,nijkp;
@@ -2437,7 +2438,7 @@ void PairBOP::sigmaBo_noa()
double ftmp[3];
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
int *type = atom->type;
@@ -3379,7 +3380,7 @@ void PairBOP::sigmaBo_otf()
int nb_t,new_n_tot;
int n,i,j,k,kp,m,pp,kpj,kpk,kkp;
int itmp,jtmp,ktmp,ltmp,mtmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int kp1,kp2,kp1type;
int iij,iik,ijk,ikkp,ji,iikp,ijkp;
int nkp;
@@ -3448,7 +3449,7 @@ void PairBOP::sigmaBo_otf()
double ftmp[3],xtmp[3];
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
int *type = atom->type;
@@ -5303,7 +5304,7 @@ void PairBOP::sigmaBo_noa_otf()
int nb_t,new_n_tot;
int n,i,j,k,kp,m,pp;
int itmp,jtmp,ktmp,ltmp,mtmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int kp1,kp2,kp1type;
int iij,iik,ijk,ikkp,ji,iikp,ijkp;
int nkp;
@@ -5368,7 +5369,7 @@ void PairBOP::sigmaBo_noa_otf()
double ftmp[3],xtmp[3];
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
int *type = atom->type;
@@ -6541,7 +6542,7 @@ void PairBOP::PiBo()
int i,j,k,kp,m,n,pp,nb_t;
int iij,ji,ki;
int nsearch,ncmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int njik,ngj,ngk,nglj,ngl,ngi;
int nkjkp,nijkp,ngli,nkikp,njikp;
int itmp,ltmp,jtmp,ktmp;
@@ -6570,7 +6571,7 @@ void PairBOP::PiBo()
double **f = atom->f;
double **x = atom->x;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_pair = force->newton_pair;
nlocal = atom->nlocal;
@@ -7265,7 +7266,7 @@ void PairBOP::PiBo_otf()
int i,j,k,kp,m,n,pp,nb_t;
int iij,iik,iikp,ji,ki,ijkp,ijk;
int nsearch,ncmp;
- int i_tag,j_tag;
+ tagint i_tag,j_tag;
int itmp,ltmp,jtmp,ktmp;
int pi_flag,ks;
int nlocal;
@@ -7317,7 +7318,7 @@ void PairBOP::PiBo_otf()
double **f = atom->f;
double **x = atom->x;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
nlocal = atom->nlocal;
numneigh = list->numneigh;
diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp
index 02096c0002..7c18ccd3fc 100644
--- a/src/MANYBODY/pair_comb.cpp
+++ b/src/MANYBODY/pair_comb.cpp
@@ -125,7 +125,8 @@ PairComb::~PairComb()
void PairComb::compute(int eflag, int vflag)
{
int i,j,k,ii,jj,kk,inum,jnum,iparam_i;
- int itag,jtag,itype,jtype,ktype,iparam_ij,iparam_ijk;
+ int itype,jtype,ktype,iparam_ij,iparam_ijk;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fi[3],fj[3],fk[3];
@@ -151,7 +152,7 @@ void PairComb::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
double *q = atom->q;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
@@ -1630,8 +1631,9 @@ void PairComb::field(Param *param, double rsq, double iq,double jq,
double PairComb::yasu_char(double *qf_fix, int &igroup)
{
- int i,j,ii,jj,jnum,itag,jtag;
+ int i,j,ii,jj,jnum;
int itype,jtype,iparam_i,iparam_ij;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp;
double rsq1,delr1[3];
int *ilist,*jlist,*numneigh,**firstneigh;
@@ -1643,7 +1645,7 @@ double PairComb::yasu_char(double *qf_fix, int &igroup)
double **x = atom->x;
double *q = atom->q;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int inum = list->inum;
ilist = list->ilist;
diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp
index afc0adf021..2d6bf9f9ef 100644
--- a/src/MANYBODY/pair_comb3.cpp
+++ b/src/MANYBODY/pair_comb3.cpp
@@ -860,12 +860,11 @@ void PairComb3::Short_neigh()
int n,nj,*neighptrj,icontrol;
int iparam_ij,iparam_ji,iparam_jk,*ilist,*jlist,*numneigh,**firstneigh;
int inum,jnum,i,j,k,l,ii,jj,kk,ll,itype,jtype,ktype,ltype;
- int itag, jtag;
+ tagint itag,jtag;
double rr1,rr2,rsq1,rsq2,delrj[3],delrk[3];
int sht_knum,*sht_klist;
double **x = atom->x;
- int *tag = atom->tag;
int *type = atom->type;
int ntype = atom->ntypes;
int nlocal = atom->nlocal;
@@ -896,7 +895,6 @@ void PairComb3::Short_neigh()
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
- itag = tag[i];
dpl[i][0] = dpl[i][1] = dpl[i][2] = 0.0;
nj = 0;
@@ -913,7 +911,6 @@ void PairComb3::Short_neigh()
for (jj = 0; jj < jnum; jj++) {
j = jlist[jj];
- jtag = tag[j];
delrj[0] = x[i][0] - x[j][0];
delrj[1] = x[i][1] - x[j][1];
@@ -957,12 +954,13 @@ void PairComb3::Short_neigh()
void PairComb3::compute(int eflag, int vflag)
{
- int i,ii,k,kk,j,jj,im,inum,jnum,itag,jtag,itype,jtype,ktype;
+ int i,ii,k,kk,j,jj,im,inum,jnum,itype,jtype,ktype;
int iparam_i,iparam_ij,iparam_ji;
int iparam_ijk,iparam_jik,iparam_ikj,iparam_jli,iparam_jki,iparam_ikl;
int sht_jnum,*sht_jlist,sht_lnum,*sht_llist;
int sht_mnum,*sht_mlist,sht_pnum,*sht_plist;
int *ilist,*jlist,*numneigh,**firstneigh,mr1,mr2,mr3,inty,nj;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,ecoul,fpair;
double rr,rsq,rsq1,rsq2,rsq3,iq,jq,yaself;
double fqi,fqij,eng_tmp,vionij,fvionij,sr1,sr2,sr3;
@@ -975,7 +973,7 @@ void PairComb3::compute(int eflag, int vflag)
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
int ntype = atom->ntypes;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
double **x = atom->x;
double **f = atom->f;
@@ -1833,11 +1831,12 @@ void PairComb3::force_zeta(Param *parami, Param *paramj, double rsq,
double boij, dbij1, dbij2, dbij3, dbij4, dbij5;
double boji, dbji1, dbji2, dbji3, dbji4, dbji5;
double pradx, prady;
+
int inti=parami->ielement;
int intj=paramj->ielement;
- int *tag=atom->tag;
- int itag=tag[i];
- int jtag=tag[j];
+ tagint *tag=atom->tag;
+ tagint itag=tag[i];
+ tagint jtag=tag[j];
r = sqrt(rsq);
if (r > parami->bigr + parami->bigd) return;
@@ -3348,10 +3347,11 @@ void PairComb3::tor_force(int torindx, Param *paramk, Param *paraml,
double PairComb3::combqeq(double *qf_fix, int &igroup)
{
- int i,j,ii, jj,itag,jtag,itype,jtype,jnum;
+ int i,j,ii,jj,itype,jtype,jnum;
int iparam_i,iparam_ji,iparam_ij;
int *ilist,*jlist,*numneigh,**firstneigh;
int mr1,mr2,mr3,inty,nj;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,rr,rsq,rsq1,rsq2,delrj[3],zeta_ij;
double iq,jq,fqi,fqj,fqij,fqji,yaself,yaself_d,sr1,sr2,sr3;
double rr_sw,ij_sw,ji_sw,fq_swi,fq_swj;
@@ -3360,7 +3360,7 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
double **x = atom->x;
double *q = atom->q;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int inum = list->inum;
int *mask = atom->mask;
@@ -3507,7 +3507,7 @@ double PairComb3::combqeq(double *qf_fix, int &igroup)
i = ilist[ii];
if (mask[i] & groupbit){
eneg += qf[i];
- itag=tag[i];
+ itag=tag[i];
}
}
diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp
index cc511d59a4..8ccb7ee8aa 100644
--- a/src/MANYBODY/pair_lcbop.cpp
+++ b/src/MANYBODY/pair_lcbop.cpp
@@ -355,7 +355,8 @@ void PairLCBOP::SR_neigh()
void PairLCBOP::FSR(int eflag, int vflag)
{
- int i,j,jj,ii,inum,itag,jtag;
+ int i,j,jj,ii,inum;
+ tagint itag,jtag;
double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
double r_sq,rijmag,f_c_ij,df_c_ij;
double VR,dVRdi,VA,Bij,dVAdi,dVA;
@@ -364,7 +365,7 @@ void PairLCBOP::FSR(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
@@ -450,19 +451,18 @@ void PairLCBOP::FSR(int eflag, int vflag)
void PairLCBOP::FLR(int eflag, int vflag)
{
-
- int i,j,jj,m,ii,itag,jtag;
+ int i,j,jj,m,ii;
+ tagint itag,jtag;
double delx,dely,delz,fpair,xtmp,ytmp,ztmp;
double r_sq,rijmag,f_c_ij,df_c_ij;
double V,dVdi;
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
-
int inum = list->inum;
int *ilist = list->ilist;
int *numneigh = list->numneigh;
diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp
index db1e816c6d..0f7b787924 100644
--- a/src/MANYBODY/pair_nb3b_harmonic.cpp
+++ b/src/MANYBODY/pair_nb3b_harmonic.cpp
@@ -77,8 +77,9 @@ PairNb3bHarmonic::~PairNb3bHarmonic()
void PairNb3bHarmonic::compute(int eflag, int vflag)
{
- int i,j,k,ii,jj,kk,inum,jnum,jnumm1,itag,jtag;
+ int i,j,k,ii,jj,kk,inum,jnum,jnumm1;
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fj[3],fk[3];
@@ -90,7 +91,7 @@ void PairNb3bHarmonic::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
inum = list->inum;
diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp
index d3cc168389..3928ff0d0b 100644
--- a/src/MANYBODY/pair_sw.cpp
+++ b/src/MANYBODY/pair_sw.cpp
@@ -75,8 +75,9 @@ PairSW::~PairSW()
void PairSW::compute(int eflag, int vflag)
{
- int i,j,k,ii,jj,kk,inum,jnum,jnumm1,itag,jtag;
+ int i,j,k,ii,jj,kk,inum,jnum,jnumm1;
int itype,jtype,ktype,ijparam,ikparam,ijkparam;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fj[3],fk[3];
@@ -88,7 +89,7 @@ void PairSW::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp
index fbbe857f09..fe02371fec 100644
--- a/src/MANYBODY/pair_tersoff.cpp
+++ b/src/MANYBODY/pair_tersoff.cpp
@@ -77,7 +77,8 @@ PairTersoff::~PairTersoff()
void PairTersoff::compute(int eflag, int vflag)
{
int i,j,k,ii,jj,kk,inum,jnum;
- int itag,jtag,itype,jtype,ktype,iparam_ij,iparam_ijk;
+ int itype,jtype,ktype,iparam_ij,iparam_ijk;
+ tagint itag,jtag;
double xtmp,ytmp,ztmp,delx,dely,delz,evdwl,fpair;
double rsq,rsq1,rsq2;
double delr1[3],delr2[3],fi[3],fj[3],fk[3];
@@ -90,7 +91,7 @@ void PairTersoff::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp
index 0ae5ae94be..50f718492c 100644
--- a/src/MC/fix_bond_break.cpp
+++ b/src/MC/fix_bond_break.cpp
@@ -155,7 +155,7 @@ void FixBondBreak::post_integrate()
{
int i,j,k,m,n,i1,i2,n1,n3,type;
double delx,dely,delz,rsq;
- int *slist;
+ tagint *slist;
if (update->ntimestep % nevery) return;
@@ -188,7 +188,7 @@ void FixBondBreak::post_integrate()
// setup possible partner list of bonds to break
double **x = atom->x;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int **bondlist = neighbor->bondlist;
int nbondlist = neighbor->nbondlist;
@@ -237,10 +237,10 @@ void FixBondBreak::post_integrate()
// and probability constraint is satisfied
int **bond_type = atom->bond_type;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int *num_bond = atom->num_bond;
int **nspecial = atom->nspecial;
- int **special = atom->special;
+ tagint **special = atom->special;
int nbreak = 0;
for (i = 0; i < nlocal; i++) {
@@ -333,7 +333,7 @@ void FixBondBreak::unpack_comm(int n, int first, double *buf)
m = 0;
last = first + n;
for (i = first; i < last; i++) {
- partner[i] = static_cast (buf[m++]);
+ partner[i] = static_cast (buf[m++]);
probability[i] = buf[m++];
}
}
@@ -363,7 +363,7 @@ void FixBondBreak::unpack_reverse_comm(int n, int *list, double *buf)
for (i = 0; i < n; i++) {
j = list[i];
if (buf[m+1] > distsq[j]) {
- partner[j] = static_cast (buf[m++]);
+ partner[j] = static_cast (buf[m++]);
distsq[j] = buf[m++];
} else m += 2;
}
diff --git a/src/MC/fix_bond_break.h b/src/MC/fix_bond_break.h
index 190ed8529a..03aef01666 100644
--- a/src/MC/fix_bond_break.h
+++ b/src/MC/fix_bond_break.h
@@ -47,7 +47,7 @@ class FixBondBreak : public Fix {
int breakcount,breakcounttotal;
int nmax;
- int *partner;
+ tagint *partner;
double *distsq,*probability;
class RanMars *random;
diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp
index 7d0850c57e..015a527015 100644
--- a/src/MC/fix_bond_create.cpp
+++ b/src/MC/fix_bond_create.cpp
@@ -235,7 +235,7 @@ void FixBondCreate::setup(int vflag)
int *num_bond = atom->num_bond;
int **bond_type = atom->bond_type;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int nlocal = atom->nlocal;
int nghost = atom->nghost;
int nall = nlocal + nghost;
@@ -269,7 +269,8 @@ void FixBondCreate::post_integrate()
{
int i,j,m,ii,jj,inum,jnum,itype,jtype,n1,n3,possible;
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
- int *ilist,*jlist,*numneigh,**firstneigh,*slist;
+ int *ilist,*jlist,*numneigh,**firstneigh;
+ tagint *slist;
if (update->ntimestep % nevery) return;
@@ -307,7 +308,7 @@ void FixBondCreate::post_integrate()
// each atom sets one closest eligible partner atom ID to bond with
double **x = atom->x;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int *type = atom->type;
@@ -385,10 +386,10 @@ void FixBondCreate::post_integrate()
// and probability constraint is satisfied
int **bond_type = atom->bond_type;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int *num_bond = atom->num_bond;
int **nspecial = atom->nspecial;
- int **special = atom->special;
+ tagint **special = atom->special;
int newton_bond = force->newton_bond;
int ncreate = 0;
@@ -506,7 +507,7 @@ void FixBondCreate::unpack_comm(int n, int first, double *buf)
} else {
for (i = first; i < last; i++) {
- partner[i] = static_cast (buf[m++]);
+ partner[i] = static_cast (buf[m++]);
probability[i] = buf[m++];
}
}
@@ -554,7 +555,7 @@ void FixBondCreate::unpack_reverse_comm(int n, int *list, double *buf)
j = list[i];
if (buf[m] < distsq[j]) {
distsq[j] = buf[m++];
- partner[j] = static_cast (buf[m++]);
+ partner[j] = static_cast (buf[m++]);
} else m += 2;
}
}
diff --git a/src/MC/fix_bond_create.h b/src/MC/fix_bond_create.h
index 3aebdc3f36..22a6e79c32 100644
--- a/src/MC/fix_bond_create.h
+++ b/src/MC/fix_bond_create.h
@@ -58,7 +58,7 @@ class FixBondCreate : public Fix {
int nmax;
int *bondcount; // count of created bonds this atom is part of
- int *partner; // ID of preferred atom for this atom to bond to
+ tagint *partner; // ID of preferred atom for this atom to bond to
double *distsq; // distance to preferred bond partner
double *probability; // random # to use in decision to form bond
diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp
index 24474052f5..31bdb75682 100644
--- a/src/MC/fix_bond_swap.cpp
+++ b/src/MC/fix_bond_swap.cpp
@@ -179,9 +179,9 @@ void FixBondSwap::pre_neighbor()
{
int i,j,ii,jj,m,inum,jnum;
int inext,iprev,ilast,jnext,jprev,jlast,ibond,iangle,jbond,jangle;
- int itag,inexttag,iprevtag,ilasttag,jtag,jnexttag,jprevtag,jlasttag;
int ibondtype,jbondtype,iangletype,inextangletype,jangletype,jnextangletype;
- int i1,i2,i3,j1,j2,j3,tmp;
+ tagint itag,inexttag,iprevtag,ilasttag,jtag,jnexttag,jprevtag,jlasttag;
+ tagint i1,i2,i3,j1,j2,j3;
int *ilist,*jlist,*numneigh,**firstneigh;
double delta,factor;
@@ -191,19 +191,19 @@ void FixBondSwap::pre_neighbor()
// local ptrs to atom arrays
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int *molecule = atom->molecule;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
int *num_angle = atom->num_angle;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
int **nspecial = atom->nspecial;
- int **special = atom->special;
+ tagint **special = atom->special;
int newton_bond = force->newton_bond;
int nlocal = atom->nlocal;
@@ -231,6 +231,7 @@ void FixBondSwap::pre_neighbor()
alist[neligible++] = i;
}
+ int tmp;
for (i = 0; i < neligible; i++) {
j = static_cast (random->uniform() * neligible);
tmp = alist[i];
diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp
index eb8fba2daf..ab85e6e21b 100644
--- a/src/MC/fix_gcmc.cpp
+++ b/src/MC/fix_gcmc.cpp
@@ -282,9 +282,10 @@ void FixGCMC::init()
}
if ((molflag && (atom->molecule_flag == 0)) ||
- (molflag && ((!atom->tag_enable) || (!atom->map_style))))
+ (molflag && (!atom->tag_enable || !atom->map_style)))
error->all(FLERR,
- "Fix gcmc molecule command requires that atoms have molecule attributes");
+ "Fix gcmc molecule command requires that "
+ "atoms have molecule attributes");
if (force->pair->single_enable == 0)
error->all(FLERR,"Fix gcmc incompatible with given pair_style");
@@ -805,18 +806,18 @@ void FixGCMC::attempt_molecule_insertion()
if (maxmol >= MAXSMALLINT)
error->all(FLERR,"Fix gcmc ran out of available molecule IDs");
- int maxtag = 0;
+ tagint maxtag = 0;
for (int i = 0; i < atom->nlocal; i++) maxtag = MAX(maxtag,atom->tag[i]);
- int maxtag_all;
- MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_INT,MPI_MAX,world);
- int atom_offset = maxtag_all;
+ tagint maxtag_all;
+ MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
+ tagint atom_offset = maxtag_all;
int k = 0;
double **x = atom->x;
double **v = atom->v;
imageint *image = atom->image;
int *molecule = atom->molecule;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int i = 0; i < natoms_per_molecule; i++) {
k += atom->avec->unpack_exchange(&model_atom_buf[k]);
if (procflag[i]) {
@@ -1165,9 +1166,9 @@ void FixGCMC::get_model_molecule()
x[i][2] -= com[2];
}
- int mintag = atom->tag[0];
+ tagint mintag = atom->tag[0];
for (int i = 0; i < atom->nlocal; i++) mintag = MIN(mintag,atom->tag[i]);
- int atom_offset = mintag - 1;
+ tagint atom_offset = mintag - 1;
for (int i = 0; i < nlocal; i++) {
atom->mask[i] = 1 | groupbit;
diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp
index fa8dbf6c69..ea8fb37be9 100644
--- a/src/MISC/fix_deposit.cpp
+++ b/src/MISC/fix_deposit.cpp
@@ -488,16 +488,18 @@ void FixDeposit::pre_exchange()
if (success) {
atom->natoms += natom;
+ if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
+ error->all(FLERR,"Too many total atoms");
if (mode == MOLECULE) {
atom->nbonds += onemol->nbonds;
atom->nangles += onemol->nangles;
atom->ndihedrals += onemol->ndihedrals;
atom->nimpropers += onemol->nimpropers;
}
- if (idnext) {
- maxtag_all += natom;
- if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
- }
+ maxtag_all += natom;
+ if (maxtag_all >= MAXTAGINT)
+ error->all(FLERR,"New atom IDs exceed maximum allowed ID");
+ if (mode == MOLECULE && atom->molecule_flag) maxmol_all++;
if (atom->map_style) {
atom->nghost = 0;
atom->map_init();
@@ -520,13 +522,13 @@ void FixDeposit::pre_exchange()
void FixDeposit::find_maxid()
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *molecule = atom->molecule;
int nlocal = atom->nlocal;
- int max = 0;
+ tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
- MPI_Allreduce(&max,&maxtag_all,1,MPI_INT,MPI_MAX,world);
+ MPI_Allreduce(&max,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (mode == MOLECULE && molecule) {
max = 0;
diff --git a/src/MISC/fix_deposit.h b/src/MISC/fix_deposit.h
index 7e9bea0f37..56bf34c6dd 100644
--- a/src/MISC/fix_deposit.h
+++ b/src/MISC/fix_deposit.h
@@ -55,7 +55,8 @@ class FixDeposit : public Fix {
class Fix *fixrigid,*fixshake;
int nfirst,ninserted;
- int maxtag_all,maxmol_all;
+ tagint maxtag_all;
+ int maxmol_all;
class RanPark *random;
void find_maxid();
diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp
index 5fe5c1412f..ab153f805e 100644
--- a/src/MISC/fix_evaporate.cpp
+++ b/src/MISC/fix_evaporate.cpp
@@ -186,7 +186,7 @@ void FixEvaporate::pre_exchange()
double **x = atom->x;
int *mask = atom->mask;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int ncount = 0;
diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp
index a7fc2eceaa..722dc04854 100644
--- a/src/MISC/fix_orient_fcc.cpp
+++ b/src/MISC/fix_orient_fcc.cpp
@@ -243,7 +243,8 @@ void FixOrientFCC::setup(int vflag)
void FixOrientFCC::post_force(int vflag)
{
- int i,j,k,ii,jj,inum,jnum,m,n,nn,nsort,id_self;
+ int i,j,k,ii,jj,inum,jnum,m,n,nn,nsort;
+ tagint id_self;
int *ilist,*jlist,*numneigh,**firstneigh;
double edelta,omega;
double dx,dy,dz,rsq,xismooth,xi_sq,duxi,duxi_other;
@@ -256,7 +257,7 @@ void FixOrientFCC::post_force(int vflag)
double **x = atom->x;
double **f = atom->f;
int *mask = atom->mask;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int nall = atom->nlocal + atom->nghost;
@@ -480,8 +481,10 @@ double FixOrientFCC::compute_scalar()
int FixOrientFCC::pack_comm(int n, int *list, double *buf,
int pbc_flag, int *pbc)
{
- int i,j,k,id,num;
- int *tag = atom->tag;
+ int i,j,k,num;
+ tagint id;
+
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int m = 0;
@@ -531,7 +534,7 @@ void FixOrientFCC::unpack_comm(int n, int first, double *buf)
nbr[i].dxi[j][0] = buf[m++];
nbr[i].dxi[j][1] = buf[m++];
nbr[i].dxi[j][2] = buf[m++];
- nbr[i].id[j] = static_cast (buf[m++]);
+ nbr[i].id[j] = static_cast (buf[m++]);
}
m += (12-num) * 3;
diff --git a/src/MISC/fix_orient_fcc.h b/src/MISC/fix_orient_fcc.h
index c15c79d556..adbb93f1a5 100644
--- a/src/MISC/fix_orient_fcc.h
+++ b/src/MISC/fix_orient_fcc.h
@@ -28,7 +28,7 @@ class FixOrientFCC : public Fix {
public:
struct Nbr { // neighbor info for each owned and ghost atom
int n; // # of closest neighbors (up to 12)
- int id[12]; // IDs of each neighbor
+ tagint id[12]; // IDs of each neighbor
// if center atom is owned, these are local IDs
// if center atom is ghost, these are global IDs
double xismooth[12]; // distance weighting factor for each neighbors
@@ -37,7 +37,7 @@ class FixOrientFCC : public Fix {
};
struct Sort { // data structure for sorting to find 12 closest
- int id; // ID of neighbor atom
+ int id; // local ID of neighbor atom
double rsq; // distance between center and neighbor atom
double delta[3]; // displacement between center and neighbor atom
double xismooth; // distance weighting factor
diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp
index 224c25605a..9b303451c3 100644
--- a/src/MOLECULE/atom_vec_angle.cpp
+++ b/src/MOLECULE/atom_vec_angle.cpp
@@ -475,7 +475,7 @@ void AtomVecAngle::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -500,7 +500,7 @@ void AtomVecAngle::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -594,7 +594,7 @@ int AtomVecAngle::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -604,22 +604,22 @@ int AtomVecAngle::unpack_exchange(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
+ angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
for (k = 0; k < nspecial[nlocal][2]; k++)
- special[nlocal][k] = (int) ubuf(buf[m++]).i;
+ special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@@ -666,28 +666,28 @@ int AtomVecAngle::pack_restart(int i, double *buf)
buf[m++] = x[i][0];
buf[m++] = x[i][1];
buf[m++] = x[i][2];
- buf[m++] = tag[i];
- buf[m++] = type[i];
- buf[m++] = mask[i];
- *((imageint *) &buf[m++]) = image[i];
+ buf[m++] = ubuf(tag[i]).d;
+ buf[m++] = ubuf(type[i]).d;
+ buf[m++] = ubuf(mask[i]).d;
+ buf[m++] = ubuf(image[i]).d;
buf[m++] = v[i][0];
buf[m++] = v[i][1];
buf[m++] = v[i][2];
- buf[m++] = molecule[i];
+ buf[m++] = ubuf(molecule[i]).d;
- buf[m++] = num_bond[i];
+ buf[m++] = ubuf(num_bond[i]).d;
for (k = 0; k < num_bond[i]; k++) {
- buf[m++] = MAX(bond_type[i][k],-bond_type[i][k]);
- buf[m++] = bond_atom[i][k];
+ buf[m++] = ubuf(MAX(bond_type[i][k],-bond_type[i][k])).d;
+ buf[m++] = ubuf(bond_atom[i][k]).d;
}
- buf[m++] = num_angle[i];
+ buf[m++] = ubuf(num_angle[i]).d;
for (k = 0; k < num_angle[i]; k++) {
- buf[m++] = MAX(angle_type[i][k],-angle_type[i][k]);
- buf[m++] = angle_atom1[i][k];
- buf[m++] = angle_atom2[i][k];
- buf[m++] = angle_atom3[i][k];
+ buf[m++] = ubuf(MAX(angle_type[i][k],-angle_type[i][k])).d;
+ buf[m++] = ubuf(angle_atom1[i][k]).d;
+ buf[m++] = ubuf(angle_atom2[i][k]).d;
+ buf[m++] = ubuf(angle_atom3[i][k]).d;
}
if (atom->nextra_restart)
@@ -717,7 +717,7 @@ int AtomVecAngle::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -730,15 +730,15 @@ int AtomVecAngle::unpack_restart(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
+ angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
@@ -793,12 +793,8 @@ void AtomVecAngle::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -871,8 +867,8 @@ int AtomVecAngle::pack_data_hybrid(int i, double *buf)
void AtomVecAngle::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
diff --git a/src/MOLECULE/atom_vec_angle.h b/src/MOLECULE/atom_vec_angle.h
index 56c00ace21..beccef79de 100644
--- a/src/MOLECULE/atom_vec_angle.h
+++ b/src/MOLECULE/atom_vec_angle.h
@@ -58,16 +58,19 @@ class AtomVecAngle : public AtomVec {
bigint memory_usage();
protected:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *molecule;
- int **nspecial,**special;
+ int **nspecial;
+ tagint **special;
int *num_bond;
- int **bond_type,**bond_atom;
+ int **bond_type;
+ tagint **bond_atom;
int *num_angle;
int **angle_type;
- int **angle_atom1,**angle_atom2,**angle_atom3;
+ tagint **angle_atom1,**angle_atom2,**angle_atom3;
};
}
diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp
index c06d3eed29..7e5e639918 100644
--- a/src/MOLECULE/atom_vec_bond.cpp
+++ b/src/MOLECULE/atom_vec_bond.cpp
@@ -454,7 +454,7 @@ void AtomVecBond::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -479,7 +479,7 @@ void AtomVecBond::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -565,7 +565,7 @@ int AtomVecBond::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -575,14 +575,14 @@ int AtomVecBond::unpack_exchange(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
for (k = 0; k < nspecial[nlocal][2]; k++)
- special[nlocal][k] = (int) ubuf(buf[m++]).i;
+ special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@@ -672,7 +672,7 @@ int AtomVecBond::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -685,7 +685,7 @@ int AtomVecBond::unpack_restart(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
@@ -739,12 +739,8 @@ void AtomVecBond::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -815,8 +811,8 @@ int AtomVecBond::pack_data_hybrid(int i, double *buf)
void AtomVecBond::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
diff --git a/src/MOLECULE/atom_vec_bond.h b/src/MOLECULE/atom_vec_bond.h
index 388195206a..94c43f4c2b 100644
--- a/src/MOLECULE/atom_vec_bond.h
+++ b/src/MOLECULE/atom_vec_bond.h
@@ -57,13 +57,16 @@ class AtomVecBond : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *molecule;
- int **nspecial,**special;
+ int **nspecial;
+ tagint **special;
int *num_bond;
- int **bond_type,**bond_atom;
+ int **bond_type;
+ tagint **bond_atom;
};
}
diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp
index 6d44289d4e..09175dd034 100644
--- a/src/MOLECULE/atom_vec_full.cpp
+++ b/src/MOLECULE/atom_vec_full.cpp
@@ -469,9 +469,9 @@ int AtomVecFull::pack_border_vel(int n, int *list, double *buf,
buf[m++] = x[j][0] + dx;
buf[m++] = x[j][1] + dy;
buf[m++] = x[j][2] + dz;
- buf[m++] = tag[j];
- buf[m++] = type[j];
- buf[m++] = mask[j];
+ buf[m++] = ubuf(tag[j]).d;
+ buf[m++] = ubuf(type[j]).d;
+ buf[m++] = ubuf(mask[j]).d;
buf[m++] = q[j];
buf[m++] = molecule[j];
buf[m++] = v[j][0];
@@ -540,7 +540,7 @@ void AtomVecFull::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -566,7 +566,7 @@ void AtomVecFull::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -682,7 +682,7 @@ int AtomVecFull::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -693,40 +693,40 @@ int AtomVecFull::unpack_exchange(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
+ angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_dihedral[nlocal]; k++) {
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
+ dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_improper[nlocal]; k++) {
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
+ improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][1] = (int) ubuf(buf[m++]).i;
nspecial[nlocal][2] = (int) ubuf(buf[m++]).i;
for (k = 0; k < nspecial[nlocal][2]; k++)
- special[nlocal][k] = (int) ubuf(buf[m++]).i;
+ special[nlocal][k] = (tagint) ubuf(buf[m++]).i;
if (atom->nextra_grow)
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
@@ -844,7 +844,7 @@ int AtomVecFull::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -858,33 +858,33 @@ int AtomVecFull::unpack_restart(double *buf)
num_bond[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_bond[nlocal]; k++) {
bond_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- bond_atom[nlocal][k] = (int) ubuf(buf[m++]).i;
+ bond_atom[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_angle[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_angle[nlocal]; k++) {
angle_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- angle_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
+ angle_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ angle_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_dihedral[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_dihedral[nlocal]; k++) {
dihedral_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
- dihedral_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
+ dihedral_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ dihedral_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
num_improper[nlocal] = (int) ubuf(buf[m++]).i;
for (k = 0; k < num_improper[nlocal]; k++) {
improper_type[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom1[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom2[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom3[nlocal][k] = (int) ubuf(buf[m++]).i;
- improper_atom4[nlocal][k] = (int) ubuf(buf[m++]).i;
+ improper_atom1[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom2[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom3[nlocal][k] = (tagint) ubuf(buf[m++]).i;
+ improper_atom4[nlocal][k] = (tagint) ubuf(buf[m++]).i;
}
nspecial[nlocal][0] = nspecial[nlocal][1] = nspecial[nlocal][2] = 0;
@@ -942,12 +942,8 @@ void AtomVecFull::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1029,8 +1025,9 @@ int AtomVecFull::pack_data_hybrid(int i, double *buf)
void AtomVecFull::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
diff --git a/src/MOLECULE/atom_vec_full.h b/src/MOLECULE/atom_vec_full.h
index 45202af09a..11b44a8b0b 100644
--- a/src/MOLECULE/atom_vec_full.h
+++ b/src/MOLECULE/atom_vec_full.h
@@ -58,23 +58,26 @@ class AtomVecFull : public AtomVec {
bigint memory_usage();
protected:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *q;
int *molecule;
- int **nspecial,**special;
+ int **nspecial;
+ tagint **special;
int *num_bond;
- int **bond_type,**bond_atom;
+ int **bond_type;
+ tagint **bond_atom;
int *num_angle;
int **angle_type;
- int **angle_atom1,**angle_atom2,**angle_atom3;
+ tagint **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
- int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
+ tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
- int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
+ tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
};
}
diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp
index 9feb31e1c2..2f2265b5df 100644
--- a/src/MOLECULE/atom_vec_molecular.cpp
+++ b/src/MOLECULE/atom_vec_molecular.cpp
@@ -532,7 +532,7 @@ void AtomVecMolecular::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -557,7 +557,7 @@ void AtomVecMolecular::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -669,7 +669,7 @@ int AtomVecMolecular::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -829,7 +829,7 @@ int AtomVecMolecular::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -920,17 +920,14 @@ void AtomVecMolecular::create_atom(int itype, double *coord)
initialize other atom quantities
------------------------------------------------------------------------- */
-void AtomVecMolecular::data_atom(double *coord, imageint imagetmp, char **values)
+void AtomVecMolecular::data_atom(double *coord, imageint imagetmp,
+ char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1007,8 +1004,8 @@ int AtomVecMolecular::pack_data_hybrid(int i, double *buf)
void AtomVecMolecular::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
diff --git a/src/MOLECULE/atom_vec_molecular.h b/src/MOLECULE/atom_vec_molecular.h
index 6b8791cd4e..51b5dd3e4a 100644
--- a/src/MOLECULE/atom_vec_molecular.h
+++ b/src/MOLECULE/atom_vec_molecular.h
@@ -57,22 +57,25 @@ class AtomVecMolecular : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *molecule;
- int **nspecial,**special;
+ int **nspecial;
+ tagint **special;
int *num_bond;
- int **bond_type,**bond_atom;
+ int **bond_type;
+ tagint **bond_atom;
int *num_angle;
int **angle_type;
- int **angle_atom1,**angle_atom2,**angle_atom3;
+ tagint **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
- int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
+ tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
- int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
+ tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
};
}
diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp
index 8eca809d1b..fb69de6e56 100644
--- a/src/MOLECULE/bond_fene.cpp
+++ b/src/MOLECULE/bond_fene.cpp
@@ -85,7 +85,8 @@ void BondFENE::compute(int eflag, int vflag)
if (rlogarg < 0.1) {
char str[128];
- sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
+ sprintf(str,"FENE bond too long: " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " %g",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp
index 214e632795..439b09a5a7 100644
--- a/src/MOLECULE/bond_fene_expand.cpp
+++ b/src/MOLECULE/bond_fene_expand.cpp
@@ -90,7 +90,8 @@ void BondFENEExpand::compute(int eflag, int vflag)
if (rlogarg < 0.1) {
char str[128];
- sprintf(str,"FENE bond too long: " BIGINT_FORMAT " %d %d %g",
+ sprintf(str,"FENE bond too long: " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " %g",
update->ntimestep,atom->tag[i1],atom->tag[i2],sqrt(rsq));
error->warning(FLERR,str,0);
if (rlogarg <= -3.0) error->one(FLERR,"Bad FENE bond");
diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp
index 8029e7b4fa..671514fc5d 100644
--- a/src/MOLECULE/dihedral_charmm.cpp
+++ b/src/MOLECULE/dihedral_charmm.cpp
@@ -150,7 +150,9 @@ void DihedralCharmm::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp
index a7f353269b..0c0ff327ba 100644
--- a/src/MOLECULE/dihedral_harmonic.cpp
+++ b/src/MOLECULE/dihedral_harmonic.cpp
@@ -137,7 +137,9 @@ void DihedralHarmonic::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp
index fd5d72e845..744f3b4915 100644
--- a/src/MOLECULE/dihedral_helix.cpp
+++ b/src/MOLECULE/dihedral_helix.cpp
@@ -165,7 +165,9 @@ void DihedralHelix::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp
index 2e3b4e79dc..48f4f2b45f 100644
--- a/src/MOLECULE/dihedral_multi_harmonic.cpp
+++ b/src/MOLECULE/dihedral_multi_harmonic.cpp
@@ -155,7 +155,9 @@ void DihedralMultiHarmonic::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp
index 074c8bf15c..f73b85f9b4 100644
--- a/src/MOLECULE/dihedral_opls.cpp
+++ b/src/MOLECULE/dihedral_opls.cpp
@@ -164,7 +164,9 @@ void DihedralOPLS::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp
index 06485e9189..3d33b3b9f7 100644
--- a/src/MOLECULE/improper_cvff.cpp
+++ b/src/MOLECULE/improper_cvff.cpp
@@ -151,8 +151,9 @@ void ImproperCvff::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,
- "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp
index 4db32456b3..19f845452a 100644
--- a/src/MOLECULE/improper_harmonic.cpp
+++ b/src/MOLECULE/improper_harmonic.cpp
@@ -125,8 +125,9 @@ void ImproperHarmonic::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,
- "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp
index ef8c1a1352..a3b7295b3d 100644
--- a/src/MOLECULE/improper_umbrella.cpp
+++ b/src/MOLECULE/improper_umbrella.cpp
@@ -128,8 +128,9 @@ void ImproperUmbrella::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,
- "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
index 381629e161..a25e116e96 100644
--- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp
@@ -84,7 +84,8 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
double fi[3],fj[3],delr1[3],delr2[3];
double r2inv,r10inv;
double switch1,switch2;
- int *ilist,*jlist,*klist,*numneigh,**firstneigh;
+ int *ilist,*jlist,*numneigh,**firstneigh;
+ tagint *klist;
evdwl = ehbond = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
@@ -92,7 +93,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int **special = atom->special;
+ tagint **special = atom->special;
int *type = atom->type;
int **nspecial = atom->nspecial;
double *special_lj = force->special_lj;
@@ -457,10 +458,10 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype,
double rsq1,rsq2,r1,r2,c,s,ac,r2inv,r10inv,factor_hb;
double switch1,switch2;
double delr1[3],delr2[3];
- int *klist;
+ tagint *klist;
double **x = atom->x;
- int **special = atom->special;
+ tagint **special = atom->special;
int *type = atom->type;
int **nspecial = atom->nspecial;
double *special_lj = force->special_lj;
diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
index e3c26a5dc2..975bc94331 100644
--- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp
+++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp
@@ -54,7 +54,8 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
double c,s,a,b,d,ac,a11,a12,a22,vx1,vx2,vy1,vy2,vz1,vz2;
double fi[3],fj[3],delr1[3],delr2[3];
double r,dr,dexp,eng_morse,switch1,switch2;
- int *ilist,*jlist,*klist,*numneigh,**firstneigh;
+ int *ilist,*jlist,*numneigh,**firstneigh;
+ tagint *klist;
evdwl = ehbond = 0.0;
if (eflag || vflag) ev_setup(eflag,vflag);
@@ -62,7 +63,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
- int **special = atom->special;
+ tagint **special = atom->special;
int *type = atom->type;
int **nspecial = atom->nspecial;
double *special_lj = force->special_lj;
@@ -360,10 +361,10 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype,
double rsq1,rsq2,r1,r2,c,s,ac,r,dr,dexp,factor_hb;
double switch1,switch2;
double delr1[3],delr2[3];
- int *klist;
+ tagint *klist;
double **x = atom->x;
- int **special = atom->special;
+ tagint **special = atom->special;
int *type = atom->type;
int **nspecial = atom->nspecial;
double *special_lj = force->special_lj;
diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp
index 04b37635b6..39f8a3c1f9 100644
--- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp
+++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp
@@ -114,6 +114,7 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_lj = force->special_lj;
double *special_coul = force->special_coul;
@@ -137,8 +138,8 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -207,8 +208,8 @@ void PairLJCutTIP4PCut::compute(int eflag, int vflag)
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp
index d1ce9b2569..57bb72da8b 100644
--- a/src/MOLECULE/pair_tip4p_cut.cpp
+++ b/src/MOLECULE/pair_tip4p_cut.cpp
@@ -103,6 +103,7 @@ void PairTIP4PCut::compute(int eflag, int vflag)
double **f = atom->f;
double **x = atom->x;
double *q = atom->q;
+ tagint *tag = atom->tag;
int *type = atom->type;
double *special_coul = force->special_coul;
int newton_pair = force->newton_pair;
@@ -125,8 +126,8 @@ void PairTIP4PCut::compute(int eflag, int vflag)
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -169,8 +170,8 @@ void PairTIP4PCut::compute(int eflag, int vflag)
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index a4770269d6..9c9d1b9037 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -7,9 +7,9 @@ SHELL = /bin/sh
ROOT = lammps
EXE = lib$(ROOT)_$@.so
-SRC = angle.cpp angle_charmm.cpp angle_class2.cpp angle_cosine.cpp angle_cosine_delta.cpp angle_cosine_periodic.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp angle_table.cpp atom.cpp atom_map.cpp atom_vec.cpp atom_vec_angle.cpp atom_vec_atomic.cpp atom_vec_body.cpp atom_vec_bond.cpp atom_vec_charge.cpp atom_vec_dipole.cpp atom_vec_ellipsoid.cpp atom_vec_full.cpp atom_vec_hybrid.cpp atom_vec_line.cpp atom_vec_molecular.cpp atom_vec_peri.cpp atom_vec_sphere.cpp atom_vec_tri.cpp balance.cpp body.cpp body_nparticle.cpp bond.cpp bond_class2.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp bond_table.cpp change_box.cpp comm.cpp compute.cpp compute_angle_local.cpp compute_atom_molecule.cpp compute_body_local.cpp compute_bond_local.cpp compute_centro_atom.cpp compute_cluster_atom.cpp compute_cna_atom.cpp compute_com.cpp compute_com_molecule.cpp compute_contact_atom.cpp compute_coord_atom.cpp compute_damage_atom.cpp compute_dihedral_local.cpp compute_displace_atom.cpp compute_erotate_asphere.cpp compute_erotate_sphere.cpp compute_erotate_sphere_atom.cpp compute_event_displace.cpp compute_group_group.cpp compute_gyration.cpp compute_gyration_molecule.cpp compute_heat_flux.cpp compute_improper_local.cpp compute_inertia_molecule.cpp compute_ke.cpp compute_ke_atom.cpp compute_msd.cpp compute_msd_molecule.cpp compute_pair.cpp compute_pair_local.cpp compute_pe.cpp compute_pe_atom.cpp compute_pressure.cpp compute_property_atom.cpp compute_property_local.cpp compute_property_molecule.cpp compute_rdf.cpp compute_reduce.cpp compute_reduce_region.cpp compute_slice.cpp compute_stress_atom.cpp compute_temp.cpp compute_temp_asphere.cpp compute_temp_com.cpp compute_temp_deform.cpp compute_temp_partial.cpp compute_temp_profile.cpp compute_temp_ramp.cpp compute_temp_region.cpp compute_temp_sphere.cpp compute_ti.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_class2.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp domain.cpp dump.cpp dump_atom.cpp dump_cfg.cpp dump_custom.cpp dump_dcd.cpp dump_image.cpp dump_local.cpp dump_xtc.cpp dump_xyz.cpp error.cpp finish.cpp fix.cpp fix_adapt.cpp fix_addforce.cpp fix_append_atoms.cpp fix_ave_atom.cpp fix_ave_correlate.cpp fix_ave_histo.cpp fix_ave_spatial.cpp fix_ave_time.cpp fix_aveforce.cpp fix_balance.cpp fix_bond_break.cpp fix_bond_create.cpp fix_bond_swap.cpp fix_box_relax.cpp fix_deform.cpp fix_deposit.cpp fix_drag.cpp fix_dt_reset.cpp fix_efield.cpp fix_enforce2d.cpp fix_evaporate.cpp fix_event.cpp fix_event_prd.cpp fix_event_tad.cpp fix_external.cpp fix_freeze.cpp fix_gcmc.cpp fix_gravity.cpp fix_heat.cpp fix_indent.cpp fix_langevin.cpp fix_lineforce.cpp fix_minimize.cpp fix_momentum.cpp fix_move.cpp fix_msst.cpp fix_neb.cpp fix_nh.cpp fix_nh_asphere.cpp fix_nh_sphere.cpp fix_nph.cpp fix_nph_asphere.cpp fix_nph_sphere.cpp fix_nphug.cpp fix_npt.cpp fix_npt_asphere.cpp fix_npt_sphere.cpp fix_nve.cpp fix_nve_asphere.cpp fix_nve_asphere_noforce.cpp fix_nve_body.cpp fix_nve_limit.cpp fix_nve_line.cpp fix_nve_noforce.cpp fix_nve_sphere.cpp fix_nve_tri.cpp fix_nvt.cpp fix_nvt_asphere.cpp fix_nvt_sllod.cpp fix_nvt_sphere.cpp fix_orient_fcc.cpp fix_peri_neigh.cpp fix_planeforce.cpp fix_pour.cpp fix_press_berendsen.cpp fix_print.cpp fix_qeq_comb.cpp fix_read_restart.cpp fix_recenter.cpp fix_respa.cpp fix_restrain.cpp fix_rigid.cpp fix_rigid_nh.cpp fix_rigid_nph.cpp fix_rigid_npt.cpp fix_rigid_nve.cpp fix_rigid_nvt.cpp fix_rigid_small.cpp fix_setforce.cpp fix_shake.cpp fix_shear_history.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_srd.cpp fix_store_force.cpp fix_store_state.cpp fix_temp_berendsen.cpp fix_temp_rescale.cpp fix_thermal_conductivity.cpp fix_tmd.cpp fix_ttm.cpp fix_viscosity.cpp fix_viscous.cpp fix_wall.cpp fix_wall_colloid.cpp fix_wall_gran.cpp fix_wall_harmonic.cpp fix_wall_lj126.cpp fix_wall_lj93.cpp fix_wall_piston.cpp fix_wall_reflect.cpp fix_wall_region.cpp fix_wall_srd.cpp force.cpp group.cpp image.cpp improper.cpp improper_class2.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp improper_umbrella.cpp input.cpp integrate.cpp irregular.cpp kspace.cpp lammps.cpp lattice.cpp library.cpp math_extra.cpp memory.cpp min.cpp min_cg.cpp min_fire.cpp min_hftn.cpp min_linesearch.cpp min_quickmin.cpp min_sd.cpp minimize.cpp modify.cpp neb.cpp neigh_bond.cpp neigh_derive.cpp neigh_full.cpp neigh_gran.cpp neigh_half_bin.cpp neigh_half_multi.cpp neigh_half_nsq.cpp neigh_list.cpp neigh_request.cpp neigh_respa.cpp neigh_stencil.cpp neighbor.cpp output.cpp pair.cpp pair_adp.cpp pair_airebo.cpp pair_beck.cpp pair_body.cpp pair_bop.cpp pair_born.cpp pair_born_coul_wolf.cpp pair_brownian.cpp pair_brownian_poly.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_colloid.cpp pair_comb.cpp pair_coul_cut.cpp pair_coul_debye.cpp pair_coul_dsf.cpp pair_coul_wolf.cpp pair_dipole_cut.cpp pair_dpd.cpp pair_dpd_tstat.cpp pair_dsmc.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_alloy_opt.cpp pair_eam_fs.cpp pair_eam_fs_opt.cpp pair_eam_opt.cpp pair_eim.cpp pair_gauss.cpp pair_gayberne.cpp pair_gran_hertz_history.cpp pair_gran_hooke.cpp pair_gran_hooke_history.cpp pair_hbond_dreiding_lj.cpp pair_hbond_dreiding_morse.cpp pair_hybrid.cpp pair_hybrid_overlay.cpp pair_lcbop.cpp pair_line_lj.cpp pair_lj96_cut.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_class2.cpp pair_lj_class2_coul_cut.cpp pair_lj_class2_coul_long.cpp pair_lj_cubic.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_dsf.cpp pair_lj_cut_opt.cpp pair_lj_cut_tip4p_cut.cpp pair_lj_expand.cpp pair_lj_gromacs.cpp pair_lj_gromacs_coul_gromacs.cpp pair_lj_smooth.cpp pair_lj_smooth_linear.cpp pair_lubricate.cpp pair_lubricateU.cpp pair_lubricateU_poly.cpp pair_lubricate_poly.cpp pair_mie_cut.cpp pair_morse.cpp pair_morse_opt.cpp pair_peri_lps.cpp pair_peri_pmb.cpp pair_rebo.cpp pair_resquared.cpp pair_soft.cpp pair_sw.cpp pair_table.cpp pair_tersoff.cpp pair_tersoff_zbl.cpp pair_tri_lj.cpp pair_yukawa.cpp pair_yukawa_colloid.cpp prd.cpp procmap.cpp random_mars.cpp random_park.cpp read_data.cpp read_dump.cpp read_restart.cpp reader.cpp reader_native.cpp reader_xyz.cpp region.cpp region_block.cpp region_cone.cpp region_cylinder.cpp region_intersect.cpp region_plane.cpp region_prism.cpp region_sphere.cpp region_union.cpp replicate.cpp rerun.cpp respa.cpp run.cpp set.cpp special.cpp tad.cpp temper.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp verlet_split.cpp write_restart.cpp xdr_compat.cpp
+SRC = angle.cpp angle_charmm.cpp angle_class2.cpp angle_cosine.cpp angle_cosine_delta.cpp angle_cosine_periodic.cpp angle_cosine_squared.cpp angle_harmonic.cpp angle_hybrid.cpp angle_table.cpp atom.cpp atom_map.cpp atom_vec.cpp atom_vec_angle.cpp atom_vec_atomic.cpp atom_vec_body.cpp atom_vec_bond.cpp atom_vec_charge.cpp atom_vec_dipole.cpp atom_vec_ellipsoid.cpp atom_vec_full.cpp atom_vec_hybrid.cpp atom_vec_line.cpp atom_vec_molecular.cpp atom_vec_peri.cpp atom_vec_sphere.cpp atom_vec_tri.cpp balance.cpp body.cpp body_nparticle.cpp bond.cpp bond_class2.cpp bond_fene.cpp bond_fene_expand.cpp bond_harmonic.cpp bond_hybrid.cpp bond_morse.cpp bond_nonlinear.cpp bond_quartic.cpp bond_table.cpp change_box.cpp citeme.cpp comm.cpp compute.cpp compute_angle_local.cpp compute_atom_molecule.cpp compute_body_local.cpp compute_bond_local.cpp compute_centro_atom.cpp compute_cluster_atom.cpp compute_cna_atom.cpp compute_com.cpp compute_com_molecule.cpp compute_contact_atom.cpp compute_coord_atom.cpp compute_damage_atom.cpp compute_dihedral_local.cpp compute_displace_atom.cpp compute_erotate_asphere.cpp compute_erotate_rigid.cpp compute_erotate_sphere.cpp compute_erotate_sphere_atom.cpp compute_event_displace.cpp compute_group_group.cpp compute_gyration.cpp compute_gyration_molecule.cpp compute_heat_flux.cpp compute_improper_local.cpp compute_inertia_molecule.cpp compute_ke.cpp compute_ke_atom.cpp compute_ke_rigid.cpp compute_msd.cpp compute_msd_molecule.cpp compute_msd_nongauss.cpp compute_pair.cpp compute_pair_local.cpp compute_pe.cpp compute_pe_atom.cpp compute_pressure.cpp compute_property_atom.cpp compute_property_local.cpp compute_property_molecule.cpp compute_rdf.cpp compute_reduce.cpp compute_reduce_region.cpp compute_slice.cpp compute_stress_atom.cpp compute_temp.cpp compute_temp_asphere.cpp compute_temp_com.cpp compute_temp_deform.cpp compute_temp_partial.cpp compute_temp_profile.cpp compute_temp_ramp.cpp compute_temp_region.cpp compute_temp_sphere.cpp compute_ti.cpp compute_vacf.cpp create_atoms.cpp create_box.cpp delete_atoms.cpp delete_bonds.cpp dihedral.cpp dihedral_charmm.cpp dihedral_class2.cpp dihedral_harmonic.cpp dihedral_helix.cpp dihedral_hybrid.cpp dihedral_multi_harmonic.cpp dihedral_opls.cpp displace_atoms.cpp domain.cpp dump.cpp dump_atom.cpp dump_cfg.cpp dump_custom.cpp dump_dcd.cpp dump_image.cpp dump_local.cpp dump_movie.cpp dump_xtc.cpp dump_xyz.cpp error.cpp finish.cpp fix.cpp fix_adapt.cpp fix_addforce.cpp fix_append_atoms.cpp fix_ave_atom.cpp fix_ave_correlate.cpp fix_ave_histo.cpp fix_ave_spatial.cpp fix_ave_time.cpp fix_aveforce.cpp fix_balance.cpp fix_bond_break.cpp fix_bond_create.cpp fix_bond_swap.cpp fix_box_relax.cpp fix_deform.cpp fix_deposit.cpp fix_drag.cpp fix_dt_reset.cpp fix_efield.cpp fix_enforce2d.cpp fix_evaporate.cpp fix_event.cpp fix_event_prd.cpp fix_event_tad.cpp fix_external.cpp fix_freeze.cpp fix_gcmc.cpp fix_gld.cpp fix_gravity.cpp fix_heat.cpp fix_indent.cpp fix_langevin.cpp fix_lineforce.cpp fix_minimize.cpp fix_momentum.cpp fix_move.cpp fix_msst.cpp fix_neb.cpp fix_nh.cpp fix_nh_asphere.cpp fix_nh_sphere.cpp fix_nph.cpp fix_nph_asphere.cpp fix_nph_sphere.cpp fix_nphug.cpp fix_npt.cpp fix_npt_asphere.cpp fix_npt_sphere.cpp fix_nve.cpp fix_nve_asphere.cpp fix_nve_asphere_noforce.cpp fix_nve_body.cpp fix_nve_limit.cpp fix_nve_line.cpp fix_nve_noforce.cpp fix_nve_sphere.cpp fix_nve_tri.cpp fix_nvt.cpp fix_nvt_asphere.cpp fix_nvt_sllod.cpp fix_nvt_sphere.cpp fix_orient_fcc.cpp fix_peri_neigh.cpp fix_planeforce.cpp fix_pour.cpp fix_press_berendsen.cpp fix_print.cpp fix_property_atom.cpp fix_qeq_comb.cpp fix_read_restart.cpp fix_recenter.cpp fix_respa.cpp fix_restrain.cpp fix_rigid.cpp fix_rigid_nh.cpp fix_rigid_nph.cpp fix_rigid_npt.cpp fix_rigid_nve.cpp fix_rigid_nvt.cpp fix_rigid_small.cpp fix_setforce.cpp fix_shake.cpp fix_shear_history.cpp fix_spring.cpp fix_spring_rg.cpp fix_spring_self.cpp fix_srd.cpp fix_store.cpp fix_store_force.cpp fix_store_state.cpp fix_temp_berendsen.cpp fix_temp_rescale.cpp fix_thermal_conductivity.cpp fix_tmd.cpp fix_ttm.cpp fix_viscosity.cpp fix_viscous.cpp fix_wall.cpp fix_wall_colloid.cpp fix_wall_gran.cpp fix_wall_harmonic.cpp fix_wall_lj1043.cpp fix_wall_lj126.cpp fix_wall_lj93.cpp fix_wall_piston.cpp fix_wall_reflect.cpp fix_wall_region.cpp fix_wall_srd.cpp force.cpp group.cpp image.cpp improper.cpp improper_class2.cpp improper_cvff.cpp improper_harmonic.cpp improper_hybrid.cpp improper_umbrella.cpp input.cpp integrate.cpp irregular.cpp kspace.cpp lammps.cpp lattice.cpp library.cpp math_extra.cpp memory.cpp min.cpp min_cg.cpp min_fire.cpp min_hftn.cpp min_linesearch.cpp min_quickmin.cpp min_sd.cpp minimize.cpp modify.cpp molecule.cpp neb.cpp neigh_bond.cpp neigh_derive.cpp neigh_full.cpp neigh_gran.cpp neigh_half_bin.cpp neigh_half_multi.cpp neigh_half_nsq.cpp neigh_list.cpp neigh_request.cpp neigh_respa.cpp neigh_stencil.cpp neighbor.cpp output.cpp pair.cpp pair_adp.cpp pair_airebo.cpp pair_beck.cpp pair_body.cpp pair_bop.cpp pair_born.cpp pair_born_coul_wolf.cpp pair_brownian.cpp pair_brownian_poly.cpp pair_buck.cpp pair_buck_coul_cut.cpp pair_colloid.cpp pair_colloid_poly.cpp pair_comb.cpp pair_comb3.cpp pair_coul_cut.cpp pair_coul_debye.cpp pair_coul_dsf.cpp pair_coul_wolf.cpp pair_dipole_cut.cpp pair_dpd.cpp pair_dpd_tstat.cpp pair_dsmc.cpp pair_eam.cpp pair_eam_alloy.cpp pair_eam_alloy_opt.cpp pair_eam_fs.cpp pair_eam_fs_opt.cpp pair_eam_opt.cpp pair_eim.cpp pair_gauss.cpp pair_gayberne.cpp pair_gran_hertz_history.cpp pair_gran_hooke.cpp pair_gran_hooke_history.cpp pair_hbond_dreiding_lj.cpp pair_hbond_dreiding_morse.cpp pair_hybrid.cpp pair_hybrid_overlay.cpp pair_lcbop.cpp pair_line_lj.cpp pair_lj96_cut.cpp pair_lj_charmm_coul_charmm.cpp pair_lj_charmm_coul_charmm_implicit.cpp pair_lj_class2.cpp pair_lj_class2_coul_cut.cpp pair_lj_class2_coul_long.cpp pair_lj_cubic.cpp pair_lj_cut.cpp pair_lj_cut_coul_cut.cpp pair_lj_cut_coul_debye.cpp pair_lj_cut_coul_dsf.cpp pair_lj_cut_dipole_cut.cpp pair_lj_cut_dipole_long.cpp pair_lj_cut_opt.cpp pair_lj_cut_tip4p_cut.cpp pair_lj_expand.cpp pair_lj_gromacs.cpp pair_lj_gromacs_coul_gromacs.cpp pair_lj_long_dipole_long.cpp pair_lj_smooth.cpp pair_lj_smooth_linear.cpp pair_lubricate.cpp pair_lubricateU.cpp pair_lubricateU_poly.cpp pair_lubricate_poly.cpp pair_mie_cut.cpp pair_morse.cpp pair_morse_opt.cpp pair_nb3b_harmonic.cpp pair_nm_cut.cpp pair_nm_cut_coul_cut.cpp pair_nm_cut_coul_long.cpp pair_peri_lps.cpp pair_peri_pmb.cpp pair_peri_ves.cpp pair_rebo.cpp pair_resquared.cpp pair_soft.cpp pair_sw.cpp pair_table.cpp pair_tersoff.cpp pair_tersoff_mod.cpp pair_tersoff_zbl.cpp pair_tip4p_cut.cpp pair_tri_lj.cpp pair_yukawa.cpp pair_yukawa_colloid.cpp pair_zbl.cpp prd.cpp procmap.cpp random_mars.cpp random_park.cpp read_data.cpp read_dump.cpp read_restart.cpp reader.cpp reader_native.cpp reader_xyz.cpp region.cpp region_block.cpp region_cone.cpp region_cylinder.cpp region_intersect.cpp region_plane.cpp region_prism.cpp region_sphere.cpp region_union.cpp replicate.cpp rerun.cpp respa.cpp run.cpp set.cpp special.cpp tad.cpp temper.cpp thermo.cpp timer.cpp universe.cpp update.cpp variable.cpp velocity.cpp verlet.cpp verlet_split.cpp write_data.cpp write_dump.cpp write_restart.cpp xdr_compat.cpp
-INC = accelerator_cuda.h accelerator_omp.h angle.h angle_charmm.h angle_class2.h angle_cosine.h angle_cosine_delta.h angle_cosine_periodic.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h angle_table.h atom.h atom_map.h atom_masks.h atom_vec.h atom_vec_angle.h atom_vec_atomic.h atom_vec_body.h atom_vec_bond.h atom_vec_charge.h atom_vec_dipole.h atom_vec_ellipsoid.h atom_vec_full.h atom_vec_hybrid.h atom_vec_line.h atom_vec_molecular.h atom_vec_peri.h atom_vec_sphere.h atom_vec_tri.h balance.h body.h body_nparticle.h bond.h bond_class2.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h bond_table.h change_box.h comm.h compute.h compute_angle_local.h compute_atom_molecule.h compute_body_local.h compute_bond_local.h compute_centro_atom.h compute_cluster_atom.h compute_cna_atom.h compute_com.h compute_com_molecule.h compute_contact_atom.h compute_coord_atom.h compute_damage_atom.h compute_dihedral_local.h compute_displace_atom.h compute_erotate_asphere.h compute_erotate_sphere.h compute_erotate_sphere_atom.h compute_event_displace.h compute_group_group.h compute_gyration.h compute_gyration_molecule.h compute_heat_flux.h compute_improper_local.h compute_inertia_molecule.h compute_ke.h compute_ke_atom.h compute_msd.h compute_msd_molecule.h compute_pair.h compute_pair_local.h compute_pe.h compute_pe_atom.h compute_pressure.h compute_property_atom.h compute_property_local.h compute_property_molecule.h compute_rdf.h compute_reduce.h compute_reduce_region.h compute_slice.h compute_stress_atom.h compute_temp.h compute_temp_asphere.h compute_temp_com.h compute_temp_deform.h compute_temp_partial.h compute_temp_profile.h compute_temp_ramp.h compute_temp_region.h compute_temp_sphere.h compute_ti.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_class2.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_cfg.h dump_custom.h dump_dcd.h dump_image.h dump_local.h dump_xtc.h dump_xyz.h error.h finish.h fix.h fix_adapt.h fix_addforce.h fix_append_atoms.h fix_ave_atom.h fix_ave_correlate.h fix_ave_histo.h fix_ave_spatial.h fix_ave_time.h fix_aveforce.h fix_balance.h fix_bond_break.h fix_bond_create.h fix_bond_swap.h fix_box_relax.h fix_deform.h fix_deposit.h fix_drag.h fix_dt_reset.h fix_efield.h fix_enforce2d.h fix_evaporate.h fix_event.h fix_event_prd.h fix_event_tad.h fix_external.h fix_freeze.h fix_gcmc.h fix_gravity.h fix_heat.h fix_indent.h fix_langevin.h fix_lineforce.h fix_minimize.h fix_momentum.h fix_move.h fix_msst.h fix_neb.h fix_nh.h fix_nh_asphere.h fix_nh_sphere.h fix_nph.h fix_nph_asphere.h fix_nph_sphere.h fix_nphug.h fix_npt.h fix_npt_asphere.h fix_npt_sphere.h fix_nve.h fix_nve_asphere.h fix_nve_asphere_noforce.h fix_nve_body.h fix_nve_limit.h fix_nve_line.h fix_nve_noforce.h fix_nve_sphere.h fix_nve_tri.h fix_nvt.h fix_nvt_asphere.h fix_nvt_sllod.h fix_nvt_sphere.h fix_orient_fcc.h fix_peri_neigh.h fix_planeforce.h fix_pour.h fix_press_berendsen.h fix_print.h fix_qeq_comb.h fix_read_restart.h fix_recenter.h fix_respa.h fix_restrain.h fix_rigid.h fix_rigid_nh.h fix_rigid_nph.h fix_rigid_npt.h fix_rigid_nve.h fix_rigid_nvt.h fix_rigid_small.h fix_setforce.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_srd.h fix_store_force.h fix_store_state.h fix_temp_berendsen.h fix_temp_rescale.h fix_thermal_conductivity.h fix_tmd.h fix_ttm.h fix_viscosity.h fix_viscous.h fix_wall.h fix_wall_colloid.h fix_wall_gran.h fix_wall_harmonic.h fix_wall_lj126.h fix_wall_lj93.h fix_wall_piston.h fix_wall_reflect.h fix_wall_region.h fix_wall_srd.h force.h group.h image.h improper.h improper_class2.h improper_cvff.h improper_harmonic.h improper_hybrid.h improper_umbrella.h input.h integrate.h irregular.h kspace.h lammps.h lattice.h library.h lmptype.h lmpwindows.h math_const.h math_extra.h math_special.h memory.h min.h min_cg.h min_fire.h min_hftn.h min_linesearch.h min_quickmin.h min_sd.h minimize.h modify.h my_pool.h neb.h neigh_bond.h neigh_derive.h neigh_full.h neigh_gran.h neigh_half_bin.h neigh_half_multi.h neigh_half_nsq.h neigh_list.h neigh_request.h neigh_respa.h neighbor.h output.h pack.h pair.h pair_adp.h pair_airebo.h pair_beck.h pair_body.h pair_bop.h pair_born.h pair_born_coul_wolf.h pair_brownian.h pair_brownian_poly.h pair_buck.h pair_buck_coul_cut.h pair_colloid.h pair_comb.h pair_coul_cut.h pair_coul_debye.h pair_coul_dsf.h pair_coul_wolf.h pair_dipole_cut.h pair_dpd.h pair_dpd_tstat.h pair_dsmc.h pair_eam.h pair_eam_alloy.h pair_eam_alloy_opt.h pair_eam_fs.h pair_eam_fs_opt.h pair_eam_opt.h pair_eim.h pair_gauss.h pair_gayberne.h pair_gran_hertz_history.h pair_gran_hooke.h pair_gran_hooke_history.h pair_hbond_dreiding_lj.h pair_hbond_dreiding_morse.h pair_hybrid.h pair_hybrid_overlay.h pair_lcbop.h pair_line_lj.h pair_lj96_cut.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_class2.h pair_lj_class2_coul_cut.h pair_lj_class2_coul_long.h pair_lj_cubic.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_dsf.h pair_lj_cut_opt.h pair_lj_cut_tip4p_cut.h pair_lj_expand.h pair_lj_gromacs.h pair_lj_gromacs_coul_gromacs.h pair_lj_smooth.h pair_lj_smooth_linear.h pair_lubricate.h pair_lubricateU.h pair_lubricateU_poly.h pair_lubricate_poly.h pair_mie_cut.h pair_morse.h pair_morse_opt.h pair_peri_lps.h pair_peri_pmb.h pair_rebo.h pair_resquared.h pair_soft.h pair_sw.h pair_table.h pair_tersoff.h pair_tersoff_zbl.h pair_tri_lj.h pair_yukawa.h pair_yukawa_colloid.h pointers.h prd.h procmap.h random_mars.h random_park.h read_data.h read_dump.h read_restart.h reader.h reader_native.h reader_xyz.h region.h region_block.h region_cone.h region_cylinder.h region_intersect.h region_plane.h region_prism.h region_sphere.h region_union.h replicate.h rerun.h respa.h run.h set.h special.h style_angle.h style_atom.h style_body.h style_bond.h style_command.h style_compute.h style_dihedral.h style_dump.h style_fix.h style_improper.h style_integrate.h style_kspace.h style_minimize.h style_pair.h style_reader.h style_region.h suffix.h tad.h temper.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h verlet_split.h version.h write_restart.h xdr_compat.h
+INC = accelerator_cuda.h accelerator_omp.h angle.h angle_charmm.h angle_class2.h angle_cosine.h angle_cosine_delta.h angle_cosine_periodic.h angle_cosine_squared.h angle_harmonic.h angle_hybrid.h angle_table.h atom.h atom_map.h atom_masks.h atom_vec.h atom_vec_angle.h atom_vec_atomic.h atom_vec_body.h atom_vec_bond.h atom_vec_charge.h atom_vec_dipole.h atom_vec_ellipsoid.h atom_vec_full.h atom_vec_hybrid.h atom_vec_line.h atom_vec_molecular.h atom_vec_peri.h atom_vec_sphere.h atom_vec_tri.h balance.h body.h body_nparticle.h bond.h bond_class2.h bond_fene.h bond_fene_expand.h bond_harmonic.h bond_hybrid.h bond_morse.h bond_nonlinear.h bond_quartic.h bond_table.h change_box.h citeme.h comm.h compute.h compute_angle_local.h compute_atom_molecule.h compute_body_local.h compute_bond_local.h compute_centro_atom.h compute_cluster_atom.h compute_cna_atom.h compute_com.h compute_com_molecule.h compute_contact_atom.h compute_coord_atom.h compute_damage_atom.h compute_dihedral_local.h compute_displace_atom.h compute_erotate_asphere.h compute_erotate_rigid.h compute_erotate_sphere.h compute_erotate_sphere_atom.h compute_event_displace.h compute_group_group.h compute_gyration.h compute_gyration_molecule.h compute_heat_flux.h compute_improper_local.h compute_inertia_molecule.h compute_ke.h compute_ke_atom.h compute_ke_rigid.h compute_msd.h compute_msd_molecule.h compute_msd_nongauss.h compute_pair.h compute_pair_local.h compute_pe.h compute_pe_atom.h compute_pressure.h compute_property_atom.h compute_property_local.h compute_property_molecule.h compute_rdf.h compute_reduce.h compute_reduce_region.h compute_slice.h compute_stress_atom.h compute_temp.h compute_temp_asphere.h compute_temp_com.h compute_temp_deform.h compute_temp_partial.h compute_temp_profile.h compute_temp_ramp.h compute_temp_region.h compute_temp_sphere.h compute_ti.h compute_vacf.h create_atoms.h create_box.h delete_atoms.h delete_bonds.h dihedral.h dihedral_charmm.h dihedral_class2.h dihedral_harmonic.h dihedral_helix.h dihedral_hybrid.h dihedral_multi_harmonic.h dihedral_opls.h displace_atoms.h domain.h dump.h dump_atom.h dump_cfg.h dump_custom.h dump_dcd.h dump_image.h dump_local.h dump_movie.h dump_xtc.h dump_xyz.h error.h finish.h fix.h fix_adapt.h fix_addforce.h fix_append_atoms.h fix_ave_atom.h fix_ave_correlate.h fix_ave_histo.h fix_ave_spatial.h fix_ave_time.h fix_aveforce.h fix_balance.h fix_bond_break.h fix_bond_create.h fix_bond_swap.h fix_box_relax.h fix_deform.h fix_deposit.h fix_drag.h fix_dt_reset.h fix_efield.h fix_enforce2d.h fix_evaporate.h fix_event.h fix_event_prd.h fix_event_tad.h fix_external.h fix_freeze.h fix_gcmc.h fix_gld.h fix_gravity.h fix_heat.h fix_indent.h fix_langevin.h fix_lineforce.h fix_minimize.h fix_momentum.h fix_move.h fix_msst.h fix_neb.h fix_nh.h fix_nh_asphere.h fix_nh_sphere.h fix_nph.h fix_nph_asphere.h fix_nph_sphere.h fix_nphug.h fix_npt.h fix_npt_asphere.h fix_npt_sphere.h fix_nve.h fix_nve_asphere.h fix_nve_asphere_noforce.h fix_nve_body.h fix_nve_limit.h fix_nve_line.h fix_nve_noforce.h fix_nve_sphere.h fix_nve_tri.h fix_nvt.h fix_nvt_asphere.h fix_nvt_sllod.h fix_nvt_sphere.h fix_orient_fcc.h fix_peri_neigh.h fix_planeforce.h fix_pour.h fix_press_berendsen.h fix_print.h fix_property_atom.h fix_qeq_comb.h fix_read_restart.h fix_recenter.h fix_respa.h fix_restrain.h fix_rigid.h fix_rigid_nh.h fix_rigid_nph.h fix_rigid_npt.h fix_rigid_nve.h fix_rigid_nvt.h fix_rigid_small.h fix_setforce.h fix_shake.h fix_shear_history.h fix_spring.h fix_spring_rg.h fix_spring_self.h fix_srd.h fix_store.h fix_store_force.h fix_store_state.h fix_temp_berendsen.h fix_temp_rescale.h fix_thermal_conductivity.h fix_tmd.h fix_ttm.h fix_viscosity.h fix_viscous.h fix_wall.h fix_wall_colloid.h fix_wall_gran.h fix_wall_harmonic.h fix_wall_lj1043.h fix_wall_lj126.h fix_wall_lj93.h fix_wall_piston.h fix_wall_reflect.h fix_wall_region.h fix_wall_srd.h force.h group.h image.h improper.h improper_class2.h improper_cvff.h improper_harmonic.h improper_hybrid.h improper_umbrella.h input.h integrate.h irregular.h kspace.h lammps.h lattice.h library.h lmptype.h lmpwindows.h math_complex.h math_const.h math_extra.h math_special.h math_vector.h memory.h min.h min_cg.h min_fire.h min_hftn.h min_linesearch.h min_quickmin.h min_sd.h minimize.h modify.h molecule.h mpiio.h my_page.h my_pool_chunk.h neb.h neigh_bond.h neigh_derive.h neigh_full.h neigh_gran.h neigh_half_bin.h neigh_half_multi.h neigh_half_nsq.h neigh_list.h neigh_request.h neigh_respa.h neighbor.h output.h pack.h pair.h pair_adp.h pair_airebo.h pair_beck.h pair_body.h pair_bop.h pair_born.h pair_born_coul_wolf.h pair_brownian.h pair_brownian_poly.h pair_buck.h pair_buck_coul_cut.h pair_colloid.h pair_colloid_poly.h pair_comb.h pair_comb3.h pair_coul_cut.h pair_coul_debye.h pair_coul_dsf.h pair_coul_wolf.h pair_dipole_cut.h pair_dpd.h pair_dpd_tstat.h pair_dsmc.h pair_eam.h pair_eam_alloy.h pair_eam_alloy_opt.h pair_eam_fs.h pair_eam_fs_opt.h pair_eam_opt.h pair_eim.h pair_gauss.h pair_gayberne.h pair_gran_hertz_history.h pair_gran_hooke.h pair_gran_hooke_history.h pair_hbond_dreiding_lj.h pair_hbond_dreiding_morse.h pair_hybrid.h pair_hybrid_overlay.h pair_lcbop.h pair_line_lj.h pair_lj96_cut.h pair_lj_charmm_coul_charmm.h pair_lj_charmm_coul_charmm_implicit.h pair_lj_class2.h pair_lj_class2_coul_cut.h pair_lj_class2_coul_long.h pair_lj_cubic.h pair_lj_cut.h pair_lj_cut_coul_cut.h pair_lj_cut_coul_debye.h pair_lj_cut_coul_dsf.h pair_lj_cut_dipole_cut.h pair_lj_cut_dipole_long.h pair_lj_cut_opt.h pair_lj_cut_tip4p_cut.h pair_lj_expand.h pair_lj_gromacs.h pair_lj_gromacs_coul_gromacs.h pair_lj_long_dipole_long.h pair_lj_smooth.h pair_lj_smooth_linear.h pair_lubricate.h pair_lubricateU.h pair_lubricateU_poly.h pair_lubricate_poly.h pair_mie_cut.h pair_morse.h pair_morse_opt.h pair_nb3b_harmonic.h pair_nm_cut.h pair_nm_cut_coul_cut.h pair_nm_cut_coul_long.h pair_peri_lps.h pair_peri_pmb.h pair_peri_ves.h pair_rebo.h pair_resquared.h pair_soft.h pair_sw.h pair_table.h pair_tersoff.h pair_tersoff_mod.h pair_tersoff_zbl.h pair_tip4p_cut.h pair_tri_lj.h pair_yukawa.h pair_yukawa_colloid.h pair_zbl.h pointers.h prd.h procmap.h random_mars.h random_park.h read_data.h read_dump.h read_restart.h reader.h reader_native.h reader_xyz.h region.h region_block.h region_cone.h region_cylinder.h region_intersect.h region_plane.h region_prism.h region_sphere.h region_union.h replicate.h rerun.h respa.h run.h set.h special.h style_angle.h style_atom.h style_body.h style_bond.h style_command.h style_compute.h style_dihedral.h style_dump.h style_fix.h style_improper.h style_integrate.h style_kspace.h style_minimize.h style_pair.h style_reader.h style_region.h suffix.h tad.h temper.h thermo.h timer.h universe.h update.h variable.h velocity.h verlet.h verlet_split.h version.h write_data.h write_dump.h write_restart.h xdr_compat.h
OBJ = $(SRC:.cpp=.o)
diff --git a/src/OPT/pair_lj_cut_tip4p_long_opt.cpp b/src/OPT/pair_lj_cut_tip4p_long_opt.cpp
index 30ef318799..e045eeec75 100644
--- a/src/OPT/pair_lj_cut_tip4p_long_opt.cpp
+++ b/src/OPT/pair_lj_cut_tip4p_long_opt.cpp
@@ -125,6 +125,7 @@ void PairLJCutTIP4PLongOpt::eval()
const double * const * const x = atom->x;
double * const * const f = atom->f;
const double * const q = atom->q;
+ const tagint * const tag = atom->tag;
const int * const type = atom->type;
const int nlocal = atom->nlocal;
const double * const special_coul = force->special_coul;
@@ -154,8 +155,8 @@ void PairLJCutTIP4PLongOpt::eval()
if (itype == typeO) {
if (hneigh[i][0] < 0) {
- hneigh[i][0] = iH1 = atom->map(atom->tag[i] + 1);
- hneigh[i][1] = iH2 = atom->map(atom->tag[i] + 2);
+ hneigh[i][0] = iH1 = atom->map(tag[i] + 1);
+ hneigh[i][1] = iH2 = atom->map(tag[i] + 2);
hneigh[i][2] = 1;
if (iH1 == -1 || iH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
@@ -225,8 +226,8 @@ void PairLJCutTIP4PLongOpt::eval()
if (jtype == typeO) {
if (hneigh[j][0] < 0) {
- hneigh[j][0] = jH1 = atom->map(atom->tag[j] + 1);
- hneigh[j][1] = jH2 = atom->map(atom->tag[j] + 2);
+ hneigh[j][0] = jH1 = atom->map(tag[j] + 1);
+ hneigh[j][1] = jH2 = atom->map(tag[j] + 2);
hneigh[j][2] = 1;
if (jH1 == -1 || jH2 == -1)
error->one(FLERR,"TIP4P hydrogen is missing");
diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp
index 28e7ff1db9..c2791ce01f 100644
--- a/src/PERI/atom_vec_peri.cpp
+++ b/src/PERI/atom_vec_peri.cpp
@@ -517,7 +517,7 @@ void AtomVecPeri::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
vfrac[i] = buf[m++];
@@ -546,7 +546,7 @@ void AtomVecPeri::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
vfrac[i] = buf[m++];
@@ -631,7 +631,7 @@ int AtomVecPeri::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -725,7 +725,7 @@ int AtomVecPeri::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -792,10 +792,7 @@ void AtomVecPeri::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -881,8 +878,9 @@ int AtomVecPeri::pack_data_hybrid(int i, double *buf)
void AtomVecPeri::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
(int) ubuf(buf[i][9]).i);
diff --git a/src/PERI/atom_vec_peri.h b/src/PERI/atom_vec_peri.h
index 710f19ce1e..d1ab764134 100644
--- a/src/PERI/atom_vec_peri.h
+++ b/src/PERI/atom_vec_peri.h
@@ -59,7 +59,8 @@ class AtomVecPeri : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *vfrac,*density,*rmass,*s0,**x0;
diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp
index bd8228faf5..9b51cd34b3 100644
--- a/src/PERI/compute_damage_atom.cpp
+++ b/src/PERI/compute_damage_atom.cpp
@@ -90,7 +90,7 @@ void ComputeDamageAtom::compute_peratom()
int *mask = atom->mask;
double *vfrac = atom->vfrac;
double *vinter = ((FixPeriNeigh *) modify->fix[ifix_peri])->vinter;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
int i,j,jj,jnum;
diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp
index a7ef294140..cd6e3d5c81 100644
--- a/src/PERI/fix_peri_neigh.cpp
+++ b/src/PERI/fix_peri_neigh.cpp
@@ -152,7 +152,7 @@ void FixPeriNeigh::setup(int vflag)
double **x = atom->x;
double *vfrac = atom->vfrac;
int *type = atom->type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
// only build list of bonds on very first run
@@ -450,7 +450,7 @@ int FixPeriNeigh::unpack_exchange(int nlocal, double *buf)
int m = 0;
npartner[nlocal] = static_cast (buf[m++]);
for (int n = 0; n < npartner[nlocal]; n++) {
- partner[nlocal][n] = static_cast (buf[m++]);
+ partner[nlocal][n] = static_cast (buf[m++]);
if (isVES) {
deviatorextention[nlocal][n] = buf[m++];
deviatorBackextention[nlocal][n] = buf[m++];
@@ -565,7 +565,7 @@ void FixPeriNeigh::unpack_restart(int nlocal, int nth)
npartner[nlocal] = static_cast (extra[nlocal][m++]);
for (int n = 0; n < npartner[nlocal]; n++) {
- partner[nlocal][n] = static_cast (extra[nlocal][m++]);
+ partner[nlocal][n] = static_cast (extra[nlocal][m++]);
if (isVES) {
deviatorextention[nlocal][n] = extra[nlocal][m++];
deviatorBackextention[nlocal][n] = extra[nlocal][m++];
diff --git a/src/PERI/fix_peri_neigh.h b/src/PERI/fix_peri_neigh.h
index 70a50131eb..cdde88c373 100644
--- a/src/PERI/fix_peri_neigh.h
+++ b/src/PERI/fix_peri_neigh.h
@@ -60,7 +60,7 @@ class FixPeriNeigh : public Fix {
int first; // flag for first time initialization
int maxpartner; // max # of peridynamic neighs for any atom
int *npartner; // # of neighbors for each atom
- int **partner; // neighs for each atom, stored as global IDs
+ tagint **partner; // neighs for each atom, stored as global IDs
double **deviatorextention; // Deviatoric extention
double **deviatorBackextention; // Deviatoric back extention
double **r0; // initial distance to partners
diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp
index a140c77e5c..639ac6fb43 100644
--- a/src/PERI/pair_peri_lps.cpp
+++ b/src/PERI/pair_peri_lps.cpp
@@ -104,7 +104,7 @@ void PairPeriLPS::compute(int eflag, int vflag)
double *s0 = atom->s0;
double **x0 = atom->x0;
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
@@ -550,7 +550,7 @@ void PairPeriLPS::compute_dilatation()
double half_lc = 0.5*lc;
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp
index 439f4b5d09..77ca26d1e3 100644
--- a/src/PERI/pair_peri_pmb.cpp
+++ b/src/PERI/pair_peri_pmb.cpp
@@ -96,7 +96,7 @@ void PairPeriPMB::compute(int eflag, int vflag)
double *s0 = atom->s0;
double **x0 = atom->x0;
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
// lc = lattice constant
@@ -450,7 +450,7 @@ double PairPeriPMB::single(int i, int j, int itype, int jtype, double rsq,
double *vfrac = atom->vfrac;
double **x0 = atom->x0;
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
double lc = domain->lattice->xlattice;
diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp
index 5586abc965..ec7852feb5 100644
--- a/src/PERI/pair_peri_ves.cpp
+++ b/src/PERI/pair_peri_ves.cpp
@@ -115,7 +115,7 @@ void PairPeriVES::compute(int eflag, int vflag)
((FixPeriNeigh *) modify->fix[ifix_peri])->deviatorextention;
double **deviatorBackextention =
((FixPeriNeigh *) modify->fix[ifix_peri])->deviatorBackextention;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
@@ -621,7 +621,7 @@ void PairPeriVES::compute_dilatation()
double half_lc = 0.5*lc;
double **r0 = ((FixPeriNeigh *) modify->fix[ifix_peri])->r0;
- int **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
+ tagint **partner = ((FixPeriNeigh *) modify->fix[ifix_peri])->partner;
int *npartner = ((FixPeriNeigh *) modify->fix[ifix_peri])->npartner;
double *wvolume = ((FixPeriNeigh *) modify->fix[ifix_peri])->wvolume;
diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp
index 2c353da233..cb983c8fec 100644
--- a/src/POEMS/fix_poems.cpp
+++ b/src/POEMS/fix_poems.cpp
@@ -974,7 +974,7 @@ void FixPOEMS::jointbuild()
// an atom in N rigid bodies, infers N-1 joints between 1st body and others
// mylist = [0],[1] = 2 body indices, [2] = global ID of joint atom
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int mjoint = 0;
@@ -983,7 +983,7 @@ void FixPOEMS::jointbuild()
mjoint += natom2body[i]-1;
}
- int **mylist = NULL;
+ tagint **mylist = NULL;
if (mjoint) memory->create(mylist,mjoint,3,"poems:mylist");
mjoint = 0;
@@ -1000,7 +1000,7 @@ void FixPOEMS::jointbuild()
// jlist = mylist concatenated across all procs via MPI_Allgatherv
MPI_Allreduce(&mjoint,&njoint,1,MPI_INT,MPI_SUM,world);
- int **jlist = NULL;
+ tagint **jlist = NULL;
if (njoint) memory->create(jlist,njoint,3,"poems:jlist");
int nprocs;
@@ -1019,11 +1019,11 @@ void FixPOEMS::jointbuild()
if (njoint) {
if (mjoint)
- MPI_Allgatherv(mylist[0],3*mjoint,MPI_INT,jlist[0],
- recvcounts,displs,MPI_INT,world);
+ MPI_Allgatherv(mylist[0],3*mjoint,MPI_LMP_TAGINT,jlist[0],
+ recvcounts,displs,MPI_LMP_TAGINT,world);
else
- MPI_Allgatherv(NULL,3*mjoint,MPI_INT,jlist[0],
- recvcounts,displs,MPI_INT,world);
+ MPI_Allgatherv(NULL,3*mjoint,MPI_LMP_TAGINT,jlist[0],
+ recvcounts,displs,MPI_LMP_TAGINT,world);
}
delete [] recvcounts;
@@ -1032,7 +1032,8 @@ void FixPOEMS::jointbuild()
// warning if no joints
if (njoint == 0 && me == 0)
- error->warning(FLERR,"No joints between rigid bodies, use fix rigid instead");
+ error->warning(FLERR,
+ "No joints between rigid bodies, use fix rigid instead");
// sort joint list in ascending order by body indices
// check for loops in joint connections between rigid bodies
@@ -1050,7 +1051,8 @@ void FixPOEMS::jointbuild()
bodyflag[jlist[i][1]]++;
}
for (i = 0; i < nbody; i++)
- if (bodyflag[i] > 2) error->all(FLERR,"Tree structure in joint connections");
+ if (bodyflag[i] > 2)
+ error->all(FLERR,"Tree structure in joint connections");
delete [] bodyflag;
// allocate and setup joint arrays
@@ -1115,9 +1117,10 @@ void FixPOEMS::jointbuild()
sort criterion: sort on 1st body, if equal sort on 2nd body
------------------------------------------------------------------------- */
-void FixPOEMS::sortlist(int n, int **list)
+void FixPOEMS::sortlist(int n, tagint **list)
{
- int i,j,v0,v1,v2,flag;
+ int i,j,flag;
+ tagint v0,v1,v2;
int inc = 1;
while (inc <= n) inc = 3*inc + 1;
@@ -1154,7 +1157,7 @@ void FixPOEMS::sortlist(int n, int **list)
treat as graph: vertex = body, edge = joint between 2 bodies
------------------------------------------------------------------------- */
-int FixPOEMS::loopcheck(int nvert, int nedge, int **elist)
+int FixPOEMS::loopcheck(int nvert, int nedge, tagint **elist)
{
int i,j,k;
diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h
index 240650ac9b..485cb800fd 100644
--- a/src/POEMS/fix_poems.h
+++ b/src/POEMS/fix_poems.h
@@ -99,8 +99,8 @@ class FixPOEMS : public Fix {
void readfile(char *);
int readline(FILE *, char **, int *);
void jointbuild();
- void sortlist(int, int **);
- int loopcheck(int, int, int **);
+ void sortlist(int, tagint **);
+ int loopcheck(int, int, tagint **);
int jacobi(double **, double *, double **);
void rotate(double **, int, int, int, int, double, double);
void omega_from_mq(double *, double *, double *, double *,
diff --git a/src/REAX/fix_reax_bonds.cpp b/src/REAX/fix_reax_bonds.cpp
index 3e505c8d63..fd7a254321 100644
--- a/src/REAX/fix_reax_bonds.cpp
+++ b/src/REAX/fix_reax_bonds.cpp
@@ -15,6 +15,10 @@
Contributing author: Aidan Thompson (Sandia)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG is not supported by the REAX package
+#endif
+
#include "stdlib.h"
#include "string.h"
#include "fix_reax_bonds.h"
diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp
index cbe92d81ba..f1f5018724 100644
--- a/src/REPLICA/neb.cpp
+++ b/src/REPLICA/neb.cpp
@@ -335,8 +335,8 @@ void NEB::run()
void NEB::readfile(char *file, int flag)
{
- int i,j,m,nchunk,tag,eofflag;
- int nlines;
+ int i,j,m,nchunk,eofflag,nlines;
+ tagint tag;
char *eof,*start,*next,*buf;
char line[MAXLINE];
double xx,yy,zz,delx,dely,delz;
@@ -430,7 +430,7 @@ void NEB::readfile(char *file, int flag)
// will be remapped back into box when simulation starts
// its image flags will then be adjusted
- tag = atoi(values[0]);
+ tag = ATOTAGINT(values[0]);
m = atom->map(tag);
if (m >= 0 && m < nlocal) {
ncount++;
diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp
index 1df75c8f94..9efb687206 100644
--- a/src/REPLICA/prd.cpp
+++ b/src/REPLICA/prd.cpp
@@ -737,8 +737,8 @@ void PRD::replicate(int ireplica)
displacements[0] = 0;
for (i = 0; i < nprocs-1; i++)
displacements[i+1] = displacements[i] + counts[i];
- MPI_Gatherv(atom->tag,atom->nlocal,MPI_INT,
- tagall,counts,displacements,MPI_INT,0,world);
+ MPI_Gatherv(atom->tag,atom->nlocal,MPI_LMP_TAGINT,
+ tagall,counts,displacements,MPI_LMP_TAGINT,0,world);
MPI_Gatherv(atom->image,atom->nlocal,MPI_INT,
imageall,counts,displacements,MPI_INT,0,world);
for (i = 0; i < nprocs; i++) counts[i] *= 3;
diff --git a/src/REPLICA/prd.h b/src/REPLICA/prd.h
index ad979ff222..5f8e833235 100644
--- a/src/REPLICA/prd.h
+++ b/src/REPLICA/prd.h
@@ -46,7 +46,8 @@ class PRD : protected Pointers {
double time_start;
MPI_Comm comm_replica;
- int *tagall,*displacements,*imageall;
+ tagint *tagall;
+ int *displacements,*imageall;
double **xall;
int ncoincident;
diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp
index 5d341f80f4..1b1d06ab05 100644
--- a/src/REPLICA/verlet_split.cpp
+++ b/src/REPLICA/verlet_split.cpp
@@ -471,7 +471,8 @@ void VerletSplit::rk_setup()
if (tip4p_flag) {
//r2k_comm();
MPI_Gatherv(atom->type,n,MPI_INT,atom->type,qsize,qdisp,MPI_INT,0,block);
- MPI_Gatherv(atom->tag,n,MPI_INT,atom->tag,qsize,qdisp,MPI_INT,0,block);
+ MPI_Gatherv(atom->tag,n,MPI_LMP_TAGINT,
+ atom->tag,qsize,qdisp,MPI_LMP_TAGINT,0,block);
if (!master) {
if (triclinic) domain->x2lamda(atom->nlocal);
if (domain->box_change) comm->setup();
diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp
index 6bda63ba11..f9b22eed0f 100644
--- a/src/RIGID/fix_rigid_small.cpp
+++ b/src/RIGID/fix_rigid_small.cpp
@@ -182,7 +182,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
// set nlocal_body and allocate bodies I own
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
nlocal_body = nghost_body = 0;
for (i = 0; i < nlocal; i++)
@@ -1346,14 +1346,14 @@ void FixRigidSmall::create_bodies()
// pack my atoms into buffer as molecule ID, atom ID, unwrapped coords
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
m = 0;
for (i = 0; i < nlocal; i++) {
if (!(mask[i] & groupbit)) continue;
domain->unmap(x[i],image[i],unwrap);
buf[m++] = molecule[i];
- buf[m++] = tag[i];
+ buf[m++] = ubuf(tag[i]).d;
buf[m++] = unwrap[0];
buf[m++] = unwrap[1];
buf[m++] = unwrap[2];
@@ -1384,7 +1384,7 @@ void FixRigidSmall::create_bodies()
for (i = 0; i < nlocal; i++) {
if (!(mask[i] & groupbit)) continue;
domain->unmap(x[i],image[i],unwrap);
- buf[m++] = bodytag[i];
+ buf[m++] = ubuf(bodytag[i]).i;
buf[m++] = unwrap[0];
buf[m++] = unwrap[1];
buf[m++] = unwrap[2];
@@ -1456,13 +1456,14 @@ void FixRigidSmall::ring_nearest(int n, char *cbuf)
{
std::map *hash = frsptr->hash;
double **ctr = frsptr->ctr;
- int *idclose = frsptr->idclose;
+ tagint *idclose = frsptr->idclose;
double *rsqclose = frsptr->rsqclose;
double *buf = (double *) cbuf;
int ndatums = n/5;
- int j,imol,tag;
+ int j,imol;
+ tagint tag;
double delx,dely,delz,rsq;
double *x;
@@ -1471,7 +1472,7 @@ void FixRigidSmall::ring_nearest(int n, char *cbuf)
imol = static_cast (buf[m]);
if (hash->find(imol) != hash->end()) {
j = hash->find(imol)->second;
- tag = static_cast (buf[m+1]);
+ tag = (tagint) ubuf(buf[m+1]).i;
x = &buf[m+2];
delx = x[0] - ctr[j][0];
dely = x[1] - ctr[j][1];
@@ -1500,15 +1501,16 @@ void FixRigidSmall::ring_farthest(int n, char *cbuf)
double *buf = (double *) cbuf;
int ndatums = n/4;
- int itag,iowner;
+ int iowner;
+ tagint tag;
double delx,dely,delz,rsq;
double *xx;
double unwrap[3];
int m = 0;
for (int i = 0; i < ndatums; i++, m += 4) {
- itag = static_cast (buf[m]);
- iowner = frsptr->atom->map(itag);
+ tag = (tagint) ubuf(buf[m]).i;
+ iowner = frsptr->atom->map(tag);
if (iowner < 0 || iowner >= nlocal) continue;
frsptr->domain->unmap(x[iowner],image[iowner],unwrap);
xx = &buf[m+1];
@@ -2433,7 +2435,7 @@ void FixRigidSmall::set_arrays(int i)
relative to template in Molecule class
------------------------------------------------------------------------- */
-void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
+void FixRigidSmall::set_molecule(int nlocalprev, tagint tagprev,
double *xgeom, double *vcm, double *quat)
{
int m;
@@ -2444,7 +2446,7 @@ void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
if (nlocalprev == nlocal) return;
double **x = atom->x;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int i = nlocalprev; i < nlocal; i++) {
bodytag[i] = tagprev + onemol->comatom;
@@ -2504,7 +2506,7 @@ void FixRigidSmall::set_molecule(int nlocalprev, int tagprev,
int FixRigidSmall::pack_exchange(int i, double *buf)
{
- buf[0] = bodytag[i];
+ buf[0] = ubuf(bodytag[i]).d;
buf[1] = displace[i][0];
buf[2] = displace[i][1];
buf[3] = displace[i][2];
@@ -2548,7 +2550,7 @@ int FixRigidSmall::pack_exchange(int i, double *buf)
int FixRigidSmall::unpack_exchange(int nlocal, double *buf)
{
- bodytag[nlocal] = static_cast (buf[0]);
+ bodytag[nlocal] = (tagint) ubuf(buf[0]).i;
displace[nlocal][0] = buf[1];
displace[nlocal][1] = buf[2];
displace[nlocal][2] = buf[3];
@@ -2929,8 +2931,8 @@ void FixRigidSmall::reset_atom2body()
if (iowner == -1) {
char str[128];
sprintf(str,
- "Rigid body atoms %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ "Rigid body atoms " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
atom->tag[i],bodytag[i],comm->me,update->ntimestep);
error->one(FLERR,str);
diff --git a/src/RIGID/fix_rigid_small.h b/src/RIGID/fix_rigid_small.h
index 5cc63c3dd6..6f73a9c03a 100644
--- a/src/RIGID/fix_rigid_small.h
+++ b/src/RIGID/fix_rigid_small.h
@@ -48,7 +48,7 @@ class FixRigidSmall : public Fix {
void grow_arrays(int);
void copy_arrays(int, int, int);
void set_arrays(int);
- void set_molecule(int, int, double *, double *, double *);
+ void set_molecule(int, tagint, double *, double *, double *);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
@@ -112,7 +112,7 @@ class FixRigidSmall : public Fix {
// only defined for owned atoms, except bodyown for own+ghost
int *bodyown; // index of body if atom owns a body, -1 if not
- int *bodytag; // ID of body this atom is in, 0 if none
+ tagint *bodytag; // ID of body this atom is in, 0 if none
// ID = tag of atom that owns body
int *atom2body; // index of owned/ghost body this atom is in, -1 if not
// can point to original or any image of the body
@@ -160,7 +160,7 @@ class FixRigidSmall : public Fix {
std::map *hash;
double **bbox;
double **ctr;
- int *idclose;
+ tagint *idclose;
double *rsqclose;
double rsqfar;
diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp
index 4cc4466763..92f63d1758 100644
--- a/src/RIGID/fix_shake.cpp
+++ b/src/RIGID/fix_shake.cpp
@@ -66,7 +66,8 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) :
// register with Atom class
shake_flag = NULL;
- shake_atom = shake_type = NULL;
+ shake_atom = NULL;
+ shake_type = NULL;
xshake = NULL;
grow_arrays(atom->nmax);
@@ -493,8 +494,8 @@ void FixShake::pre_neighbor()
atom2 = atom->map(shake_atom[i][1]);
if (atom1 == -1 || atom2 == -1) {
char str[128];
- sprintf(str,
- "Shake atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+ sprintf(str,"Shake atoms " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],me,update->ntimestep);
error->one(FLERR,str);
}
@@ -505,9 +506,9 @@ void FixShake::pre_neighbor()
atom3 = atom->map(shake_atom[i][2]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1) {
char str[128];
- sprintf(str,
- "Shake atoms %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Shake atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],shake_atom[i][2],
me,update->ntimestep);
error->one(FLERR,str);
@@ -520,9 +521,10 @@ void FixShake::pre_neighbor()
atom4 = atom->map(shake_atom[i][3]);
if (atom1 == -1 || atom2 == -1 || atom3 == -1 || atom4 == -1) {
char str[128];
- sprintf(str,
- "Shake atoms %d %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Shake atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
shake_atom[i][0],shake_atom[i][1],
shake_atom[i][2],shake_atom[i][3],
me,update->ntimestep);
@@ -618,7 +620,7 @@ int FixShake::dof(int igroup)
int groupbit = group->bitmask[igroup];
int *mask = atom->mask;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
// count dof in a cluster if and only if
@@ -653,13 +655,13 @@ void FixShake::find_clusters()
int i,j,m,n;
int flag,flag_all,messtag,nbuf,nbufmax,size;
double massone;
- int *buf;
+ tagint *buf;
if (me == 0 && screen) fprintf(screen,"Finding SHAKE clusters ...\n");
// local copies of atom ptrs
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double *mass = atom->mass;
@@ -667,7 +669,7 @@ void FixShake::find_clusters()
int **bond_type = atom->bond_type;
int **angle_type = atom->angle_type;
int **nspecial = atom->nspecial;
- int **special = atom->special;
+ tagint **special = atom->special;
int nlocal = atom->nlocal;
int angles_allow = atom->avec->angles_allow;
@@ -700,8 +702,9 @@ void FixShake::find_clusters()
memory->create(npartner,nlocal,"shake:npartner");
memory->create(nshake,nlocal,"shake:nshake");
- int **partner_tag,**partner_mask,**partner_type,**partner_massflag;
- int ** partner_bondtype,**partner_shake,**partner_nshake;
+ tagint **partner_tag;
+ int **partner_mask,**partner_type,**partner_massflag;
+ int **partner_bondtype,**partner_shake,**partner_nshake;
memory->create(partner_tag,nlocal,max,"shake:partner_tag");
memory->create(partner_mask,nlocal,max,"shake:partner_mask");
memory->create(partner_type,nlocal,max,"shake:partner_type");
@@ -716,7 +719,8 @@ void FixShake::find_clusters()
for (i = 0; i < nlocal; i++) {
npartner[i] = nspecial[i][0];
- for (j = 0; j < npartner[i]; j++) partner_tag[i][j] = special[i][j];
+ for (j = 0; j < npartner[i]; j++)
+ partner_tag[i][j] = special[i][j];
}
// -----------------------------------------------------
@@ -784,7 +788,7 @@ void FixShake::find_clusters()
// cycle buffer around ring of procs back to self
fsptr = this;
- comm->ring(size,sizeof(int),buf,1,ring_bonds,buf);
+ comm->ring(size,sizeof(tagint),buf,1,ring_bonds,buf);
// store partner info returned to me
@@ -910,7 +914,7 @@ void FixShake::find_clusters()
// cycle buffer around ring of procs back to self
fsptr = this;
- comm->ring(size,sizeof(int),buf,2,ring_nshake,buf);
+ comm->ring(size,sizeof(tagint),buf,2,ring_nshake,buf);
// store partner info returned to me
@@ -1064,7 +1068,7 @@ void FixShake::find_clusters()
// cycle buffer around ring of procs back to self
fsptr = this;
- comm->ring(size,sizeof(int),buf,3,ring_shake,NULL);
+ comm->ring(size,sizeof(tagint),buf,3,ring_shake,NULL);
memory->destroy(buf);
@@ -1171,7 +1175,7 @@ void FixShake::ring_bonds(int ndatum, char *cbuf)
int nlocal = atom->nlocal;
int nmass = fsptr->nmass;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int m,n;
double massone;
@@ -1205,7 +1209,7 @@ void FixShake::ring_nshake(int ndatum, char *cbuf)
int *nshake = fsptr->nshake;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int m;
for (int i = 0; i < ndatum; i += 3) {
@@ -1225,10 +1229,10 @@ void FixShake::ring_shake(int ndatum, char *cbuf)
int nlocal = atom->nlocal;
int *shake_flag = fsptr->shake_flag;
- int **shake_atom = fsptr->shake_atom;
+ tagint **shake_atom = fsptr->shake_atom;
int **shake_type = fsptr->shake_type;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int m;
for (int i = 0; i < ndatum; i += 9) {
@@ -2232,10 +2236,10 @@ void FixShake::stats()
return bond index if do find it
------------------------------------------------------------------------- */
-int FixShake::bondfind(int i, int n1, int n2)
+int FixShake::bondfind(int i, tagint n1, tagint n2)
{
- int *tag = atom->tag;
- int **bond_atom = atom->bond_atom;
+ tagint *tag = atom->tag;
+ tagint **bond_atom = atom->bond_atom;
int nbonds = atom->num_bond[i];
int m;
@@ -2253,10 +2257,10 @@ int FixShake::bondfind(int i, int n1, int n2)
return angle index if do find it
------------------------------------------------------------------------- */
-int FixShake::anglefind(int i, int n1, int n2)
+int FixShake::anglefind(int i, tagint n1, tagint n2)
{
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom3 = atom->angle_atom3;
int nangles = atom->num_angle[i];
int m;
@@ -2377,7 +2381,7 @@ void FixShake::update_arrays(int i, int atom_offset)
xgeom,vcm,quat ignored
------------------------------------------------------------------------- */
-void FixShake::set_molecule(int nlocalprev, int tagprev,
+void FixShake::set_molecule(int nlocalprev, tagint tagprev,
double *xgeom, double *vcm, double *quat)
{
int m,flag;
@@ -2385,7 +2389,7 @@ void FixShake::set_molecule(int nlocalprev, int tagprev,
int nlocal = atom->nlocal;
if (nlocalprev == nlocal) return;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int **mol_shake_atom = onemol->shake_atom;
int **mol_shake_type = onemol->shake_type;
@@ -2470,27 +2474,27 @@ int FixShake::unpack_exchange(int nlocal, double *buf)
int m = 0;
int flag = shake_flag[nlocal] = static_cast (buf[m++]);
if (flag == 1) {
- shake_atom[nlocal][0] = static_cast (buf[m++]);
- shake_atom[nlocal][1] = static_cast (buf[m++]);
- shake_atom[nlocal][2] = static_cast (buf[m++]);
+ shake_atom[nlocal][0] = static_cast (buf[m++]);
+ shake_atom[nlocal][1] = static_cast (buf[m++]);
+ shake_atom[nlocal][2] = static_cast (buf[m++]);
shake_type[nlocal][0] = static_cast (buf[m++]);
shake_type[nlocal][1] = static_cast (buf[m++]);
shake_type[nlocal][2] = static_cast (buf[m++]);
} else if (flag == 2) {
- shake_atom[nlocal][0] = static_cast (buf[m++]);
- shake_atom[nlocal][1] = static_cast (buf[m++]);
+ shake_atom[nlocal][0] = static_cast (buf[m++]);
+ shake_atom[nlocal][1] = static_cast (buf[m++]);
shake_type[nlocal][0] = static_cast (buf[m++]);
} else if (flag == 3) {
- shake_atom[nlocal][0] = static_cast (buf[m++]);
- shake_atom[nlocal][1] = static_cast (buf[m++]);
- shake_atom[nlocal][2] = static_cast (buf[m++]);
+ shake_atom[nlocal][0] = static_cast (buf[m++]);
+ shake_atom[nlocal][1] = static_cast (buf[m++]);
+ shake_atom[nlocal][2] = static_cast (buf[m++]);
shake_type[nlocal][0] = static_cast (buf[m++]);
shake_type[nlocal][1] = static_cast (buf[m++]);
} else if (flag == 4) {
- shake_atom[nlocal][0] = static_cast (buf[m++]);
- shake_atom[nlocal][1] = static_cast (buf[m++]);
- shake_atom[nlocal][2] = static_cast (buf[m++]);
- shake_atom[nlocal][3] = static_cast (buf[m++]);
+ shake_atom[nlocal][0] = static_cast (buf[m++]);
+ shake_atom[nlocal][1] = static_cast (buf[m++]);
+ shake_atom[nlocal][2] = static_cast (buf[m++]);
+ shake_atom[nlocal][3] = static_cast (buf[m++]);
shake_type[nlocal][0] = static_cast (buf[m++]);
shake_type[nlocal][1] = static_cast (buf[m++]);
shake_type[nlocal][2] = static_cast (buf[m++]);
diff --git a/src/RIGID/fix_shake.h b/src/RIGID/fix_shake.h
index f84315afb2..a88e2b6d32 100644
--- a/src/RIGID/fix_shake.h
+++ b/src/RIGID/fix_shake.h
@@ -40,7 +40,7 @@ class FixShake : public Fix {
void copy_arrays(int, int, int);
void set_arrays(int);
void update_arrays(int, int);
- void set_molecule(int, int, double *, double *, double *);
+ void set_molecule(int, tagint, double *, double *, double *);
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
@@ -79,7 +79,7 @@ class FixShake : public Fix {
int *shake_flag; // 0 if atom not in SHAKE cluster
// 1 = size 3 angle cluster
// 2,3,4 = size of bond-only cluster
- int **shake_atom; // global IDs of atoms in cluster
+ tagint **shake_atom; // global IDs of atoms in cluster
// central atom is 1st
// lowest global ID is 1st for size 2
int **shake_type; // bondtype of each bond in cluster
@@ -115,8 +115,8 @@ class FixShake : public Fix {
void shake4(int);
void shake3angle(int);
void stats();
- int bondfind(int, int, int);
- int anglefind(int, int, int);
+ int bondfind(int, tagint, tagint);
+ int anglefind(int, tagint, tagint);
// static variable for ring communication callback to access class data
// callback functions for ring communication
diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp
index 44a46aa6f6..5e7af01f6e 100644
--- a/src/SHOCK/fix_append_atoms.cpp
+++ b/src/SHOCK/fix_append_atoms.cpp
@@ -495,14 +495,14 @@ void FixAppendAtoms::pre_exchange()
if (addtotal) {
domain->reset_box();
- if (atom->tag_enable) {
- atom->tag_extend();
- atom->natoms += addtotal;
- if (atom->map_style) {
- atom->nghost = 0;
- atom->map_init();
- atom->map_set();
- }
+ atom->natoms += addtotal;
+ if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
+ error->all(FLERR,"Too many total atoms");
+ if (atom->tag_enable) atom->tag_extend();
+ if (atom->map_style) {
+ atom->nghost = 0;
+ atom->map_init();
+ atom->map_set();
}
}
}
diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp
index d377a3d92c..00193b9f9c 100644
--- a/src/SRD/fix_srd.cpp
+++ b/src/SRD/fix_srd.cpp
@@ -571,10 +571,12 @@ void FixSRD::pre_neighbor()
if (jx < 0 || jx >= nbin2x || jy < 0 || jy >= nbin2y ||
jz < 0 || jz >= nbin2z) {
- printf("Big particle %d %d %g %g %g\n",
- atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
- printf("Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
- ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
+ if (screen) {
+ fprintf(screen,"Big particle " TAGINT_FORMAT " %d %g %g %g\n",
+ atom->tag[i],i,x[i][0],x[i][1],x[i][2]);
+ fprintf(screen,"Bin indices: %d %d %d, %d %d %d, %d %d %d\n",
+ ix,iy,iz,jx,jy,jz,nbin2x,nbin2y,nbin2z);
+ }
error->one(FLERR,"Fix SRD: bad stencil bin for big particle");
}
rsq = point_bin_distance(x[i],jx,jy,jz);
@@ -740,7 +742,8 @@ void FixSRD::post_force(int vflag)
if (ix < 0 || ix >= nbin2x || iy < 0 || iy >= nbin2y ||
iz < 0 || iz >= nbin2z) {
if (screen) {
- fprintf(screen,"SRD particle %d on step " BIGINT_FORMAT "\n",
+ fprintf(screen,"SRD particle " TAGINT_FORMAT
+ " on step " BIGINT_FORMAT "\n",
atom->tag[i],update->ntimestep);
fprintf(screen,"v = %g %g %g\n",v[i][0],v[i][1],v[i][2]);
fprintf(screen,"x = %g %g %g\n",x[i][0],x[i][1],x[i][2]);
@@ -1222,15 +1225,15 @@ void FixSRD::collisions_single()
char str[128];
if (type != WALL)
sprintf(str,
- "SRD particle %d started "
- "inside big particle %d on step " BIGINT_FORMAT
- " bounce %d",
+ "SRD particle " TAGINT_FORMAT " started "
+ "inside big particle " TAGINT_FORMAT
+ " on step " BIGINT_FORMAT " bounce %d",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
else
sprintf(str,
- "SRD particle %d started "
- "inside big particle %d on step " BIGINT_FORMAT
- " bounce %d",
+ "SRD particle " TAGINT_FORMAT " started "
+ "inside big particle " TAGINT_FORMAT
+ " on step " BIGINT_FORMAT " bounce %d",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
error->warning(FLERR,str);
@@ -1378,9 +1381,9 @@ void FixSRD::collisions_multi()
if (insideflag == INSIDE_ERROR || insideflag == INSIDE_WARN) {
char str[128];
sprintf(str,
- "SRD particle %d started "
- "inside big particle %d on step " BIGINT_FORMAT
- " bounce %d",
+ "SRD particle " TAGINT_FORMAT " started "
+ "inside big particle " TAGINT_FORMAT
+ " on step " BIGINT_FORMAT " bounce %d",
atom->tag[i],atom->tag[j],update->ntimestep,ibounce+1);
if (insideflag == INSIDE_ERROR) error->one(FLERR,str);
error->warning(FLERR,str);
@@ -2378,7 +2381,8 @@ int FixSRD::update_srd(int i, double dt, double *xscoll, double *vsnew,
xs[2] < srdlo[2] || xs[2] > srdhi[2]) {
if (screen) {
error->warning(FLERR,"Fix srd particle moved outside valid domain");
- fprintf(screen," particle %d on proc %d at timestep " BIGINT_FORMAT,
+ fprintf(screen," particle " TAGINT_FORMAT
+ " on proc %d at timestep " BIGINT_FORMAT,
atom->tag[i],me,update->ntimestep);
fprintf(screen," xnew %g %g %g\n",xs[0],xs[1],xs[2]);
fprintf(screen," srdlo/hi x %g %g\n",srdlo[0],srdhi[0]);
@@ -3879,7 +3883,8 @@ void FixSRD::print_collision(int i, int j, int ibounce,
double **v = atom->v;
if (type != WALL) {
- printf("COLLISION between SRD %d and BIG %d\n",atom->tag[i],atom->tag[j]);
+ printf("COLLISION between SRD " TAGINT_FORMAT
+ " and BIG " TAGINT_FORMAT "\n",atom->tag[i],atom->tag[j]);
printf(" bounce # = %d\n",ibounce+1);
printf(" local indices: %d %d\n",i,j);
printf(" timestep = %g\n",dt);
@@ -3924,7 +3929,8 @@ void FixSRD::print_collision(int i, int j, int ibounce,
} else {
int dim = wallwhich[j] / 2;
- printf("COLLISION between SRD %d and WALL %d\n",atom->tag[i],j);
+ printf("COLLISION between SRD " TAGINT_FORMAT " and WALL %d\n",
+ atom->tag[i],j);
printf(" bounce # = %d\n",ibounce+1);
printf(" local indices: %d %d\n",i,j);
printf(" timestep = %g\n",dt);
diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp
index 35c6e582d9..9903e889fa 100644
--- a/src/USER-AWPMD/atom_vec_wavepacket.cpp
+++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp
@@ -618,7 +618,7 @@ void AtomVecWavepacket::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -646,7 +646,7 @@ void AtomVecWavepacket::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -737,7 +737,7 @@ int AtomVecWavepacket::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -834,7 +834,7 @@ int AtomVecWavepacket::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -902,17 +902,14 @@ void AtomVecWavepacket::create_atom(int itype, double *coord)
AWPMD: 0-tag 1-type 2-q 3-spin 4-eradius 5-etag 6-cs_re 7-cs_im
------------------------------------------------------------------------- */
-void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, char **values)
+void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp,
+ char **values)
{
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of "
- "data file (ID tag must be >0)");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -923,12 +920,10 @@ void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, char **value
if (eradius[nlocal] < 0.0)
error->one(FLERR,"Invalid eradius in Atoms section of data file");
-
etag[nlocal] = atoi(values[5]);
cs[2*nlocal] = atoi(values[6]);
cs[2*nlocal+1] = atof(values[7]);
-
x[nlocal][0] = coord[0];
x[nlocal][1] = coord[1];
x[nlocal][2] = coord[2];
@@ -961,7 +956,6 @@ int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values)
cs[2*nlocal] = atoi(values[4]);
cs[2*nlocal+1] = atof(values[5]);
-
v[nlocal][0] = 0.0;
v[nlocal][1] = 0.0;
v[nlocal][2] = 0.0;
@@ -1039,9 +1033,10 @@ int AtomVecWavepacket::pack_data_hybrid(int i, double *buf)
void AtomVecWavepacket::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %d %-1.16e %d %-1.16e %-1.16e %-1.16e "
+ fprintf(fp,TAGINT_FORMAT
+ " %d %-1.16e %d %-1.16e %d %-1.16e %-1.16e %-1.16e "
"%-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],(int) ubuf(buf[i][3]).i,buf[i][4],
(int) ubuf(buf[i][5]).i,buf[i][6],buf[i][8],
buf[i][8],buf[i][9],buf[i][10],
@@ -1094,8 +1089,8 @@ int AtomVecWavepacket::pack_vel_hybrid(int i, double *buf)
void AtomVecWavepacket::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
+ fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
}
/* ----------------------------------------------------------------------
diff --git a/src/USER-AWPMD/atom_vec_wavepacket.h b/src/USER-AWPMD/atom_vec_wavepacket.h
index 555321691d..7773362b95 100644
--- a/src/USER-AWPMD/atom_vec_wavepacket.h
+++ b/src/USER-AWPMD/atom_vec_wavepacket.h
@@ -73,7 +73,8 @@ public:
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp
index 03e92528fe..25575a34a5 100644
--- a/src/USER-COLVARS/colvarproxy_lammps.cpp
+++ b/src/USER-COLVARS/colvarproxy_lammps.cpp
@@ -1,3 +1,6 @@
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
#include "mpi.h"
#include "lammps.h"
diff --git a/src/USER-CUDA/comm_cuda.cpp b/src/USER-CUDA/comm_cuda.cpp
index aea8f73424..672643646c 100644
--- a/src/USER-CUDA/comm_cuda.cpp
+++ b/src/USER-CUDA/comm_cuda.cpp
@@ -15,6 +15,10 @@
Contributing author (triclinic) : Pieter in 't Veld (SNL)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include "mpi.h"
#include
#include
diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp
index 1658d48921..c68e348035 100644
--- a/src/USER-EFF/atom_vec_electron.cpp
+++ b/src/USER-EFF/atom_vec_electron.cpp
@@ -534,7 +534,7 @@ void AtomVecElectron::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -561,7 +561,7 @@ void AtomVecElectron::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -639,7 +639,7 @@ int AtomVecElectron::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -727,7 +727,7 @@ int AtomVecElectron::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -791,10 +791,7 @@ void AtomVecElectron::data_atom(double *coord, imageint imagetmp, char **values)
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -904,8 +901,9 @@ int AtomVecElectron::pack_data_hybrid(int i, double *buf)
void AtomVecElectron::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,buf[i][2],
+ fprintf(fp,TAGINT_FORMAT
+ " %d %-1.16e %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,buf[i][2],
(int) ubuf(buf[i][3]).i,buf[i][4],buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
(int) ubuf(buf[i][10]).i);
@@ -954,8 +952,8 @@ int AtomVecElectron::pack_vel_hybrid(int i, double *buf)
void AtomVecElectron::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
+ fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
}
/* ----------------------------------------------------------------------
diff --git a/src/USER-EFF/atom_vec_electron.h b/src/USER-EFF/atom_vec_electron.h
index a17530de74..a6d606fd0d 100644
--- a/src/USER-EFF/atom_vec_electron.h
+++ b/src/USER-EFF/atom_vec_electron.h
@@ -68,7 +68,8 @@ class AtomVecElectron : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *spin;
diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp
index 12467b57bc..121217751c 100644
--- a/src/USER-EFF/pair_eff_cut.cpp
+++ b/src/USER-EFF/pair_eff_cut.cpp
@@ -93,8 +93,6 @@ void PairEffCut::compute(int eflag, int vflag)
int *type = atom->type;
int nlocal = atom->nlocal;
- int *id = atom->tag;
-
int newton_pair = force->newton_pair;
double qqrd2e = force->qqrd2e;
diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
index ea2c5e51e7..ec6cc01fb9 100644
--- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp
+++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp
@@ -137,7 +137,9 @@ void DihedralCosineShiftExp::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp
index 3ddf4cd246..c00dcfcfa5 100644
--- a/src/USER-MISC/dihedral_fourier.cpp
+++ b/src/USER-MISC/dihedral_fourier.cpp
@@ -149,7 +149,9 @@ void DihedralFourier::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp
index d06ef08a9f..6370b85739 100644
--- a/src/USER-MISC/dihedral_nharmonic.cpp
+++ b/src/USER-MISC/dihedral_nharmonic.cpp
@@ -156,7 +156,9 @@ void DihedralNHarmonic::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/USER-MISC/dihedral_quadratic.cpp b/src/USER-MISC/dihedral_quadratic.cpp
index 06391b7128..bec383f214 100644
--- a/src/USER-MISC/dihedral_quadratic.cpp
+++ b/src/USER-MISC/dihedral_quadratic.cpp
@@ -161,8 +161,10 @@ void DihedralQuadratic::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " %d %d %d %d",
- me,update->ntimestep,
+ sprintf(str,"Dihedral problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
+ me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",
diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp
index 971064fd12..81b733ee24 100644
--- a/src/USER-MISC/fix_imd.cpp
+++ b/src/USER-MISC/fix_imd.cpp
@@ -47,6 +47,10 @@ negotiate an appropriate license for such distribution."
Justin Gullingsrud, and James Phillips, (TCBG, Beckman Institute, UIUC)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include "fix_imd.h"
#include "atom.h"
#include "comm.h"
diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp
index 8bd867fd80..e286277b60 100644
--- a/src/USER-MISC/improper_cossq.cpp
+++ b/src/USER-MISC/improper_cossq.cpp
@@ -110,8 +110,11 @@ void ImproperCossq::compute(int eflag, int vflag)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
- me,update->ntimestep,atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
+ me,update->ntimestep,
+ atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
fprintf(screen," 1st atom: %d %g %g %g\n",me,x[i1][0],x[i1][1],x[i1][2]);
fprintf(screen," 2nd atom: %d %g %g %g\n",me,x[i2][0],x[i2][1],x[i2][2]);
@@ -120,7 +123,6 @@ void ImproperCossq::compute(int eflag, int vflag)
}
}
-
/* Apply corrections to round-off errors. */
if (cosphi > 1.0) cosphi -= SMALL;
if (cosphi < -1.0) cosphi += SMALL;
diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp
index 43944727ff..a4be0ea35c 100644
--- a/src/USER-MISC/improper_fourier.cpp
+++ b/src/USER-MISC/improper_fourier.cpp
@@ -157,8 +157,9 @@ void ImproperFourier::addone(const int &i1,const int &i2,const int &i3,const int
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,
- "Improper problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Improper problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str,0);
diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp
index a9938f409a..4c236649a2 100644
--- a/src/USER-MISC/pair_edip.cpp
+++ b/src/USER-MISC/pair_edip.cpp
@@ -841,8 +841,6 @@ void PairEDIP::coeff(int narg, char **arg)
void PairEDIP::init_style()
{
- if (atom->tag_enable == 0)
- error->all(FLERR,"Pair style EDIP requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style EDIP requires newton pair on");
diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp
index 3b6f5c2d10..265532e56f 100644
--- a/src/USER-MISC/pair_list.cpp
+++ b/src/USER-MISC/pair_list.cpp
@@ -233,7 +233,9 @@ void PairList::settings(int narg, char **arg)
// now read and parse pair list file for real
npairs = 0;
char *ptr;
- int id1, id2, nharm=0, nmorse=0, nlj126=0;
+ tagint id1, id2;
+ int nharm=0, nmorse=0, nlj126=0;
+
while(fgets(line,1024,fp)) {
ptr = strtok(line," \t\n\r\f");
@@ -244,11 +246,11 @@ void PairList::settings(int narg, char **arg)
if (*ptr == '#') continue;
// get atom ids of pair
- id1 = atoi(ptr);
+ id1 = ATOTAGINT(ptr);
ptr = strtok(NULL," \t\n\r\f");
if (!ptr)
error->all(FLERR,"Incorrectly formatted pair list file");
- id2 = atoi(ptr);
+ id2 = ATOTAGINT(ptr);
// get potential type
ptr = strtok(NULL," \t\n\r\f");
diff --git a/src/USER-MISC/pair_list.h b/src/USER-MISC/pair_list.h
index 9d199f5ba7..4059b0ef29 100644
--- a/src/USER-MISC/pair_list.h
+++ b/src/USER-MISC/pair_list.h
@@ -53,7 +53,7 @@ class PairList : public Pair {
};
typedef struct {
- int id1,id2; // global atom ids
+ tagint id1,id2; // global atom ids
double cutsq; // cutoff**2 for this pair
double offset; // energy offset
union parm_u parm; // parameters for style
diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp
index d5850ac81c..db58c023b1 100644
--- a/src/USER-MISC/pair_tersoff_table.cpp
+++ b/src/USER-MISC/pair_tersoff_table.cpp
@@ -815,8 +815,6 @@ void PairTersoffTable::coeff(int narg, char **arg)
void PairTersoffTable::init_style()
{
- if (atom->tag_enable == 0)
- error->all(FLERR,"Pair style Tersoff requires atom IDs");
if (force->newton_pair == 0)
error->all(FLERR,"Pair style Tersoff requires newton pair on");
diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp
index 2756abef56..753caf3d39 100644
--- a/src/USER-MOLFILE/dump_molfile.cpp
+++ b/src/USER-MOLFILE/dump_molfile.cpp
@@ -15,6 +15,10 @@
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include
#include
#include
diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp
index 4462f70bf1..2a07fcdbd2 100644
--- a/src/USER-OMP/thr_omp.cpp
+++ b/src/USER-OMP/thr_omp.cpp
@@ -16,6 +16,10 @@
Contributing author: Axel Kohlmeyer (Temple U)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include "atom.h"
#include "comm.h"
#include "error.h"
diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp
index 907d2368f3..f1f3e3f425 100644
--- a/src/USER-PHONON/fix_phonon.cpp
+++ b/src/USER-PHONON/fix_phonon.cpp
@@ -23,6 +23,10 @@
konglt@sjtu.edu.cn; konglt@gmail.com
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include "string.h"
#include "fix_phonon.h"
#include "atom.h"
diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp
index b93d872bb4..058ce5f846 100644
--- a/src/USER-REAXC/fix_qeq_reax.cpp
+++ b/src/USER-REAXC/fix_qeq_reax.cpp
@@ -16,6 +16,10 @@
(now at Lawrence Berkeley National Laboratory, hmaktulga@lbl.gov)
------------------------------------------------------------------------- */
+#ifdef LAMMPS_BIGBIG
+#error LAMMPS_BIGBIG not supported by this file
+#endif
+
#include "math.h"
#include "stdio.h"
#include "stdlib.h"
@@ -516,12 +520,11 @@ void FixQEqReax::compute_H()
{
int inum, jnum, *ilist, *jlist, *numneigh, **firstneigh;
int i, j, ii, jj, flag;
- int *type, *tag;
double **x, SMALL = 0.0001;
double dx, dy, dz, r_sqr;
- type = atom->type;
- tag = atom->tag;
+ int *type = atom->type;
+ tagint *tag = atom->tag;
x = atom->x;
inum = list->inum;
@@ -530,6 +533,7 @@ void FixQEqReax::compute_H()
firstneigh = list->firstneigh;
// fill in the H matrix
+
m_fill = 0;
r_sqr = 0;
for( ii = 0; ii < inum; ii++ ) {
diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp
index f20c770312..55032aa97e 100644
--- a/src/USER-REAXC/fix_reaxc_bonds.cpp
+++ b/src/USER-REAXC/fix_reaxc_bonds.cpp
@@ -75,7 +75,6 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) :
numneigh = NULL;
allocate();
-
}
/* ---------------------------------------------------------------------- */
@@ -176,7 +175,8 @@ void FixReaxCBonds::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp)
void FixReaxCBonds::FindBond(struct _reax_list *lists, int &numbonds)
{
int *ilist, i, ii, inum;
- int j, pj, nj, jtag;
+ int j, pj, nj;
+ tagint jtag;
double bo_tmp,bo_cut;
inum = reaxc->list->inum;
@@ -184,6 +184,8 @@ void FixReaxCBonds::FindBond(struct _reax_list *lists, int &numbonds)
bond_data *bo_ij;
bo_cut = reaxc->control->bg_cut;
+ tagint *tag = atom->tag;
+
for (ii = 0; ii < inum; ii++) {
i = ilist[ii];
nj = 0;
@@ -191,7 +193,7 @@ void FixReaxCBonds::FindBond(struct _reax_list *lists, int &numbonds)
for( pj = Start_Index(i, reaxc->lists); pj < End_Index(i, reaxc->lists); ++pj ) {
bo_ij = &( reaxc->lists->select.bond_list[pj] );
j = bo_ij->nbr;
- jtag = atom->tag[j];
+ jtag = tag[j];
bo_tmp = bo_ij->bo_data.BO;
if (bo_tmp > bo_cut) {
@@ -243,10 +245,11 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local)
/* ---------------------------------------------------------------------- */
void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local,
- int natoms, int maxnum)
+ int natoms, int maxnum)
{
- int i, j, k, itype, itag, jtag;
+ int i, j, k, itype;
int inode, nlocal_tmp, numbonds;
+ tagint itag,jtag;
int nlocal = atom->nlocal;
bigint ntimestep = update->ntimestep;
double sbotmp, nlptmp, avqtmp, abotmp;
@@ -278,7 +281,7 @@ void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local,
}
j = 2;
for (i = 0; i < nlocal_tmp; i ++) {
- itag = nint(buf[j-1]);
+ itag = static_cast (buf[j-1]);
itype = nint(buf[j+0]);
sbotmp = buf[j+1];
nlptmp = buf[j+2];
@@ -288,7 +291,7 @@ void FixReaxCBonds::RecvBuffer(double *buf, int nbuf, int nbuf_local,
fprintf(fp," %d %d %d",itag,itype,numbonds);
for (k = 5; k < 5+numbonds; k++) {
- jtag = nint(buf[j+k]);
+ jtag = static_cast (buf[j+k]);
fprintf(fp," %d",jtag);
}
j += (5+numbonds);
diff --git a/src/USER-REAXC/fix_reaxc_bonds.h b/src/USER-REAXC/fix_reaxc_bonds.h
index 34aa5d2039..d7927ccaeb 100644
--- a/src/USER-REAXC/fix_reaxc_bonds.h
+++ b/src/USER-REAXC/fix_reaxc_bonds.h
@@ -37,7 +37,8 @@ class FixReaxCBonds : public Fix {
private:
int me, nprocs, nmax, ntypes, maxsize;
- int *numneigh, **neighid;
+ int *numneigh;
+ tagint **neighid;
double **abo;
FILE *fp;
diff --git a/src/USER-REAXC/pair_reax_c.cpp b/src/USER-REAXC/pair_reax_c.cpp
index 57212a0c4d..3df23e8656 100644
--- a/src/USER-REAXC/pair_reax_c.cpp
+++ b/src/USER-REAXC/pair_reax_c.cpp
@@ -573,7 +573,7 @@ void PairReaxC::write_reax_atoms()
error->all(FLERR,"Too many ghost atoms");
for( int i = 0; i < system->N; ++i ){
- system->my_atoms[i].orig_id = atom->tag[i];
+ system->my_atoms[i].orig_id = static_cast (atom->tag[i]);
system->my_atoms[i].type = map[atom->type[i]];
system->my_atoms[i].x[0] = atom->x[i][0];
system->my_atoms[i].x[1] = atom->x[i][1];
@@ -668,7 +668,7 @@ int PairReaxC::write_reax_lists()
{
int itr_i, itr_j, itr_g, i, j, g, flag;
int nlocal, nghost, num_nbrs;
- int *ilist, *jlist, *numneigh, **firstneigh, *marked, *tag;
+ int *ilist, *jlist, *numneigh, **firstneigh, *marked;
double d_sqr, g_d, g_d_sqr;
rvec dvec, g_dvec;
double *dist, **x, SMALL = 0.0001;
@@ -676,7 +676,6 @@ int PairReaxC::write_reax_lists()
far_neighbor_data *far_list;
x = atom->x;
- tag = atom->tag;
nlocal = atom->nlocal;
nghost = atom->nghost;
ilist = list->ilist;
@@ -797,7 +796,7 @@ double PairReaxC::memory_usage()
void PairReaxC::FindBond()
{
- int i, ii, j, pj, jtag, nj, jtmp, jj;
+ int i, ii, j, pj, nj, jtmp, jj;
double bo_tmp, bo_cut, rij, rsq, r_tmp;
bond_data *bo_ij;
diff --git a/src/USER-REAXC/reaxc_types.h b/src/USER-REAXC/reaxc_types.h
index 83335e7865..651f65b2d9 100644
--- a/src/USER-REAXC/reaxc_types.h
+++ b/src/USER-REAXC/reaxc_types.h
@@ -75,7 +75,8 @@ typedef struct {
} restart_header;
typedef struct {
- int orig_id, type;
+ int orig_id;
+ int type;
char name[8];
rvec x, v;
} restart_atom;
diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_meso.cpp
index 4df4b1503c..bca14645d5 100644
--- a/src/USER-SPH/atom_vec_meso.cpp
+++ b/src/USER-SPH/atom_vec_meso.cpp
@@ -578,7 +578,7 @@ void AtomVecMeso::unpack_border(int n, int first, double *buf) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
rho[i] = buf[m++];
@@ -609,7 +609,7 @@ void AtomVecMeso::unpack_border_vel(int n, int first, double *buf) {
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
v[i][0] = buf[m++];
@@ -677,7 +677,7 @@ int AtomVecMeso::unpack_exchange(double *buf) {
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -765,7 +765,7 @@ int AtomVecMeso::unpack_restart(double *buf) {
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -830,13 +830,9 @@ void AtomVecMeso::create_atom(int itype, double *coord) {
void AtomVecMeso::data_atom(double *coord, imageint imagetmp, char **values) {
int nlocal = atom->nlocal;
- if (nlocal == nmax)
- grow(0);
-
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
+ if (nlocal == nmax) grow(0);
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -923,9 +919,10 @@ int AtomVecMeso::pack_data_hybrid(int i, double *buf)
void AtomVecMeso::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
+ fprintf(fp,TAGINT_FORMAT
+ " %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e "
"%d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4],
buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
diff --git a/src/USER-SPH/atom_vec_meso.h b/src/USER-SPH/atom_vec_meso.h
index 59c27818d4..8f3e66453c 100644
--- a/src/USER-SPH/atom_vec_meso.h
+++ b/src/USER-SPH/atom_vec_meso.h
@@ -62,7 +62,8 @@ class AtomVecMeso : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ int *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *rho, *drho, *e, *de, *cv;
diff --git a/src/XTC/dump_xtc.cpp b/src/XTC/dump_xtc.cpp
index 80f1013afe..f7c2f8ec0a 100644
--- a/src/XTC/dump_xtc.cpp
+++ b/src/XTC/dump_xtc.cpp
@@ -190,11 +190,11 @@ void DumpXTC::write_header(bigint nbig)
/* ---------------------------------------------------------------------- */
-void DumpXTC::pack(int *ids)
+void DumpXTC::pack(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
diff --git a/src/XTC/dump_xtc.h b/src/XTC/dump_xtc.h
index 081891b224..f1e960af6c 100644
--- a/src/XTC/dump_xtc.h
+++ b/src/XTC/dump_xtc.h
@@ -49,7 +49,7 @@ class DumpXTC : public Dump {
int modify_param(int, char **);
void openfile();
void write_header(bigint);
- void pack(int *);
+ void pack(tagint *);
void write_data(int, double *);
bigint memory_usage();
diff --git a/src/atom.cpp b/src/atom.cpp
index 75c2bf4a83..aba59b819a 100644
--- a/src/atom.cpp
+++ b/src/atom.cpp
@@ -57,8 +57,6 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
ntypes = 0;
nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0;
nbonds = nangles = ndihedrals = nimpropers = 0;
- bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
- extra_bond_per_atom = 0;
firstgroupname = NULL;
sortfreq = 1000;
@@ -71,7 +69,8 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
// initialize atom arrays
// customize by adding new array
- tag = type = mask = NULL;
+ tag = NULL;
+ type = mask = NULL;
image = NULL;
x = v = f = NULL;
@@ -92,24 +91,30 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
cv = NULL;
vest = NULL;
+ bond_per_atom = extra_bond_per_atom = 0;
+ num_bond = NULL;
+ bond_type = NULL;
+ bond_atom = NULL;
+
+ angle_per_atom = extra_angle_per_atom = 0;
+ num_angle = NULL;
+ angle_type = NULL;
+ angle_atom1 = angle_atom2 = angle_atom3 = NULL;
+
+ dihedral_per_atom = extra_dihedral_per_atom = 0;
+ num_dihedral = NULL;
+ dihedral_type = NULL;
+ dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL;
+
+ improper_per_atom = extra_improper_per_atom = 0;
+ num_improper = NULL;
+ improper_type = NULL;
+ improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL;
+
maxspecial = 1;
nspecial = NULL;
special = NULL;
- num_bond = NULL;
- bond_type = bond_atom = NULL;
-
- num_angle = NULL;
- angle_type = angle_atom1 = angle_atom2 = angle_atom3 = NULL;
-
- num_dihedral = NULL;
- dihedral_type = dihedral_atom1 = dihedral_atom2 = NULL;
- dihedral_atom3 = dihedral_atom4 = NULL;
-
- num_improper = NULL;
- improper_type = improper_atom1 = improper_atom2 = NULL;
- improper_atom3 = improper_atom4 = NULL;
-
// user-defined molecules
nmolecule = maxmol = 0;
@@ -148,14 +153,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp)
nextra_store = 0;
extra = NULL;
- // default mapping values
+ // default atom ID and mapping values
tag_enable = 1;
- map_style = 0;
+ map_style = map_user = 0;
map_tag_max = 0;
map_nhash = 0;
- smax = 0;
+ max_same = 0;
sametag = NULL;
map_array = NULL;
map_bucket = NULL;
@@ -283,7 +288,8 @@ Atom::~Atom()
void Atom::settings(Atom *old)
{
- map_style = old->map_style;
+ tag_enable = old->tag_enable;
+ map_user = old->map_user;
}
/* ----------------------------------------------------------------------
@@ -333,10 +339,11 @@ void Atom::create_avec(const char *style, int narg, char **arg, char *suffix)
strcpy(atom_style,style);
}
- // if molecular system, default is to have array map
+ // if molecular system, atom IDs must be defined
molecular = avec->molecular;
- if (map_style == 0 && molecular) map_style = 1;
+ if (molecular && tag_enable == 0)
+ error->all(FLERR,"Atom IDs must be used for molecular systems");
}
/* ----------------------------------------------------------------------
@@ -444,14 +451,23 @@ void Atom::modify_params(int narg, char **arg)
int iarg = 0;
while (iarg < narg) {
- if (strcmp(arg[iarg],"map") == 0) {
+ if (strcmp(arg[iarg],"id") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
- if (strcmp(arg[iarg+1],"array") == 0) map_style = 1;
- else if (strcmp(arg[iarg+1],"hash") == 0) map_style = 2;
+ if (domain->box_exist)
+ error->all(FLERR,
+ "Atom_modify id command after simulation box is defined");
+ if (strcmp(arg[iarg+1],"yes") == 0) tag_enable = 1;
+ else if (strcmp(arg[iarg+1],"no") == 0) tag_enable = 2;
else error->all(FLERR,"Illegal atom_modify command");
+ iarg += 2;
+ } if (strcmp(arg[iarg],"map") == 0) {
+ if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
if (domain->box_exist)
error->all(FLERR,
"Atom_modify map command after simulation box is defined");
+ if (strcmp(arg[iarg+1],"array") == 0) map_user = 1;
+ else if (strcmp(arg[iarg+1],"hash") == 0) map_user = 2;
+ else error->all(FLERR,"Illegal atom_modify command");
iarg += 2;
} else if (strcmp(arg[iarg],"first") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command");
@@ -479,37 +495,82 @@ void Atom::modify_params(int narg, char **arg)
}
}
+/* ----------------------------------------------------------------------
+ check that atom IDs are valid
+ error if any atom ID < 0 or atom ID = MAXTAGINT
+ if any atom ID > 0, error if any atom ID == 0
+ if all atom IDs = 0, tag_enable must be 0
+ OK if atom IDs > natoms
+ NOTE: not checking that atom IDs are unique
+------------------------------------------------------------------------- */
+
+void Atom::tag_check()
+{
+ int nlocal = atom->nlocal;
+ tagint *tag = atom->tag;
+
+ tagint min = MAXTAGINT;
+ tagint max = 0;
+
+ for (int i = 0; i < nlocal; i++) {
+ min = MIN(min,tag[i]);
+ max = MAX(max,tag[i]);
+ }
+
+ tagint minall,maxall;
+ MPI_Allreduce(&min,&minall,1,MPI_LMP_TAGINT,MPI_MIN,world);
+ MPI_Allreduce(&max,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
+
+ if (minall < 0) error->all(FLERR,"Atom ID is negative");
+ if (maxall >= MAXTAGINT) error->all(FLERR,"Atom ID is too big");
+ if (maxall > 0 && minall == 0) error->all(FLERR,"Atom ID is zero");
+ if (maxall == 0 && tag_enable && natoms)
+ error->all(FLERR,"Not all atom IDs are 0");
+}
+
/* ----------------------------------------------------------------------
add unique tags to any atoms with tag = 0
new tags are grouped by proc and start after max current tag
called after creating new atoms
+ error if new tags will exceed MAXTAGINT
------------------------------------------------------------------------- */
void Atom::tag_extend()
{
// maxtag_all = max tag for all atoms
- int maxtag = 0;
+ tagint maxtag = 0;
for (int i = 0; i < nlocal; i++) maxtag = MAX(maxtag,tag[i]);
- int maxtag_all;
- MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_INT,MPI_MAX,world);
+ tagint maxtag_all;
+ MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
+
+ // DEBUG: useful for generating 64-bit IDs even for small systems
+ // use only when LAMMPS is compiled with BIGBIG
+
+ //maxtag_all += 1000000000000;
// notag = # of atoms I own with no tag (tag = 0)
// notag_sum = # of total atoms on procs <= me with no tag
- int notag = 0;
+ bigint notag = 0;
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) notag++;
- int notag_sum;
- MPI_Scan(¬ag,¬ag_sum,1,MPI_INT,MPI_SUM,world);
+
+ bigint notag_total;
+ MPI_Allreduce(¬ag,¬ag_total,1,MPI_LMP_BIGINT,MPI_SUM,world);
+ if (notag_total >= MAXTAGINT)
+ error->all(FLERR,"New atom IDs exceed maximum allowed ID");
+
+ bigint notag_sum;
+ MPI_Scan(¬ag,¬ag_sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
// itag = 1st new tag that my untagged atoms should use
- int itag = maxtag_all + notag_sum - notag + 1;
+ tagint itag = maxtag_all + notag_sum - notag + 1;
for (int i = 0; i < nlocal; i++) if (tag[i] == 0) tag[i] = itag++;
}
/* ----------------------------------------------------------------------
- check that atom IDs span range from 1 to Natoms
+ check that atom IDs span range from 1 to Natoms inclusive
return 0 if mintag != 1 or maxtag != Natoms
return 1 if OK
doesn't actually check if all tag values are used
@@ -517,20 +578,18 @@ void Atom::tag_extend()
int Atom::tag_consecutive()
{
- // change this when allow tagint = bigint
- //int idmin = MAXTAGINT;
- int idmin = MAXSMALLINT;
- int idmax = 0;
+ tagint idmin = MAXTAGINT;
+ tagint idmax = 0;
for (int i = 0; i < nlocal; i++) {
idmin = MIN(idmin,tag[i]);
idmax = MAX(idmax,tag[i]);
}
- int idminall,idmaxall;
- MPI_Allreduce(&idmin,&idminall,1,MPI_INT,MPI_MIN,world);
- MPI_Allreduce(&idmax,&idmaxall,1,MPI_INT,MPI_MAX,world);
+ tagint idminall,idmaxall;
+ MPI_Allreduce(&idmin,&idminall,1,MPI_LMP_TAGINT,MPI_MIN,world);
+ MPI_Allreduce(&idmax,&idmaxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
- if (idminall != 1 || idmaxall != static_cast (natoms)) return 0;
+ if (idminall != 1 || idmaxall != natoms) return 0;
return 1;
}
@@ -683,7 +742,8 @@ void Atom::data_atoms(int n, char *buf)
void Atom::data_vels(int n, char *buf)
{
- int j,m,tagdata;
+ int j,m;
+ tagint tagdata;
char *next;
next = strchr(buf,'\n');
@@ -707,7 +767,7 @@ void Atom::data_vels(int n, char *buf)
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
- tagdata = atoi(values[0]);
+ tagdata = ATOTAGINT(values[0]);
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Velocities section of data file");
if ((m = map(tagdata)) >= 0) avec->data_vel(m,&values[1]);
@@ -718,6 +778,269 @@ void Atom::data_vels(int n, char *buf)
delete [] values;
}
+/* ----------------------------------------------------------------------
+ process N bonds read into buf from data files
+ if count is non-NULL, just count bonds per atom
+ else store them with atoms
+ check that atom IDs are > 0 and <= map_tag_max
+------------------------------------------------------------------------- */
+
+void Atom::data_bonds(int n, char *buf, int *count)
+{
+ int m,tmp,itype;
+ tagint atom1,atom2;
+ char *next;
+ int newton_bond = force->newton_bond;
+
+ for (int i = 0; i < n; i++) {
+ next = strchr(buf,'\n');
+ *next = '\0';
+ sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT,
+ &tmp,&itype,&atom1,&atom2);
+ if (atom1 <= 0 || atom1 > map_tag_max ||
+ atom2 <= 0 || atom2 > map_tag_max)
+ error->one(FLERR,"Invalid atom ID in Bonds section of data file");
+ if (itype <= 0 || itype > nbondtypes)
+ error->one(FLERR,"Invalid bond type in Bonds section of data file");
+ if ((m = map(atom1)) >= 0) {
+ if (count) count[m]++;
+ else {
+ bond_type[m][num_bond[m]] = itype;
+ bond_atom[m][num_bond[m]] = atom2;
+ num_bond[m]++;
+ }
+ }
+ if (newton_bond == 0) {
+ if ((m = map(atom2)) >= 0) {
+ if (count) count[m]++;
+ else {
+ bond_type[m][num_bond[m]] = itype;
+ bond_atom[m][num_bond[m]] = atom1;
+ num_bond[m]++;
+ }
+ }
+ }
+ buf = next + 1;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ process N angles read into buf from data files
+ if count is non-NULL, just count angles per atom
+ else store them with atoms
+ check that atom IDs are > 0 and <= map_tag_max
+------------------------------------------------------------------------- */
+
+void Atom::data_angles(int n, char *buf, int *count)
+{
+ int m,tmp,itype;
+ tagint atom1,atom2,atom3;
+ char *next;
+ int newton_bond = force->newton_bond;
+
+ for (int i = 0; i < n; i++) {
+ next = strchr(buf,'\n');
+ *next = '\0';
+ sscanf(buf,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
+ &tmp,&itype,&atom1,&atom2,&atom3);
+ if (atom1 <= 0 || atom1 > map_tag_max ||
+ atom2 <= 0 || atom2 > map_tag_max ||
+ atom3 <= 0 || atom3 > map_tag_max)
+ error->one(FLERR,"Invalid atom ID in Angles section of data file");
+ if (itype <= 0 || itype > nangletypes)
+ error->one(FLERR,"Invalid angle type in Angles section of data file");
+ if ((m = map(atom2)) >= 0) {
+ if (count) count[m]++;
+ else {
+ angle_type[m][num_angle[m]] = itype;
+ angle_atom1[m][num_angle[m]] = atom1;
+ angle_atom2[m][num_angle[m]] = atom2;
+ angle_atom3[m][num_angle[m]] = atom3;
+ num_angle[m]++;
+ }
+ }
+ if (newton_bond == 0) {
+ if ((m = map(atom1)) >= 0) {
+ if (count) count[m]++;
+ else {
+ angle_type[m][num_angle[m]] = itype;
+ angle_atom1[m][num_angle[m]] = atom1;
+ angle_atom2[m][num_angle[m]] = atom2;
+ angle_atom3[m][num_angle[m]] = atom3;
+ num_angle[m]++;
+ }
+ }
+ if ((m = map(atom3)) >= 0) {
+ if (count) count[m]++;
+ else {
+ angle_type[m][num_angle[m]] = itype;
+ angle_atom1[m][num_angle[m]] = atom1;
+ angle_atom2[m][num_angle[m]] = atom2;
+ angle_atom3[m][num_angle[m]] = atom3;
+ num_angle[m]++;
+ }
+ }
+ }
+ buf = next + 1;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ process N dihedrals read into buf from data files
+ if count is non-NULL, just count diihedrals per atom
+ else store them with atoms
+ check that atom IDs are > 0 and <= map_tag_max
+------------------------------------------------------------------------- */
+
+void Atom::data_dihedrals(int n, char *buf, int *count)
+{
+ int m,tmp,itype;
+ tagint atom1,atom2,atom3,atom4;
+ char *next;
+ int newton_bond = force->newton_bond;
+
+ for (int i = 0; i < n; i++) {
+ next = strchr(buf,'\n');
+ *next = '\0';
+ sscanf(buf,"%d %d "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
+ &tmp,&itype,&atom1,&atom2,&atom3,&atom4);
+ if (atom1 <= 0 || atom1 > map_tag_max ||
+ atom2 <= 0 || atom2 > map_tag_max ||
+ atom3 <= 0 || atom3 > map_tag_max ||
+ atom4 <= 0 || atom4 > map_tag_max)
+ error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
+ if (itype <= 0 || itype > ndihedraltypes)
+ error->one(FLERR,
+ "Invalid dihedral type in Dihedrals section of data file");
+ if ((m = map(atom2)) >= 0) {
+ if (count) count[m]++;
+ else {
+ dihedral_type[m][num_dihedral[m]] = itype;
+ dihedral_atom1[m][num_dihedral[m]] = atom1;
+ dihedral_atom2[m][num_dihedral[m]] = atom2;
+ dihedral_atom3[m][num_dihedral[m]] = atom3;
+ dihedral_atom4[m][num_dihedral[m]] = atom4;
+ num_dihedral[m]++;
+ }
+ }
+ if (newton_bond == 0) {
+ if ((m = map(atom1)) >= 0) {
+ if (count) count[m]++;
+ else {
+ dihedral_type[m][num_dihedral[m]] = itype;
+ dihedral_atom1[m][num_dihedral[m]] = atom1;
+ dihedral_atom2[m][num_dihedral[m]] = atom2;
+ dihedral_atom3[m][num_dihedral[m]] = atom3;
+ dihedral_atom4[m][num_dihedral[m]] = atom4;
+ num_dihedral[m]++;
+ }
+ }
+ if ((m = map(atom3)) >= 0) {
+ if (count) count[m]++;
+ else {
+ dihedral_type[m][num_dihedral[m]] = itype;
+ dihedral_atom1[m][num_dihedral[m]] = atom1;
+ dihedral_atom2[m][num_dihedral[m]] = atom2;
+ dihedral_atom3[m][num_dihedral[m]] = atom3;
+ dihedral_atom4[m][num_dihedral[m]] = atom4;
+ num_dihedral[m]++;
+ }
+ }
+ if ((m = map(atom4)) >= 0) {
+ if (count) count[m]++;
+ else {
+ dihedral_type[m][num_dihedral[m]] = itype;
+ dihedral_atom1[m][num_dihedral[m]] = atom1;
+ dihedral_atom2[m][num_dihedral[m]] = atom2;
+ dihedral_atom3[m][num_dihedral[m]] = atom3;
+ dihedral_atom4[m][num_dihedral[m]] = atom4;
+ num_dihedral[m]++;
+ }
+ }
+ }
+ buf = next + 1;
+ }
+}
+
+/* ----------------------------------------------------------------------
+ process N impropers read into buf from data files
+ if count is non-NULL, just count impropers per atom
+ else store them with atoms
+ check that atom IDs are > 0 and <= map_tag_max
+------------------------------------------------------------------------- */
+
+void Atom::data_impropers(int n, char *buf, int *count)
+{
+ int m,tmp,itype;
+ tagint atom1,atom2,atom3,atom4;
+ char *next;
+ int newton_bond = force->newton_bond;
+
+ for (int i = 0; i < n; i++) {
+ next = strchr(buf,'\n');
+ *next = '\0';
+ sscanf(buf,"%d %d "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT,
+ &tmp,&itype,&atom1,&atom2,&atom3,&atom4);
+ if (atom1 <= 0 || atom1 > map_tag_max ||
+ atom2 <= 0 || atom2 > map_tag_max ||
+ atom3 <= 0 || atom3 > map_tag_max ||
+ atom4 <= 0 || atom4 > map_tag_max)
+ error->one(FLERR,"Invalid atom ID in Impropers section of data file");
+ if (itype <= 0 || itype > nimpropertypes)
+ error->one(FLERR,
+ "Invalid improper type in Impropers section of data file");
+ if ((m = map(atom2)) >= 0) {
+ if (count) count[m]++;
+ else {
+ improper_type[m][num_improper[m]] = itype;
+ improper_atom1[m][num_improper[m]] = atom1;
+ improper_atom2[m][num_improper[m]] = atom2;
+ improper_atom3[m][num_improper[m]] = atom3;
+ improper_atom4[m][num_improper[m]] = atom4;
+ num_improper[m]++;
+ }
+ }
+ if (newton_bond == 0) {
+ if ((m = map(atom1)) >= 0) {
+ if (count) count[m]++;
+ else {
+ improper_type[m][num_improper[m]] = itype;
+ improper_atom1[m][num_improper[m]] = atom1;
+ improper_atom2[m][num_improper[m]] = atom2;
+ improper_atom3[m][num_improper[m]] = atom3;
+ improper_atom4[m][num_improper[m]] = atom4;
+ num_improper[m]++;
+ }
+ }
+ if ((m = map(atom3)) >= 0) {
+ if (count) count[m]++;
+ else {
+ improper_type[m][num_improper[m]] = itype;
+ improper_atom1[m][num_improper[m]] = atom1;
+ improper_atom2[m][num_improper[m]] = atom2;
+ improper_atom3[m][num_improper[m]] = atom3;
+ improper_atom4[m][num_improper[m]] = atom4;
+ num_improper[m]++;
+ }
+ }
+ if ((m = map(atom4)) >= 0) {
+ if (count) count[m]++;
+ else {
+ improper_type[m][num_improper[m]] = itype;
+ improper_atom1[m][num_improper[m]] = atom1;
+ improper_atom2[m][num_improper[m]] = atom2;
+ improper_atom3[m][num_improper[m]] = atom3;
+ improper_atom4[m][num_improper[m]] = atom4;
+ num_improper[m]++;
+ }
+ }
+ }
+ buf = next + 1;
+ }
+}
+
/* ----------------------------------------------------------------------
unpack n lines from atom-style specific section of data file
check that atom IDs are > 0 and <= map_tag_max
@@ -750,7 +1073,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus)
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
- tagdata = atoi(values[0]);
+ tagdata = ATOTAGINT(values[0]);
if (tagdata <= 0 || tagdata > map_tag_max)
error->one(FLERR,"Invalid atom ID in Bonus section of data file");
@@ -783,8 +1106,8 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body)
// if I own atom tag, unpack its values
for (int i = 0; i < n; i++) {
- if (i == 0) tagdata = atoi(strtok(buf," \t\n\r\f"));
- else tagdata = atoi(strtok(NULL," \t\n\r\f"));
+ if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f"));
+ else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f"));
ninteger = atoi(strtok(NULL," \t\n\r\f"));
ndouble = atoi(strtok(NULL," \t\n\r\f"));
@@ -804,208 +1127,6 @@ void Atom::data_bodies(int n, char *buf, AtomVecBody *avec_body)
delete [] dvalues;
}
-/* ----------------------------------------------------------------------
- check that atom IDs are > 0 and <= map_tag_max
-------------------------------------------------------------------------- */
-
-void Atom::data_bonds(int n, char *buf)
-{
- int m,tmp,itype,atom1,atom2;
- char *next;
- int newton_bond = force->newton_bond;
-
- for (int i = 0; i < n; i++) {
- next = strchr(buf,'\n');
- *next = '\0';
- sscanf(buf,"%d %d %d %d",&tmp,&itype,&atom1,&atom2);
- if (atom1 <= 0 || atom1 > map_tag_max ||
- atom2 <= 0 || atom2 > map_tag_max)
- error->one(FLERR,"Invalid atom ID in Bonds section of data file");
- if (itype <= 0 || itype > nbondtypes)
- error->one(FLERR,"Invalid bond type in Bonds section of data file");
- if ((m = map(atom1)) >= 0) {
- bond_type[m][num_bond[m]] = itype;
- bond_atom[m][num_bond[m]] = atom2;
- num_bond[m]++;
- }
- if (newton_bond == 0) {
- if ((m = map(atom2)) >= 0) {
- bond_type[m][num_bond[m]] = itype;
- bond_atom[m][num_bond[m]] = atom1;
- num_bond[m]++;
- }
- }
- buf = next + 1;
- }
-}
-
-/* ----------------------------------------------------------------------
- check that atom IDs are > 0 and <= map_tag_max
-------------------------------------------------------------------------- */
-
-void Atom::data_angles(int n, char *buf)
-{
- int m,tmp,itype,atom1,atom2,atom3;
- char *next;
- int newton_bond = force->newton_bond;
-
- for (int i = 0; i < n; i++) {
- next = strchr(buf,'\n');
- *next = '\0';
- sscanf(buf,"%d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3);
- if (atom1 <= 0 || atom1 > map_tag_max ||
- atom2 <= 0 || atom2 > map_tag_max ||
- atom3 <= 0 || atom3 > map_tag_max)
- error->one(FLERR,"Invalid atom ID in Angles section of data file");
- if (itype <= 0 || itype > nangletypes)
- error->one(FLERR,"Invalid angle type in Angles section of data file");
- if ((m = map(atom2)) >= 0) {
- angle_type[m][num_angle[m]] = itype;
- angle_atom1[m][num_angle[m]] = atom1;
- angle_atom2[m][num_angle[m]] = atom2;
- angle_atom3[m][num_angle[m]] = atom3;
- num_angle[m]++;
- }
- if (newton_bond == 0) {
- if ((m = map(atom1)) >= 0) {
- angle_type[m][num_angle[m]] = itype;
- angle_atom1[m][num_angle[m]] = atom1;
- angle_atom2[m][num_angle[m]] = atom2;
- angle_atom3[m][num_angle[m]] = atom3;
- num_angle[m]++;
- }
- if ((m = map(atom3)) >= 0) {
- angle_type[m][num_angle[m]] = itype;
- angle_atom1[m][num_angle[m]] = atom1;
- angle_atom2[m][num_angle[m]] = atom2;
- angle_atom3[m][num_angle[m]] = atom3;
- num_angle[m]++;
- }
- }
- buf = next + 1;
- }
-}
-
-/* ----------------------------------------------------------------------
- check that atom IDs are > 0 and <= map_tag_max
-------------------------------------------------------------------------- */
-
-void Atom::data_dihedrals(int n, char *buf)
-{
- int m,tmp,itype,atom1,atom2,atom3,atom4;
- char *next;
- int newton_bond = force->newton_bond;
-
- for (int i = 0; i < n; i++) {
- next = strchr(buf,'\n');
- *next = '\0';
- sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
- if (atom1 <= 0 || atom1 > map_tag_max ||
- atom2 <= 0 || atom2 > map_tag_max ||
- atom3 <= 0 || atom3 > map_tag_max ||
- atom4 <= 0 || atom4 > map_tag_max)
- error->one(FLERR,"Invalid atom ID in Dihedrals section of data file");
- if (itype <= 0 || itype > ndihedraltypes)
- error->one(FLERR,
- "Invalid dihedral type in Dihedrals section of data file");
- if ((m = map(atom2)) >= 0) {
- dihedral_type[m][num_dihedral[m]] = itype;
- dihedral_atom1[m][num_dihedral[m]] = atom1;
- dihedral_atom2[m][num_dihedral[m]] = atom2;
- dihedral_atom3[m][num_dihedral[m]] = atom3;
- dihedral_atom4[m][num_dihedral[m]] = atom4;
- num_dihedral[m]++;
- }
- if (newton_bond == 0) {
- if ((m = map(atom1)) >= 0) {
- dihedral_type[m][num_dihedral[m]] = itype;
- dihedral_atom1[m][num_dihedral[m]] = atom1;
- dihedral_atom2[m][num_dihedral[m]] = atom2;
- dihedral_atom3[m][num_dihedral[m]] = atom3;
- dihedral_atom4[m][num_dihedral[m]] = atom4;
- num_dihedral[m]++;
- }
- if ((m = map(atom3)) >= 0) {
- dihedral_type[m][num_dihedral[m]] = itype;
- dihedral_atom1[m][num_dihedral[m]] = atom1;
- dihedral_atom2[m][num_dihedral[m]] = atom2;
- dihedral_atom3[m][num_dihedral[m]] = atom3;
- dihedral_atom4[m][num_dihedral[m]] = atom4;
- num_dihedral[m]++;
- }
- if ((m = map(atom4)) >= 0) {
- dihedral_type[m][num_dihedral[m]] = itype;
- dihedral_atom1[m][num_dihedral[m]] = atom1;
- dihedral_atom2[m][num_dihedral[m]] = atom2;
- dihedral_atom3[m][num_dihedral[m]] = atom3;
- dihedral_atom4[m][num_dihedral[m]] = atom4;
- num_dihedral[m]++;
- }
- }
- buf = next + 1;
- }
-}
-
-/* ----------------------------------------------------------------------
- check that atom IDs are > 0 and <= map_tag_max
-------------------------------------------------------------------------- */
-
-void Atom::data_impropers(int n, char *buf)
-{
- int m,tmp,itype,atom1,atom2,atom3,atom4;
- char *next;
- int newton_bond = force->newton_bond;
-
- for (int i = 0; i < n; i++) {
- next = strchr(buf,'\n');
- *next = '\0';
- sscanf(buf,"%d %d %d %d %d %d",&tmp,&itype,&atom1,&atom2,&atom3,&atom4);
- if (atom1 <= 0 || atom1 > map_tag_max ||
- atom2 <= 0 || atom2 > map_tag_max ||
- atom3 <= 0 || atom3 > map_tag_max ||
- atom4 <= 0 || atom4 > map_tag_max)
- error->one(FLERR,"Invalid atom ID in Impropers section of data file");
- if (itype <= 0 || itype > nimpropertypes)
- error->one(FLERR,
- "Invalid improper type in Impropers section of data file");
- if ((m = map(atom2)) >= 0) {
- improper_type[m][num_improper[m]] = itype;
- improper_atom1[m][num_improper[m]] = atom1;
- improper_atom2[m][num_improper[m]] = atom2;
- improper_atom3[m][num_improper[m]] = atom3;
- improper_atom4[m][num_improper[m]] = atom4;
- num_improper[m]++;
- }
- if (newton_bond == 0) {
- if ((m = map(atom1)) >= 0) {
- improper_type[m][num_improper[m]] = itype;
- improper_atom1[m][num_improper[m]] = atom1;
- improper_atom2[m][num_improper[m]] = atom2;
- improper_atom3[m][num_improper[m]] = atom3;
- improper_atom4[m][num_improper[m]] = atom4;
- num_improper[m]++;
- }
- if ((m = map(atom3)) >= 0) {
- improper_type[m][num_improper[m]] = itype;
- improper_atom1[m][num_improper[m]] = atom1;
- improper_atom2[m][num_improper[m]] = atom2;
- improper_atom3[m][num_improper[m]] = atom3;
- improper_atom4[m][num_improper[m]] = atom4;
- num_improper[m]++;
- }
- if ((m = map(atom4)) >= 0) {
- improper_type[m][num_improper[m]] = itype;
- improper_atom1[m][num_improper[m]] = atom1;
- improper_atom2[m][num_improper[m]] = atom2;
- improper_atom3[m][num_improper[m]] = atom3;
- improper_atom4[m][num_improper[m]] = atom4;
- num_improper[m]++;
- }
- }
- buf = next + 1;
- }
-}
-
/* ----------------------------------------------------------------------
allocate arrays of length ntypes
only done after ntypes is set
@@ -1210,7 +1331,7 @@ int Atom::find_molecule(char *id)
------------------------------------------------------------------------- */
void Atom::add_molecule_atom(Molecule *onemol, int iatom,
- int ilocal, int offset)
+ int ilocal, tagint offset)
{
if (onemol->qflag) q[ilocal] = onemol->q[iatom];
if (onemol->radiusflag) radius[ilocal] = onemol->radius[iatom];
@@ -1709,9 +1830,9 @@ bigint Atom::memory_usage()
bigint bytes = avec->memory_usage();
memory->destroy(memstr);
- bytes += smax*sizeof(int);
+ bytes += max_same*sizeof(int);
if (map_style == 1)
- bytes += memory->usage(map_array,map_tag_max+1);
+ bytes += memory->usage(map_array,max_array);
else if (map_style == 2) {
bytes += map_nbucket*sizeof(int);
bytes += map_nhash*sizeof(HashElem);
diff --git a/src/atom.h b/src/atom.h
index 3dfc010d5b..8a5a0b643f 100644
--- a/src/atom.h
+++ b/src/atom.h
@@ -45,7 +45,8 @@ class Atom : protected Pointers {
// per-atom arrays
// customize by adding new array
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
@@ -65,24 +66,24 @@ class Atom : protected Pointers {
double *cv;
int **nspecial; // 0,1,2 = cummulative # of 1-2,1-3,1-4 neighs
- int **special; // IDs of 1-2,1-3,1-4 neighs of each atom
+ tagint **special; // IDs of 1-2,1-3,1-4 neighs of each atom
int maxspecial; // special[nlocal][maxspecial]
int *num_bond;
int **bond_type;
- int **bond_atom;
+ tagint **bond_atom;
int *num_angle;
int **angle_type;
- int **angle_atom1,**angle_atom2,**angle_atom3;
+ tagint **angle_atom1,**angle_atom2,**angle_atom3;
int *num_dihedral;
int **dihedral_type;
- int **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
+ tagint **dihedral_atom1,**dihedral_atom2,**dihedral_atom3,**dihedral_atom4;
int *num_improper;
int **improper_type;
- int **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
+ tagint **improper_atom1,**improper_atom2,**improper_atom3,**improper_atom4;
// custom arrays used by fix property/atom
@@ -133,9 +134,9 @@ class Atom : protected Pointers {
int nextra_border_max;
int nextra_store;
- int map_style; // default or user-specified style of map
- // 0 = none, 1 = array, 2 = hash
- int map_tag_max; // max atom ID that map() is setup for
+ int map_style; // style of atom map: 0=none, 1=array, 2=hash
+ int map_user; // user selected style = same 0,1,2
+ tagint map_tag_max; // max atom ID that map() is setup for
// spatial sorting of atoms
@@ -159,6 +160,7 @@ class Atom : protected Pointers {
class AtomVec *style_match(const char *);
void modify_params(int, char **);
+ void tag_check();
void tag_extend();
int tag_consecutive();
@@ -167,14 +169,15 @@ class Atom : protected Pointers {
void data_atoms(int, char *);
void data_vels(int, char *);
+
+ void data_bonds(int, char *, int *);
+ void data_angles(int, char *, int *);
+ void data_dihedrals(int, char *, int *);
+ void data_impropers(int, char *, int *);
+
void data_bonus(int, char *, class AtomVec *);
void data_bodies(int, char *, class AtomVecBody *);
- void data_bonds(int, char *);
- void data_angles(int, char *);
- void data_dihedrals(int, char *);
- void data_impropers(int, char *);
-
void allocate_type_arrays();
void set_mass(const char *);
void set_mass(int, double);
@@ -187,7 +190,7 @@ class Atom : protected Pointers {
void add_molecule(int, char **);
int find_molecule(char *);
- void add_molecule_atom(class Molecule *, int, int, int);
+ void add_molecule_atom(class Molecule *, int, int, tagint);
void first_reorder();
void sort();
@@ -212,7 +215,7 @@ class Atom : protected Pointers {
// map lookup function inlined for efficiency
// return -1 if no map defined
- inline int map(int global) {
+ inline int map(tagint global) {
if (map_style == 1) return map_array[global];
else if (map_style == 2) return map_find_hash(global);
else return -1;
@@ -221,28 +224,31 @@ class Atom : protected Pointers {
void map_init();
void map_clear();
void map_set();
- void map_one(int, int);
+ void map_one(tagint, int);
void map_delete();
- int map_find_hash(int);
+ int map_find_hash(tagint);
private:
// global to local ID mapping
int *map_array; // direct map of length map_tag_max + 1
- int smax; // max size of sametag
struct HashElem {
- int global; // key to search on = global ID
- int local; // value associated with key = local index
- int next; // next entry in this bucket, -1 if last
+ tagint global; // key to search on = global ID
+ int local; // value associated with key = local index
+ int next; // next entry in this bucket, -1 if last
};
- int map_nhash; // # of entries hash table can hold
- int map_nused; // # of actual entries in hash table
- int map_free; // ptr to 1st unused entry in hash table
- int map_nbucket; // # of hash buckets
- int *map_bucket; // ptr to 1st entry in each bucket
- HashElem *map_hash; // hash table
+ int map_nhash; // # of entries hash table can hold
+ int map_nused; // # of actual entries in hash table
+ int map_free; // ptr to 1st unused entry in hash table
+ int map_nbucket; // # of hash buckets
+ int *map_bucket; // ptr to 1st entry in each bucket
+ HashElem *map_hash; // hash table
+
+ int max_array; // allocated size of map_array (+1)
+ int max_nhash; // allocated size of hash table
+ int max_same; // allocated size of sametag
// spatial sorting of atoms
diff --git a/src/atom_map.cpp b/src/atom_map.cpp
index 93c377b81e..eab9b226f3 100644
--- a/src/atom_map.cpp
+++ b/src/atom_map.cpp
@@ -25,61 +25,100 @@ using namespace LAMMPS_NS;
allocate and initialize array or hash table for global -> local map
set map_tag_max = largest atom ID (may be larger than natoms)
for array option:
- array length = 1 to largest tag of any atom
+ array length = 1 to map_tag_max
set entire array to -1 as initial values
for hash option:
map_nhash = length of hash table
- map_nbucket = # of hash buckets, prime larger than map_nhash
+ map_nbucket = # of hash buckets, prime larger than map_nhash * 2
so buckets will only be filled with 0 or 1 atoms on average
------------------------------------------------------------------------- */
void Atom::map_init()
{
- map_delete();
-
if (tag_enable == 0)
error->all(FLERR,"Cannot create an atom map unless atoms have IDs");
- int max = 0;
+ int map_style_old = map_style;
+
+ // map_tag_max = max ID of any atom that will be in new map
+
+ tagint max = 0;
for (int i = 0; i < nlocal; i++) max = MAX(max,tag[i]);
- MPI_Allreduce(&max,&map_tag_max,1,MPI_INT,MPI_MAX,world);
+ MPI_Allreduce(&max,&map_tag_max,1,MPI_LMP_TAGINT,MPI_MAX,world);
- memory->destroy(sametag);
- smax = nlocal + nghost + EXTRA;
- memory->create(sametag,smax,"atom:sametag");
+ // set map_style for new map
+ // if user-selected, use that setting
+ // else if map_tag_max > 1M, use hash
+ // else use array
+
+ if (map_user) map_style = map_user;
+ else if (map_tag_max > 1000000) map_style = 2;
+ else map_style = 1;
- if (map_style == 1) {
- memory->create(map_array,map_tag_max+1,"atom:map_array");
- for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
+ // recreate = 1 if must delete old map and create new map
+ // recreate = 0 if can re-use old map w/out realloc and just adjust settings
+
+ int recreate = 0;
+ if (map_style != map_style_old) recreate = 1;
+ else if (map_style == 1 && map_tag_max > max_array) recreate = 1;
+ else if (map_style == 2 && nlocal+nghost > map_nhash) recreate = 1;
+
+ // if not recreating:
+ // for array, just initialize current map_tag_max values
+ // for hash, set all buckets to empty, put all entries in free list
+
+ if (!recreate) {
+ if (map_style == 1) {
+ for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
+ } else {
+ for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
+ map_nused = 0;
+ map_free = 0;
+ for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
+ map_hash[map_nhash-1].next = -1;
+ }
+
+ // delete old map and create new one for array or hash
} else {
+ map_delete();
- // map_nhash = max # of atoms that can be hashed on this proc
- // set to max of ave atoms/proc or atoms I can store
- // multiply by 2, require at least 1000
- // doubling means hash table will be re-init only rarely
+ if (map_style == 1) {
+ max_array = map_tag_max;
+ memory->create(map_array,max_array+1,"atom:map_array");
+ for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1;
+
+ } else {
- int nper = static_cast (natoms/comm->nprocs);
- map_nhash = MAX(nper,nmax);
- map_nhash *= 2;
- map_nhash = MAX(map_nhash,1000);
+ // map_nhash = max # of atoms that can be hashed on this proc
+ // set to max of ave atoms/proc or atoms I can store
+ // multiply by 2, require at least 1000
+ // doubling means hash table will need to be re-init only rarely
- // map_nbucket = prime just larger than map_nhash
+ int nper = static_cast (natoms/comm->nprocs);
+ map_nhash = MAX(nper,nmax);
+ map_nhash *= 2;
+ map_nhash = MAX(map_nhash,1000);
- map_nbucket = next_prime(map_nhash);
+ // map_nbucket = prime just larger than map_nhash
+ // next_prime() should be fast enough,
+ // about 10% of odd integers are prime above 1M
- // set all buckets to empty
- // set hash to map_nhash in length
- // put all hash entries in free list and point them to each other
+ map_nbucket = next_prime(map_nhash);
- map_bucket = new int[map_nbucket];
- for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
+ // set all buckets to empty
+ // set hash to map_nhash in length
+ // put all hash entries in free list and point them to each other
+
+ map_bucket = new int[map_nbucket];
+ for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1;
- map_hash = new HashElem[map_nhash];
- map_nused = 0;
- map_free = 0;
- for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
- map_hash[map_nhash-1].next = -1;
+ map_hash = new HashElem[map_nhash];
+ map_nused = 0;
+ map_free = 0;
+ for (int i = 0; i < map_nhash; i++) map_hash[i].next = i+1;
+ map_hash[map_nhash-1].next = -1;
+ }
}
}
@@ -99,7 +138,8 @@ void Atom::map_clear()
}
} else {
- int previous,global,ibucket,index;
+ int previous,ibucket,index;
+ tagint global;
int nall = nlocal + nghost;
for (int i = 0; i < nall; i++) {
sametag[i] = -1;
@@ -144,21 +184,37 @@ void Atom::map_clear()
void Atom::map_set()
{
int nall = nlocal + nghost;
- if (nall > smax) {
- smax = nall + EXTRA;
- memory->destroy(sametag);
- memory->create(sametag,smax,"atom:sametag");
- }
if (map_style == 1) {
+
+ // possible reallocation of sametag must come before loop over atoms
+ // since loop sets sametag
+
+ if (nall > max_same) {
+ max_same = nall + EXTRA;
+ memory->destroy(sametag);
+ memory->create(sametag,max_same,"atom:sametag");
+ }
+
for (int i = nall-1; i >= 0 ; i--) {
sametag[i] = map_array[tag[i]];
map_array[tag[i]] = i;
}
} else {
- int previous,global,ibucket,index;
+
+ // possible reallocation of sametag must come after map_init()
+ // since map_init() will invoke map_delete(), whacking sametag
+
if (nall > map_nhash) map_init();
+ if (nall > max_same) {
+ max_same = nall + EXTRA;
+ memory->destroy(sametag);
+ memory->create(sametag,max_same,"atom:sametag");
+ }
+
+ int previous,ibucket,index;
+ tagint global;
for (int i = nall-1; i >= 0 ; i--) {
sametag[i] = map_find_hash(tag[i]);
@@ -203,7 +259,7 @@ void Atom::map_set()
called by Special class
------------------------------------------------------------------------- */
-void Atom::map_one(int global, int local)
+void Atom::map_one(tagint global, int local)
{
if (map_style == 1) map_array[global] = local;
else {
@@ -246,6 +302,7 @@ void Atom::map_delete()
{
memory->destroy(sametag);
sametag = NULL;
+ max_same = 0;
if (map_style == 1) {
memory->destroy(map_array);
@@ -259,7 +316,6 @@ void Atom::map_delete()
}
map_nhash = 0;
}
- map_tag_max = 0;
}
/* ----------------------------------------------------------------------
@@ -267,7 +323,7 @@ void Atom::map_delete()
called by map() in atom.h
------------------------------------------------------------------------- */
-int Atom::map_find_hash(int global)
+int Atom::map_find_hash(tagint global)
{
int local = -1;
int index = map_bucket[global % map_nbucket];
diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp
index 04964d5d1c..fba68e808e 100644
--- a/src/atom_vec.cpp
+++ b/src/atom_vec.cpp
@@ -82,7 +82,7 @@ void AtomVec::data_vel(int m, char **values)
void AtomVec::pack_vel(double **buf)
{
double **v = atom->v;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
for (int i = 0; i < nlocal; i++) {
@@ -100,8 +100,8 @@ void AtomVec::pack_vel(double **buf)
void AtomVec::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
+ fprintf(fp,TAGINT_FORMAT " %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
}
/* ----------------------------------------------------------------------
@@ -111,12 +111,12 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf)
if bondtype is negative, flip back to positive
------------------------------------------------------------------------- */
-int AtomVec::pack_bond(int **buf)
+int AtomVec::pack_bond(tagint **buf)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_bond = atom->num_bond;
int **bond_type = atom->bond_type;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -154,10 +154,11 @@ int AtomVec::pack_bond(int **buf)
write bond info to data file
------------------------------------------------------------------------- */
-void AtomVec::write_bond(FILE *fp, int n, int **buf, int index)
+void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index)
{
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %d %d %d\n",index,buf[i][0],buf[i][1],buf[i][2]);
+ fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
+ index,buf[i][0],buf[i][1],buf[i][2]);
index++;
}
}
@@ -169,14 +170,14 @@ void AtomVec::write_bond(FILE *fp, int n, int **buf, int index)
if angletype is negative, flip back to positive
------------------------------------------------------------------------- */
-int AtomVec::pack_angle(int **buf)
+int AtomVec::pack_angle(tagint **buf)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_angle = atom->num_angle;
int **angle_type = atom->angle_type;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -216,11 +217,12 @@ int AtomVec::pack_angle(int **buf)
write angle info to data file
------------------------------------------------------------------------- */
-void AtomVec::write_angle(FILE *fp, int n, int **buf, int index)
+void AtomVec::write_angle(FILE *fp, int n, tagint **buf, int index)
{
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %d %d %d %d\n",index,
- buf[i][0],buf[i][1],buf[i][2],buf[i][3]);
+ fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT "\n",
+ index,buf[i][0],buf[i][1],buf[i][2],buf[i][3]);
index++;
}
}
@@ -229,15 +231,15 @@ void AtomVec::write_angle(FILE *fp, int n, int **buf, int index)
pack dihedral info for data file
------------------------------------------------------------------------- */
-void AtomVec::pack_dihedral(int **buf)
+void AtomVec::pack_dihedral(tagint **buf)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_dihedral = atom->num_dihedral;
int **dihedral_type = atom->dihedral_type;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -271,11 +273,12 @@ void AtomVec::pack_dihedral(int **buf)
write dihedral info to data file
------------------------------------------------------------------------- */
-void AtomVec::write_dihedral(FILE *fp, int n, int **buf, int index)
+void AtomVec::write_dihedral(FILE *fp, int n, tagint **buf, int index)
{
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %d %d %d %d %d\n",index,
- buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
+ fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
+ index,buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
index++;
}
}
@@ -284,15 +287,15 @@ void AtomVec::write_dihedral(FILE *fp, int n, int **buf, int index)
pack improper info for data file
------------------------------------------------------------------------- */
-void AtomVec::pack_improper(int **buf)
+void AtomVec::pack_improper(tagint **buf)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_improper = atom->num_improper;
int **improper_type = atom->improper_type;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -326,11 +329,12 @@ void AtomVec::pack_improper(int **buf)
write improper info to data file
------------------------------------------------------------------------- */
-void AtomVec::write_improper(FILE *fp, int n, int **buf, int index)
+void AtomVec::write_improper(FILE *fp, int n, tagint **buf, int index)
{
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %d %d %d %d %d\n",index,
- buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
+ fprintf(fp,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT "\n",
+ index,buf[i][0],buf[i][1],buf[i][2],buf[i][3],buf[i][4]);
index++;
}
}
diff --git a/src/atom_vec.h b/src/atom_vec.h
index 167b561074..4a27b66e6c 100644
--- a/src/atom_vec.h
+++ b/src/atom_vec.h
@@ -99,14 +99,14 @@ class AtomVec : protected Pointers {
virtual int write_vel_hybrid(FILE *, double *) {return 0;}
void reset();
- int pack_bond(int **);
- void write_bond(FILE *, int, int **, int);
- int pack_angle(int **);
- void write_angle(FILE *, int, int **, int);
- void pack_dihedral(int **);
- void write_dihedral(FILE *, int, int **, int);
- void pack_improper(int **);
- void write_improper(FILE *, int, int **, int);
+ int pack_bond(tagint **);
+ void write_bond(FILE *, int, tagint **, int);
+ int pack_angle(tagint **);
+ void write_angle(FILE *, int, tagint **, int);
+ void pack_dihedral(tagint **);
+ void write_dihedral(FILE *, int, tagint **, int);
+ void pack_improper(tagint **);
+ void write_improper(FILE *, int, tagint **, int);
virtual bigint memory_usage() = 0;
@@ -128,8 +128,8 @@ class AtomVec : protected Pointers {
// the cast prevents compiler warnings about possible truncation
union ubuf {
- double d;
- int64_t i;
+ double d;
+ int64_t i;
ubuf(double arg) : d(arg) {}
ubuf(int64_t arg) : i(arg) {}
ubuf(int arg) : i(arg) {}
diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp
index f27178b8fd..5d96dc139e 100644
--- a/src/atom_vec_atomic.cpp
+++ b/src/atom_vec_atomic.cpp
@@ -402,7 +402,7 @@ void AtomVecAtomic::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
}
@@ -426,7 +426,7 @@ void AtomVecAtomic::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
v[i][0] = buf[m++];
@@ -481,7 +481,7 @@ int AtomVecAtomic::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -560,7 +560,7 @@ int AtomVecAtomic::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -613,10 +613,7 @@ void AtomVecAtomic::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -661,8 +658,8 @@ void AtomVecAtomic::pack_data(double **buf)
void AtomVecAtomic::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4],
(int) ubuf(buf[i][5]).i,(int) ubuf(buf[i][6]).i,
(int) ubuf(buf[i][7]).i);
diff --git a/src/atom_vec_atomic.h b/src/atom_vec_atomic.h
index 6c056ff694..3dd2cd38b2 100644
--- a/src/atom_vec_atomic.h
+++ b/src/atom_vec_atomic.h
@@ -53,7 +53,8 @@ class AtomVecAtomic : public AtomVec {
bigint memory_usage();
protected:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
};
diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp
index b91ecdde9c..429ac39137 100644
--- a/src/atom_vec_body.cpp
+++ b/src/atom_vec_body.cpp
@@ -834,7 +834,7 @@ void AtomVecBody::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
body[i] = (int) ubuf(buf[m++]).i;
@@ -882,7 +882,7 @@ void AtomVecBody::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
body[i] = (int) ubuf(buf[m++]).i;
@@ -1027,7 +1027,7 @@ int AtomVecBody::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1176,7 +1176,7 @@ int AtomVecBody::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1305,10 +1305,7 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1442,8 +1439,8 @@ int AtomVecBody::pack_data_hybrid(int i, double *buf)
void AtomVecBody::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %g %g %g %g %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %d %g %g %g %g %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
@@ -1497,8 +1494,8 @@ int AtomVecBody::pack_vel_hybrid(int i, double *buf)
void AtomVecBody::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %g %g %g %g %g %g\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
+ fprintf(fp,TAGINT_FORMAT " %g %g %g %g %g %g\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h
index aad592fe4d..c16be4e2c8 100644
--- a/src/atom_vec_body.h
+++ b/src/atom_vec_body.h
@@ -90,7 +90,8 @@ class AtomVecBody : public AtomVec {
void data_body(int, int, int, char **, char **);
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *rmass;
diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp
index 38b4385c9b..d8b4b7430c 100644
--- a/src/atom_vec_charge.cpp
+++ b/src/atom_vec_charge.cpp
@@ -428,7 +428,7 @@ void AtomVecCharge::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -453,7 +453,7 @@ void AtomVecCharge::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
q[i] = buf[m++];
@@ -524,7 +524,7 @@ int AtomVecCharge::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -607,7 +607,7 @@ int AtomVecCharge::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -664,10 +664,7 @@ void AtomVecCharge::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -737,8 +734,8 @@ int AtomVecCharge::pack_data_hybrid(int i, double *buf)
void AtomVecCharge::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4],buf[i][5],
(int) ubuf(buf[i][6]).i,(int) ubuf(buf[i][7]).i,
(int) ubuf(buf[i][8]).i);
diff --git a/src/atom_vec_charge.h b/src/atom_vec_charge.h
index 2f0e48e2d1..9c634eba36 100644
--- a/src/atom_vec_charge.h
+++ b/src/atom_vec_charge.h
@@ -58,7 +58,8 @@ class AtomVecCharge : public AtomVec {
bigint memory_usage();
protected:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *q;
diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp
index 2eda8b0e6a..512f3ba74b 100644
--- a/src/atom_vec_ellipsoid.cpp
+++ b/src/atom_vec_ellipsoid.cpp
@@ -768,7 +768,7 @@ void AtomVecEllipsoid::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
ellipsoid[i] = (int) ubuf(buf[m++]).i;
@@ -811,7 +811,7 @@ void AtomVecEllipsoid::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
ellipsoid[i] = (int) ubuf(buf[m++]).i;
@@ -939,7 +939,7 @@ int AtomVecEllipsoid::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1061,7 +1061,7 @@ int AtomVecEllipsoid::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1143,10 +1143,7 @@ void AtomVecEllipsoid::data_atom(double *coord, imageint imagetmp,
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1307,8 +1304,9 @@ int AtomVecEllipsoid::pack_data_hybrid(int i, double *buf)
void AtomVecEllipsoid::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,
buf[i][3],buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
@@ -1362,8 +1360,9 @@ int AtomVecEllipsoid::pack_vel_hybrid(int i, double *buf)
void AtomVecEllipsoid::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
+ fprintf(fp,TAGINT_FORMAT
+ " %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h
index 077ae66870..306b9eca1e 100644
--- a/src/atom_vec_ellipsoid.h
+++ b/src/atom_vec_ellipsoid.h
@@ -84,7 +84,8 @@ class AtomVecEllipsoid : public AtomVec {
void set_shape(int, double, double, double);
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *rmass;
diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp
index 710d15e2bd..d88f67a854 100644
--- a/src/atom_vec_hybrid.cpp
+++ b/src/atom_vec_hybrid.cpp
@@ -616,7 +616,7 @@ void AtomVecHybrid::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
}
@@ -647,7 +647,7 @@ void AtomVecHybrid::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
v[i][0] = buf[m++];
@@ -864,10 +864,7 @@ void AtomVecHybrid::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -954,8 +951,8 @@ void AtomVecHybrid::write_data(FILE *fp, int n, double **buf)
int k,m;
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT " %d %-1.16e %-1.16e %-1.16e",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],buf[i][4]);
m = 5;
@@ -998,8 +995,8 @@ void AtomVecHybrid::write_vel(FILE *fp, int n, double **buf)
int k,m;
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d %g %g %g",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
+ fprintf(fp,TAGINT_FORMAT " %g %g %g",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3]);
m = 4;
for (k = 0; k < nstyles; k++)
diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h
index 32f4b48931..ce8e332ec4 100644
--- a/src/atom_vec_hybrid.h
+++ b/src/atom_vec_hybrid.h
@@ -67,7 +67,8 @@ class AtomVecHybrid : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double **omega,**angmom;
diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp
index f8785eed9f..5c89d237fc 100644
--- a/src/atom_vec_line.cpp
+++ b/src/atom_vec_line.cpp
@@ -666,7 +666,7 @@ void AtomVecLine::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -702,7 +702,7 @@ void AtomVecLine::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -811,7 +811,7 @@ int AtomVecLine::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -923,7 +923,7 @@ int AtomVecLine::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -999,12 +999,8 @@ void AtomVecLine::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1170,8 +1166,9 @@ int AtomVecLine::pack_data_hybrid(int i, double *buf)
void AtomVecLine::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,(int) ubuf(buf[i][3]).i,
buf[i][4],buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
@@ -1225,8 +1222,9 @@ int AtomVecLine::pack_vel_hybrid(int i, double *buf)
void AtomVecLine::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
+ fprintf(fp,TAGINT_FORMAT
+ " %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h
index 890a0f1beb..845db60815 100644
--- a/src/atom_vec_line.h
+++ b/src/atom_vec_line.h
@@ -84,7 +84,8 @@ class AtomVecLine : public AtomVec {
void set_length(int, double);
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *molecule;
diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp
index c1d7e3a1d8..acb1251981 100644
--- a/src/atom_vec_sphere.cpp
+++ b/src/atom_vec_sphere.cpp
@@ -702,7 +702,7 @@ void AtomVecSphere::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
radius[i] = buf[m++];
@@ -729,7 +729,7 @@ void AtomVecSphere::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
radius[i] = buf[m++];
@@ -810,7 +810,7 @@ int AtomVecSphere::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -901,7 +901,7 @@ int AtomVecSphere::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -966,10 +966,7 @@ void AtomVecSphere::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
type[nlocal] = atoi(values[1]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1095,8 +1092,9 @@ int AtomVecSphere::pack_data_hybrid(int i, double *buf)
void AtomVecSphere::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6],
(int) ubuf(buf[i][7]).i,(int) ubuf(buf[i][8]).i,
@@ -1150,8 +1148,9 @@ int AtomVecSphere::pack_vel_hybrid(int i, double *buf)
void AtomVecSphere::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
+ fprintf(fp,TAGINT_FORMAT
+ " %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
diff --git a/src/atom_vec_sphere.h b/src/atom_vec_sphere.h
index f5f680aa14..2b0d056dd8 100644
--- a/src/atom_vec_sphere.h
+++ b/src/atom_vec_sphere.h
@@ -69,7 +69,8 @@ class AtomVecSphere : public AtomVec {
bigint memory_usage();
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
double *radius,*density,*rmass;
diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp
index 591ad31976..d170c8b5d0 100644
--- a/src/atom_vec_tri.cpp
+++ b/src/atom_vec_tri.cpp
@@ -882,7 +882,7 @@ void AtomVecTri::unpack_border(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -938,7 +938,7 @@ void AtomVecTri::unpack_border_vel(int n, int first, double *buf)
x[i][0] = buf[m++];
x[i][1] = buf[m++];
x[i][2] = buf[m++];
- tag[i] = (int) ubuf(buf[m++]).i;
+ tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i;
molecule[i] = (int) ubuf(buf[m++]).i;
@@ -1105,7 +1105,7 @@ int AtomVecTri::unpack_exchange(double *buf)
v[nlocal][0] = buf[m++];
v[nlocal][1] = buf[m++];
v[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1255,7 +1255,7 @@ int AtomVecTri::unpack_restart(double *buf)
x[nlocal][0] = buf[m++];
x[nlocal][1] = buf[m++];
x[nlocal][2] = buf[m++];
- tag[nlocal] = (int) ubuf(buf[m++]).i;
+ tag[nlocal] = (tagint) ubuf(buf[m++]).i;
type[nlocal] = (int) ubuf(buf[m++]).i;
mask[nlocal] = (int) ubuf(buf[m++]).i;
image[nlocal] = (imageint) ubuf(buf[m++]).i;
@@ -1350,12 +1350,8 @@ void AtomVecTri::data_atom(double *coord, imageint imagetmp, char **values)
int nlocal = atom->nlocal;
if (nlocal == nmax) grow(0);
- tag[nlocal] = atoi(values[0]);
- if (tag[nlocal] <= 0)
- error->one(FLERR,"Invalid atom ID in Atoms section of data file");
-
+ tag[nlocal] = ATOTAGINT(values[0]);
molecule[nlocal] = atoi(values[1]);
-
type[nlocal] = atoi(values[2]);
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -1618,8 +1614,9 @@ int AtomVecTri::pack_data_hybrid(int i, double *buf)
void AtomVecTri::write_data(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
- (int) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
+ fprintf(fp,TAGINT_FORMAT
+ " %d %d %d %-1.16e %-1.16e %-1.16e %-1.16e %d %d %d\n",
+ (tagint) ubuf(buf[i][0]).i,(int) ubuf(buf[i][1]).i,
(int) ubuf(buf[i][2]).i,(int) ubuf(buf[i][3]).i,
buf[i][4],buf[i][5],buf[i][6],buf[i][7],
(int) ubuf(buf[i][8]).i,(int) ubuf(buf[i][9]).i,
@@ -1673,8 +1670,9 @@ int AtomVecTri::pack_vel_hybrid(int i, double *buf)
void AtomVecTri::write_vel(FILE *fp, int n, double **buf)
{
for (int i = 0; i < n; i++)
- fprintf(fp,"%d %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
- (int) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
+ fprintf(fp,TAGINT_FORMAT
+ " %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e %-1.16e\n",
+ (tagint) ubuf(buf[i][0]).i,buf[i][1],buf[i][2],buf[i][3],
buf[i][4],buf[i][5],buf[i][6]);
}
diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h
index 91cf27be84..da33113678 100644
--- a/src/atom_vec_tri.h
+++ b/src/atom_vec_tri.h
@@ -86,7 +86,8 @@ class AtomVecTri : public AtomVec {
void set_equilateral(int, double);
private:
- int *tag,*type,*mask;
+ tagint *tag;
+ int *type,*mask;
imageint *image;
double **x,**v,**f;
int *molecule;
diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp
index 626fc7df84..6e2cd57322 100644
--- a/src/compute_angle_local.cpp
+++ b/src/compute_angle_local.cpp
@@ -116,11 +116,11 @@ int ComputeAngleLocal::compute_angles(int flag)
double **x = atom->x;
int *num_angle = atom->num_angle;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp
index 344157eec4..ad6697e048 100644
--- a/src/compute_bond_local.cpp
+++ b/src/compute_bond_local.cpp
@@ -122,9 +122,9 @@ int ComputeBondLocal::compute_bonds(int flag)
double **x = atom->x;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp
index 030090dcb2..b1713873b2 100644
--- a/src/compute_cluster_atom.cpp
+++ b/src/compute_cluster_atom.cpp
@@ -120,7 +120,7 @@ void ComputeClusterAtom::compute_peratom()
// every atom starts in its own cluster, with clusterID = atomID
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
for (ii = 0; ii < inum; ii++) {
diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp
index e0f600521c..438f665da6 100644
--- a/src/compute_dihedral_local.cpp
+++ b/src/compute_dihedral_local.cpp
@@ -115,11 +115,11 @@ int ComputeDihedralLocal::compute_dihedrals(int flag)
double **x = atom->x;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
- int *tag = atom->tag;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp
index 862169fbbc..4e66856df3 100644
--- a/src/compute_improper_local.cpp
+++ b/src/compute_improper_local.cpp
@@ -116,11 +116,11 @@ int ComputeImproperLocal::compute_impropers(int flag)
double **x = atom->x;
int *num_improper = atom->num_improper;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
- int *tag = atom->tag;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp
index 9b3dc754bc..250451950e 100644
--- a/src/compute_property_atom.cpp
+++ b/src/compute_property_atom.cpp
@@ -434,7 +434,7 @@ double ComputePropertyAtom::memory_usage()
void ComputePropertyAtom::pack_id(int n)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp
index fa1fbbabde..b9fc3ab4d0 100644
--- a/src/compute_property_local.cpp
+++ b/src/compute_property_local.cpp
@@ -334,7 +334,6 @@ int ComputePropertyLocal::count_pairs(int allflag, int forceflag)
int *ilist,*jlist,*numneigh,**firstneigh;
double **x = atom->x;
- int *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@@ -407,9 +406,9 @@ int ComputePropertyLocal::count_bonds(int flag)
int i,atom1,atom2;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -448,11 +447,11 @@ int ComputePropertyLocal::count_angles(int flag)
int i,atom1,atom2,atom3;
int *num_angle = atom->num_angle;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@@ -490,11 +489,11 @@ int ComputePropertyLocal::count_dihedrals(int flag)
int i,atom1,atom2,atom3,atom4;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
- int *tag = atom->tag;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@@ -533,11 +532,11 @@ int ComputePropertyLocal::count_impropers(int flag)
int i,atom1,atom2,atom3,atom4;
int *num_improper = atom->num_improper;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
- int *tag = atom->tag;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
@@ -607,7 +606,7 @@ double ComputePropertyLocal::memory_usage()
void ComputePropertyLocal::pack_patom1(int n)
{
int i;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -621,7 +620,7 @@ void ComputePropertyLocal::pack_patom1(int n)
void ComputePropertyLocal::pack_patom2(int n)
{
int i;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int m = 0; m < ncount; m++) {
i = indices[m][1];
@@ -663,7 +662,7 @@ void ComputePropertyLocal::pack_ptype2(int n)
void ComputePropertyLocal::pack_batom1(int n)
{
int i;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -677,7 +676,7 @@ void ComputePropertyLocal::pack_batom1(int n)
void ComputePropertyLocal::pack_batom2(int n)
{
int i,j;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -707,7 +706,7 @@ void ComputePropertyLocal::pack_btype(int n)
void ComputePropertyLocal::pack_aatom1(int n)
{
int i,j;
- int **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom1 = atom->angle_atom1;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -722,7 +721,7 @@ void ComputePropertyLocal::pack_aatom1(int n)
void ComputePropertyLocal::pack_aatom2(int n)
{
int i,j;
- int **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom2 = atom->angle_atom2;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -737,7 +736,7 @@ void ComputePropertyLocal::pack_aatom2(int n)
void ComputePropertyLocal::pack_aatom3(int n)
{
int i,j;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom3 = atom->angle_atom3;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -767,7 +766,7 @@ void ComputePropertyLocal::pack_atype(int n)
void ComputePropertyLocal::pack_datom1(int n)
{
int i,j;
- int **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -782,7 +781,7 @@ void ComputePropertyLocal::pack_datom1(int n)
void ComputePropertyLocal::pack_datom2(int n)
{
int i,j;
- int **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -797,7 +796,7 @@ void ComputePropertyLocal::pack_datom2(int n)
void ComputePropertyLocal::pack_datom3(int n)
{
int i,j;
- int **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -812,7 +811,7 @@ void ComputePropertyLocal::pack_datom3(int n)
void ComputePropertyLocal::pack_datom4(int n)
{
int i,j;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -842,7 +841,7 @@ void ComputePropertyLocal::pack_dtype(int n)
void ComputePropertyLocal::pack_iatom1(int n)
{
int i,j;
- int **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom1 = atom->improper_atom1;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -857,7 +856,7 @@ void ComputePropertyLocal::pack_iatom1(int n)
void ComputePropertyLocal::pack_iatom2(int n)
{
int i,j;
- int **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom2 = atom->improper_atom2;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -872,7 +871,7 @@ void ComputePropertyLocal::pack_iatom2(int n)
void ComputePropertyLocal::pack_iatom3(int n)
{
int i,j;
- int **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom3 = atom->improper_atom3;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
@@ -887,7 +886,7 @@ void ComputePropertyLocal::pack_iatom3(int n)
void ComputePropertyLocal::pack_iatom4(int n)
{
int i,j;
- int **improper_atom4 = atom->improper_atom4;
+ tagint **improper_atom4 = atom->improper_atom4;
for (int m = 0; m < ncount; m++) {
i = indices[m][0];
diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp
index f83edfa638..1e1f5716da 100644
--- a/src/create_atoms.cpp
+++ b/src/create_atoms.cpp
@@ -22,6 +22,7 @@
#include "irregular.h"
#include "modify.h"
#include "force.h"
+#include "special.h"
#include "fix.h"
#include "domain.h"
#include "lattice.h"
@@ -121,7 +122,7 @@ void CreateAtoms::command(int narg, char **arg)
else error->all(FLERR,"Illegal create_atoms command");
iarg += 2;
} else if (strcmp(arg[iarg],"mol") == 0) {
- if (iarg+3 > narg) error->all(FLERR,"Illegal fix create_atoms command");
+ if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
int imol = atom->find_molecule(arg[iarg+1]);
if (imol == -1)
error->all(FLERR,"Molecule ID for create_atoms does not exist");
@@ -152,20 +153,21 @@ void CreateAtoms::command(int narg, char **arg)
ranmol = NULL;
if (mode == MOLECULE) {
- if (atom->molecule_flag == 0)
- error->all(FLERR,"Create_atoms mol requires atom attribute molecule");
if (onemol->xflag == 0)
error->all(FLERR,"Create_atoms molecule must have coordinates");
if (onemol->typeflag == 0)
error->all(FLERR,"Create_atoms molecule must have atom types");
if (ntype+onemol->maxtype <= 0 || ntype+onemol->maxtype > atom->ntypes)
error->all(FLERR,"Invalid atom type in create_atoms mol command");
+ if (onemol->tag_require && !atom->tag_enable)
+ error->all(FLERR,
+ "Create_atoms molecule has atom IDs, but system does not");
// create_atoms uses geoemetric center of molecule for insertion
onemol->compute_center();
- // molecule random number generator, same for all procs
+ // molecule random number generator, different for each proc
ranmol = new RanMars(lmp,molseed+comm->me);
}
@@ -251,99 +253,88 @@ void CreateAtoms::command(int narg, char **arg)
fix->set_arrays(i);
}
- // new total # of atoms and error check
- // for MOLECULE mode, require atom IDs
+ // set new total # of atoms and error check
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
- if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
+ if (atom->natoms < 0 || atom->natoms >= MAXBIGINT)
error->all(FLERR,"Too many total atoms");
- if (atom->natoms > MAXSMALLINT) {
- if (mode == ATOM) {
- if (comm->me == 0)
- error->warning(FLERR,"Total atom count exceeds ID limit, "
- "atoms will not have individual IDs");
- atom->tag_enable = 0;
- } else error->all(FLERR,"Total atom count exceeds ID limit");
- }
- // for ATOM mode:
- // add IDs for newly created atoms if IDs are still enabled
- // if global map exists, reset it
+ // add IDs for newly created atoms
+ // check that atom IDs are valid
- if (mode == ATOM) {
- if (atom->natoms <= MAXSMALLINT) atom->tag_extend();
- if (atom->map_style) {
- atom->nghost = 0;
- atom->map_init();
- atom->map_set();
- }
- }
+ if (atom->tag_enable) atom->tag_extend();
+ atom->tag_check();
- // for MOLECULE mode:
- // set atom and molecule IDs for created atoms
- // send atoms to new owning procs via irregular comm
- // since not all created atoms will be within my sub-domain
+ // if molecular system or user-requested, create global mapping of atoms
+ // zero nghost in case are adding new atoms to existing atoms
- if (mode == MOLECULE) {
-
- // add atom IDs for newly created atoms and reset global map
- // global map must exist since atom->molecular is required to be set
-
- atom->tag_extend();
+ if (atom->molecular || atom->map_user) {
atom->nghost = 0;
atom->map_init();
atom->map_set();
-
- // maxmol = max molecule ID across all procs, for previous atoms
+ }
- int *molecule = atom->molecule;
+ // for MOLECULE mode:
+ // set molecule IDs for created atoms if used
+ // reset new molecule bond,angle,etc and special values
+ // send atoms to new owning procs via irregular comm
+ // since not all atoms I created will be within my sub-domain
+ // perform special list build if needed
+
+ if (mode == MOLECULE) {
- int max = 0;
- for (int i = 0; i < nlocal_previous; i++) max = MAX(max,molecule[i]);
- int maxmol;
- MPI_Allreduce(&max,&maxmol,1,MPI_INT,MPI_MAX,world);
-
// molcreate = # of molecules I created
+
+ int molcreate = (atom->nlocal - nlocal_previous) / onemol->natoms;
+
+ // maxmol = max molecule ID across all procs, for previous atoms
// moloffset = max molecule ID for all molecules owned by previous procs
// including molecules existing before this creation
- int molcreate = (atom->nlocal - nlocal_previous) / onemol->natoms;
int moloffset;
- MPI_Scan(&molcreate,&moloffset,1,MPI_INT,MPI_SUM,world);
- moloffset = moloffset - molcreate + maxmol;
+ int *molecule = atom->molecule;
+ if (molecule) {
+ int max = 0;
+ for (int i = 0; i < nlocal_previous; i++) max = MAX(max,molecule[i]);
+ int maxmol;
+ MPI_Allreduce(&max,&maxmol,1,MPI_INT,MPI_MAX,world);
+ MPI_Scan(&molcreate,&moloffset,1,MPI_INT,MPI_SUM,world);
+ moloffset = moloffset - molcreate + maxmol;
+ }
// loop over molecules I created
// set their molecule ID
// reset their bond,angle,etc and special values
int natoms = onemol->natoms;
+ tagint offset = 0;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_bond = atom->num_bond;
int *num_angle = atom->num_angle;
int *num_dihedral = atom->num_dihedral;
int *num_improper = atom->num_improper;
- int **bond_atom = atom->bond_atom;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
+ tagint **bond_atom = atom->bond_atom;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
int **nspecial = atom->nspecial;
- int **special = atom->special;
+ tagint **special = atom->special;
int ilocal = nlocal_previous;
for (int i = 0; i < molcreate; i++) {
- int offset = tag[ilocal]-1;
+ if (tag) offset = tag[ilocal]-1;
for (int m = 0; m < natoms; m++) {
- molecule[ilocal] = moloffset + i+1;
+ if (molecule) molecule[ilocal] = moloffset + i+1;
if (onemol->bondflag)
for (int j = 0; j < num_bond[ilocal]; j++)
bond_atom[ilocal][j] += offset;
@@ -404,6 +395,17 @@ void CreateAtoms::command(int narg, char **arg)
fprintf(logfile,"Created " BIGINT_FORMAT " atoms\n",
atom->natoms-natoms_previous);
}
+
+ // for MOLECULE mode:
+ // create special bond lists for molecular systems
+ // only if onemol added bonds but not special info
+
+ if (mode == MOLECULE) {
+ if (atom->molecular && onemol->bondflag && !onemol->specialflag) {
+ Special special(lmp);
+ special.build();
+ }
+ }
}
/* ----------------------------------------------------------------------
@@ -439,7 +441,6 @@ void CreateAtoms::add_single()
}
}
-
/* ----------------------------------------------------------------------
add Nrandom atoms at random locations
------------------------------------------------------------------------- */
diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp
index db752d0b2c..ac1c354d29 100644
--- a/src/delete_atoms.cpp
+++ b/src/delete_atoms.cpp
@@ -85,7 +85,7 @@ void DeleteAtoms::command(int narg, char **arg)
// set all atom IDs to 0, call tag_extend()
if (atom->molecular == 0 && compress_flag) {
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (i = 0; i < nlocal; i++) tag[i] = 0;
atom->tag_extend();
}
@@ -292,7 +292,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg)
// at end of loop, there are no more overlaps
// only ever delete owned atom I, never J even if owned
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
double **x = atom->x;
double *special_coul = force->special_coul;
diff --git a/src/domain.cpp b/src/domain.cpp
index 862aa75c33..135591b113 100644
--- a/src/domain.cpp
+++ b/src/domain.cpp
@@ -582,7 +582,7 @@ void Domain::image_check()
// which means image flags in that dimension were different
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
double delx,dely,delz;
@@ -654,7 +654,7 @@ void Domain::box_too_small_check()
// assuming 2 atoms have consistent image flags
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
double **x = atom->x;
int nlocal = atom->nlocal;
diff --git a/src/dump.cpp b/src/dump.cpp
index c37a324564..965aa29a75 100644
--- a/src/dump.cpp
+++ b/src/dump.cpp
@@ -34,7 +34,6 @@ using namespace LAMMPS_NS;
Dump *Dump::dumpptr;
#define BIG 1.0e20
-#define IBIG 2147483647
#define EPSILON 1.0e-6
enum{ASCEND,DESCEND};
@@ -77,7 +76,8 @@ Dump::Dump(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp)
maxbuf = maxids = maxsort = maxproc = 0;
buf = bufsort = NULL;
- ids = idsort = index = proclist = NULL;
+ ids = idsort = NULL;
+ index = proclist = NULL;
irregular = NULL;
maxsbuf = 0;
@@ -177,7 +177,8 @@ void Dump::init()
maxids = maxsort = maxproc = 0;
bufsort = NULL;
- ids = idsort = index = proclist = NULL;
+ ids = idsort = NULL;
+ index = proclist = NULL;
irregular = NULL;
}
@@ -194,6 +195,7 @@ void Dump::init()
bigint size = group->count(igroup);
if (size > MAXSMALLINT) error->all(FLERR,"Too many atoms to dump sort");
+ int isize = static_cast (size);
// set reorderflag = 1 if can simply reorder local atoms rather than sort
// criteria: sorting by ID, atom IDs are consecutive from 1 to Natoms
@@ -202,32 +204,31 @@ void Dump::init()
reorderflag = 0;
if (sortcol == 0 && atom->tag_consecutive()) {
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
- int min = IBIG;
- int max = 0;
+ tagint min = MAXTAGINT;
+ tagint max = 0;
for (int i = 0; i < nlocal; i++)
if (mask[i] & groupbit) {
min = MIN(min,tag[i]);
max = MAX(max,tag[i]);
}
- int minall,maxall;
- MPI_Allreduce(&min,&minall,1,MPI_INT,MPI_MIN,world);
- MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
- int isize = static_cast (size);
+ tagint minall,maxall;
+ MPI_Allreduce(&min,&minall,1,MPI_LMP_TAGINT,MPI_MIN,world);
+ MPI_Allreduce(&max,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
if (maxall-minall+1 == isize) {
reorderflag = 1;
double range = maxall-minall + EPSILON;
idlo = static_cast (range*me/nprocs + minall);
- int idhi = static_cast (range*(me+1)/nprocs + minall);
+ tagint idhi = static_cast (range*(me+1)/nprocs + minall);
- int lom1 = static_cast ((idlo-1-minall)/range * nprocs);
- int lo = static_cast ((idlo-minall)/range * nprocs);
- int him1 = static_cast ((idhi-1-minall)/range * nprocs);
- int hi = static_cast ((idhi-minall)/range * nprocs);
+ tagint lom1 = static_cast ((idlo-1-minall)/range * nprocs);
+ tagint lo = static_cast ((idlo-minall)/range * nprocs);
+ tagint him1 = static_cast ((idhi-1-minall)/range * nprocs);
+ tagint hi = static_cast ((idhi-minall)/range * nprocs);
if (me && me == lom1) idlo--;
else if (me && me != lo) idlo++;
if (me+1 == him1) idhi--;
@@ -513,7 +514,7 @@ void Dump::sort()
bufsort = dptr;
if (sortcol == 0) {
- int *iptr = ids;
+ tagint *iptr = ids;
ids = idsort;
idsort = iptr;
}
@@ -533,16 +534,21 @@ void Dump::sort()
// proclist[i] = which proc Ith datum will be sent to
if (sortcol == 0) {
- int min = IBIG;
- int max = 0;
+ tagint min = MAXTAGINT;
+ tagint max = 0;
for (i = 0; i < nme; i++) {
min = MIN(min,ids[i]);
max = MAX(max,ids[i]);
}
- int minall,maxall;
- MPI_Allreduce(&min,&minall,1,MPI_INT,MPI_MIN,world);
- MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
- double range = maxall-minall + EPSILON;
+ tagint minall,maxall;
+ MPI_Allreduce(&min,&minall,1,MPI_LMP_TAGINT,MPI_MIN,world);
+ MPI_Allreduce(&max,&maxall,1,MPI_LMP_TAGINT,MPI_MAX,world);
+
+ // use 0.5 instead of EPSILON since atom IDs are integers
+ // if use EPSILON, it can be lost if 64-bit maxall-minall is too big
+ // then iproc == nprocs for largest ID, causing irregular to crash
+
+ double range = maxall-minall + 0.5;
for (i = 0; i < nme; i++) {
iproc = static_cast ((ids[i]-minall)/range * nprocs);
proclist[i] = iproc;
@@ -589,7 +595,7 @@ void Dump::sort()
irregular->exchange_data((char *) buf,size_one*sizeof(double),
(char *) bufsort);
if (sortcol == 0)
- irregular->exchange_data((char *) ids,sizeof(int),(char *) idsort);
+ irregular->exchange_data((char *) ids,sizeof(tagint),(char *) idsort);
irregular->destroy_data();
}
@@ -645,7 +651,7 @@ void Dump::sort()
int Dump::idcompare(const void *pi, const void *pj)
{
- int *idsort = dumpptr->idsort;
+ tagint *idsort = dumpptr->idsort;
int i = *((int *) pi);
int j = *((int *) pj);
diff --git a/src/dump.h b/src/dump.h
index ce2f0dc4e7..1c8017ee9a 100644
--- a/src/dump.h
+++ b/src/dump.h
@@ -95,7 +95,7 @@ class Dump : protected Pointers {
int reorderflag; // 1 if OK to reorder instead of sort
int ntotal_reorder; // # of atoms that must be in snapshot
int nme_reorder; // # of atoms I must own in snapshot
- int idlo; // lowest ID I own when reordering
+ tagint idlo; // lowest ID I own when reordering
int maxbuf; // size of buf
double *buf; // memory for atom quantities
@@ -106,9 +106,10 @@ class Dump : protected Pointers {
int maxids; // size of ids
int maxsort; // size of bufsort, idsort, index
int maxproc; // size of proclist
- int *ids; // list of atom IDs, if sorting on IDs
+ tagint *ids; // list of atom IDs, if sorting on IDs
double *bufsort;
- int *idsort,*index,*proclist;
+ tagint *idsort;
+ int *index,*proclist;
class Irregular *irregular;
@@ -117,7 +118,7 @@ class Dump : protected Pointers {
virtual int modify_param(int, char **) {return 0;}
virtual void write_header(bigint) = 0;
virtual int count();
- virtual void pack(int *) = 0;
+ virtual void pack(tagint *) = 0;
virtual int convert_string(int, double *) {return 0;}
virtual void write_data(int, double *) = 0;
diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp
index 1a1313e3a3..068c4e3dff 100644
--- a/src/dump_atom.cpp
+++ b/src/dump_atom.cpp
@@ -55,8 +55,8 @@ void DumpAtom::init_style()
strcat(format,"\n");
} else {
char *str;
- if (image_flag == 0) str = (char *) "%d %d %g %g %g";
- else str = (char *) "%d %d %g %g %g %d %d %d";
+ if (image_flag == 0) str = (char *) TAGINT_FORMAT " %d %g %g %g";
+ else str = (char *) TAGINT_FORMAT " %d %g %g %g %d %d %d";
int n = strlen(str) + 2;
format = new char[n];
strcpy(format,str);
@@ -145,7 +145,7 @@ void DumpAtom::write_header(bigint ndump)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack(int *ids)
+void DumpAtom::pack(tagint *ids)
{
(this->*pack_choice)(ids);
}
@@ -237,11 +237,11 @@ void DumpAtom::header_item_triclinic(bigint ndump)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_scale_image(int *ids)
+void DumpAtom::pack_scale_image(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
imageint *image = atom->image;
int *mask = atom->mask;
@@ -269,11 +269,11 @@ void DumpAtom::pack_scale_image(int *ids)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_scale_noimage(int *ids)
+void DumpAtom::pack_scale_noimage(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
@@ -297,11 +297,11 @@ void DumpAtom::pack_scale_noimage(int *ids)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_scale_image_triclinic(int *ids)
+void DumpAtom::pack_scale_image_triclinic(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
imageint *image = atom->image;
int *mask = atom->mask;
@@ -328,11 +328,11 @@ void DumpAtom::pack_scale_image_triclinic(int *ids)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_scale_noimage_triclinic(int *ids)
+void DumpAtom::pack_scale_noimage_triclinic(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
@@ -355,11 +355,11 @@ void DumpAtom::pack_scale_noimage_triclinic(int *ids)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_noscale_image(int *ids)
+void DumpAtom::pack_noscale_image(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
imageint *image = atom->image;
int *mask = atom->mask;
@@ -383,11 +383,11 @@ void DumpAtom::pack_noscale_image(int *ids)
/* ---------------------------------------------------------------------- */
-void DumpAtom::pack_noscale_noimage(int *ids)
+void DumpAtom::pack_noscale_noimage(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
@@ -422,7 +422,7 @@ int DumpAtom::convert_image(int n, double *mybuf)
}
offset += sprintf(&sbuf[offset],format,
- static_cast (mybuf[m]),
+ static_cast (mybuf[m]),
static_cast (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4],
static_cast (mybuf[m+5]),
@@ -448,7 +448,7 @@ int DumpAtom::convert_noimage(int n, double *mybuf)
}
offset += sprintf(&sbuf[offset],format,
- static_cast (mybuf[m]),
+ static_cast (mybuf[m]),
static_cast (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4]);
m += size_one;
@@ -480,7 +480,7 @@ void DumpAtom::write_lines_image(int n, double *mybuf)
int m = 0;
for (int i = 0; i < n; i++) {
fprintf(fp,format,
- static_cast (mybuf[m]), static_cast (mybuf[m+1]),
+ static_cast (mybuf[m]), static_cast (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4], static_cast (mybuf[m+5]),
static_cast (mybuf[m+6]), static_cast (mybuf[m+7]));
m += size_one;
@@ -494,7 +494,7 @@ void DumpAtom::write_lines_noimage(int n, double *mybuf)
int m = 0;
for (int i = 0; i < n; i++) {
fprintf(fp,format,
- static_cast (mybuf[m]), static_cast (mybuf[m+1]),
+ static_cast (mybuf[m]), static_cast (mybuf[m+1]),
mybuf[m+2],mybuf[m+3],mybuf[m+4]);
m += size_one;
}
diff --git a/src/dump_atom.h b/src/dump_atom.h
index 055e7787c2..ce317fea4f 100644
--- a/src/dump_atom.h
+++ b/src/dump_atom.h
@@ -37,7 +37,7 @@ class DumpAtom : public Dump {
void init_style();
int modify_param(int, char **);
void write_header(bigint);
- void pack(int *);
+ void pack(tagint *);
int convert_string(int, double *);
void write_data(int, double *);
@@ -48,14 +48,14 @@ class DumpAtom : public Dump {
void header_item(bigint);
void header_item_triclinic(bigint);
- typedef void (DumpAtom::*FnPtrPack)(int *);
+ typedef void (DumpAtom::*FnPtrPack)(tagint *);
FnPtrPack pack_choice; // ptr to pack functions
- void pack_scale_image(int *);
- void pack_scale_noimage(int *);
- void pack_noscale_image(int *);
- void pack_noscale_noimage(int *);
- void pack_scale_image_triclinic(int *);
- void pack_scale_noimage_triclinic(int *);
+ void pack_scale_image(tagint *);
+ void pack_scale_noimage(tagint *);
+ void pack_noscale_image(tagint *);
+ void pack_noscale_noimage(tagint *);
+ void pack_scale_image_triclinic(tagint *);
+ void pack_scale_noimage_triclinic(tagint *);
typedef int (DumpAtom::*FnPtrConvert)(int, double *);
FnPtrConvert convert_choice; // ptr to convert data functions
diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp
index 6ebf9c8984..558512ace7 100644
--- a/src/dump_cfg.cpp
+++ b/src/dump_cfg.cpp
@@ -33,7 +33,7 @@
using namespace LAMMPS_NS;
-enum{INT,DOUBLE,STRING}; // same as in DumpCustom
+enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCustom
#define UNWRAPEXPAND 10.0
#define ONEFIELD 32
@@ -200,6 +200,9 @@ int DumpCFG::convert_string(int n, double *mybuf)
else if (vtype[j] == STRING)
offset +=
sprintf(&sbuf[offset],vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ offset +=
+ sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m]));
}
m++;
}
@@ -232,6 +235,9 @@ int DumpCFG::convert_string(int n, double *mybuf)
else if (vtype[j] == STRING)
offset +=
sprintf(&sbuf[offset],vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ offset +=
+ sprintf(&sbuf[offset],vformat[j],static_cast (mybuf[m]));
}
m++;
}
@@ -277,6 +283,8 @@ void DumpCFG::write_lines(int n, double *mybuf)
fprintf(fp,vformat[j],mybuf[m]);
else if (vtype[j] == STRING)
fprintf(fp,vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ fprintf(fp,vformat[j],static_cast (mybuf[m]));
}
m++;
}
@@ -301,6 +309,8 @@ void DumpCFG::write_lines(int n, double *mybuf)
fprintf(fp,vformat[j],mybuf[m]);
else if (vtype[j] == STRING)
fprintf(fp,vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ fprintf(fp,vformat[j],static_cast (mybuf[m]));
}
m++;
}
diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp
index 32b3e4eb33..f0c0371044 100644
--- a/src/dump_custom.cpp
+++ b/src/dump_custom.cpp
@@ -44,7 +44,7 @@ enum{ID,MOL,TYPE,ELEMENT,MASS,
TQX,TQY,TQZ,SPIN,ERADIUS,ERVEL,ERFORCE,
COMPUTE,FIX,VARIABLE};
enum{LT,LE,GT,GE,EQ,NEQ};
-enum{INT,DOUBLE,STRING}; // same as in DumpCFG
+enum{INT,DOUBLE,STRING,BIGINT}; // same as in DumpCFG
#define INVOKED_PERATOM 8
#define ONEFIELD 32
@@ -128,6 +128,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) :
if (vtype[i] == INT) strcat(format_default,"%d ");
else if (vtype[i] == DOUBLE) strcat(format_default,"%g ");
else if (vtype[i] == STRING) strcat(format_default,"%s ");
+ else if (vtype[i] == BIGINT) strcat(format_default,BIGINT_FORMAT " ");
vformat[i] = NULL;
}
@@ -437,7 +438,7 @@ int DumpCustom::count()
// customize by adding to if statement
if (thresh_array[ithresh] == ID) {
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (i = 0; i < nlocal; i++) dchoose[i] = tag[i];
ptr = dchoose;
nstride = 1;
@@ -894,11 +895,11 @@ int DumpCustom::count()
/* ---------------------------------------------------------------------- */
-void DumpCustom::pack(int *ids)
+void DumpCustom::pack(tagint *ids)
{
for (int n = 0; n < size_one; n++) (this->*pack_choice[n])(n);
if (ids) {
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int i = 0; i < nchoose; i++)
ids[i] = tag[clist[i]];
}
@@ -929,6 +930,9 @@ int DumpCustom::convert_string(int n, double *mybuf)
offset += sprintf(&sbuf[offset],vformat[j],mybuf[m]);
else if (vtype[j] == STRING)
offset += sprintf(&sbuf[offset],vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ offset += sprintf(&sbuf[offset],vformat[j],
+ static_cast (mybuf[m]));
m++;
}
offset += sprintf(&sbuf[offset],"\n");
@@ -973,6 +977,8 @@ void DumpCustom::write_lines(int n, double *mybuf)
else if (vtype[j] == DOUBLE) fprintf(fp,vformat[j],mybuf[m]);
else if (vtype[j] == STRING)
fprintf(fp,vformat[j],typenames[(int) mybuf[m]]);
+ else if (vtype[j] == BIGINT)
+ fprintf(fp,vformat[j],static_cast (mybuf[m]));
m++;
}
fprintf(fp,"\n");
@@ -991,7 +997,8 @@ int DumpCustom::parse_fields(int narg, char **arg)
if (strcmp(arg[iarg],"id") == 0) {
pack_choice[i] = &DumpCustom::pack_id;
- vtype[i] = INT;
+ if (sizeof(tagint) == sizeof(smallint)) vtype[i] = INT;
+ else vtype[i] = BIGINT;
} else if (strcmp(arg[iarg],"mol") == 0) {
if (!atom->molecule_flag)
error->all(FLERR,"Dumping an atom property that isn't allocated");
@@ -1706,7 +1713,7 @@ void DumpCustom::pack_variable(int n)
void DumpCustom::pack_id(int n)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int i = 0; i < nchoose; i++) {
buf[n] = tag[clist[i]];
diff --git a/src/dump_custom.h b/src/dump_custom.h
index 4480bbc821..687af7bd0d 100644
--- a/src/dump_custom.h
+++ b/src/dump_custom.h
@@ -77,7 +77,7 @@ class DumpCustom : public Dump {
virtual void init_style();
virtual void write_header(bigint);
int count();
- void pack(int *);
+ void pack(tagint *);
virtual int convert_string(int, double *);
virtual void write_data(int, double *);
bigint memory_usage();
diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp
index 877d8a3f10..a4a6e4f704 100644
--- a/src/dump_dcd.cpp
+++ b/src/dump_dcd.cpp
@@ -175,11 +175,11 @@ void DumpDCD::write_header(bigint n)
/* ---------------------------------------------------------------------- */
-void DumpDCD::pack(int *ids)
+void DumpDCD::pack(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
imageint *image = atom->image;
int *mask = atom->mask;
diff --git a/src/dump_dcd.h b/src/dump_dcd.h
index f96c2cc6fc..c04c760a01 100644
--- a/src/dump_dcd.h
+++ b/src/dump_dcd.h
@@ -39,7 +39,7 @@ class DumpDCD : public Dump {
void init_style();
void openfile();
void write_header(bigint);
- void pack(int *);
+ void pack(tagint *);
void write_data(int, double *);
int modify_param(int, char **);
bigint memory_usage();
diff --git a/src/dump_image.cpp b/src/dump_image.cpp
index 05a7486c50..53f09b02a8 100644
--- a/src/dump_image.cpp
+++ b/src/dump_image.cpp
@@ -696,8 +696,8 @@ void DumpImage::create_image()
if (bondflag) {
double **x = atom->x;
- int *tag = atom->tag;
- int **bond_atom = atom->bond_atom;
+ tagint *tag = atom->tag;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
int *num_bond = atom->num_bond;
int *type = atom->type;
diff --git a/src/dump_local.cpp b/src/dump_local.cpp
index fd914563d5..f4d7fb260e 100644
--- a/src/dump_local.cpp
+++ b/src/dump_local.cpp
@@ -265,7 +265,7 @@ int DumpLocal::count()
/* ---------------------------------------------------------------------- */
-void DumpLocal::pack(int *dummy)
+void DumpLocal::pack(tagint *dummy)
{
for (int n = 0; n < size_one; n++) (this->*pack_choice[n])(n);
}
diff --git a/src/dump_local.h b/src/dump_local.h
index 7cf154d4a9..862ddf21a5 100644
--- a/src/dump_local.h
+++ b/src/dump_local.h
@@ -57,7 +57,7 @@ class DumpLocal : public Dump {
int modify_param(int, char **);
void write_header(bigint);
int count();
- void pack(int *);
+ void pack(tagint *);
int convert_string(int, double *);
void write_data(int, double *);
diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp
index f3ef0178ce..273ec06e44 100644
--- a/src/dump_xyz.cpp
+++ b/src/dump_xyz.cpp
@@ -140,11 +140,11 @@ void DumpXYZ::write_header(bigint n)
/* ---------------------------------------------------------------------- */
-void DumpXYZ::pack(int *ids)
+void DumpXYZ::pack(tagint *ids)
{
int m,n;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
double **x = atom->x;
diff --git a/src/dump_xyz.h b/src/dump_xyz.h
index f57336daa3..80719f6a84 100644
--- a/src/dump_xyz.h
+++ b/src/dump_xyz.h
@@ -35,7 +35,7 @@ class DumpXYZ : public Dump {
void init_style();
void write_header(bigint);
- void pack(int *);
+ void pack(tagint *);
int convert_string(int, double *);
void write_data(int, double *);
int modify_param(int, char **);
diff --git a/src/fix.h b/src/fix.h
index 459479d999..6f11272be6 100644
--- a/src/fix.h
+++ b/src/fix.h
@@ -116,7 +116,7 @@ class Fix : protected Pointers {
virtual void copy_arrays(int, int, int) {}
virtual void set_arrays(int) {}
virtual void update_arrays(int, int) {}
- virtual void set_molecule(int, int, double *, double *, double *) {}
+ virtual void set_molecule(int, tagint, double *, double *, double *) {}
virtual int pack_border(int, int *, double *) {return 0;}
virtual int unpack_border(int, int, double *) {return 0;}
@@ -195,6 +195,17 @@ class Fix : protected Pointers {
void v_setup(int);
void v_tally(int, int *, double, double *);
+
+ // union data struct for packing 32-bit and 64-bit ints into double bufs
+ // see atom_vec.h for documentation
+
+ union ubuf {
+ double d;
+ int64_t i;
+ ubuf(double arg) : d(arg) {}
+ ubuf(int64_t arg) : i(arg) {}
+ ubuf(int arg) : i(arg) {}
+ };
};
namespace FixConst {
diff --git a/src/fix_external.h b/src/fix_external.h
index 437519e54d..39faadefff 100644
--- a/src/fix_external.h
+++ b/src/fix_external.h
@@ -46,7 +46,7 @@ class FixExternal : public Fix {
int pack_exchange(int, double *);
int unpack_exchange(int, double *);
- typedef void (*FnPtr)(void *, bigint, int, int *, double **, double **);
+ typedef void (*FnPtr)(void *, bigint, int, tagint *, double **, double **);
void set_callback(FnPtr, void *);
private:
diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp
index 91f8bce591..a1be2b556b 100644
--- a/src/fix_property_atom.cpp
+++ b/src/fix_property_atom.cpp
@@ -174,12 +174,16 @@ void FixPropertyAtom::init()
void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
{
- int j,m,tagdata;
+ int j,m;
+ tagint itag;
char *next;
- if (atom->map_style == 0)
- error->all(FLERR,"Fix property/atom cannot read from data file "
- "unless an atom map is defined");
+ int mapflag = 0;
+ if (atom->map_style == 0) {
+ mapflag = 1;
+ atom->map_init();
+ atom->map_set();
+ }
next = strchr(buf,'\n');
*next = '\0';
@@ -198,7 +202,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
// tokenize the line into values
// if I own atom tag, unpack its values
- int map_tag_max = atom->map_tag_max;
+ tagint map_tag_max = atom->map_tag_max;
for (int i = 0; i < n; i++) {
next = strchr(buf,'\n');
@@ -207,8 +211,8 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
for (j = 1; j < nwords; j++)
values[j] = strtok(NULL," \t\n\r\f");
- tagdata = atoi(values[0]);
- if (tagdata <= 0 || tagdata > map_tag_max) {
+ itag = ATOTAGINT(values[0]);
+ if (itag <= 0 || itag > map_tag_max) {
char str[128];
sprintf(str,"Invalid atom ID in %s section of data file",keyword);
error->one(FLERR,str);
@@ -216,7 +220,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
// assign words in line to per-atom vectors
- if ((m = atom->map(tagdata)) >= 0) {
+ if ((m = atom->map(itag)) >= 0) {
for (j = 0; j < nvalue; j++) {
if (style[j] == MOLECULE) atom->molecule[m] = atoi(values[j+1]);
else if (style[j] == CHARGE) atom->q[m] = atof(values[j+1]);
@@ -231,6 +235,11 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf)
}
delete [] values;
+
+ if (mapflag) {
+ atom->map_delete();
+ atom->map_style = 0;
+ }
}
/* ----------------------------------------------------------------------
@@ -267,7 +276,7 @@ void FixPropertyAtom::write_data_section_pack(int mth, double **buf)
// 1st column = atom tag
// rest of columns = per-atom values
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
for (i = 0; i < nlocal; i++) buf[i][0] = ubuf(tag[i]).d;
@@ -316,7 +325,7 @@ void FixPropertyAtom::write_data_section(int mth, FILE *fp,
int m;
for (int i = 0; i < n; i++) {
- fprintf(fp,"%d",(int) ubuf(buf[i][0]).i);
+ fprintf(fp,TAGINT_FORMAT,(tagint) ubuf(buf[i][0]).i);
for (m = 0; m < nvalue; m++) {
if (style[m] == MOLECULE || style[m] == INTEGER)
fprintf(fp," %d",(int) ubuf(buf[i][m+1]).i);
diff --git a/src/fix_property_atom.h b/src/fix_property_atom.h
index 12ecb9694b..e8b0d67d71 100644
--- a/src/fix_property_atom.h
+++ b/src/fix_property_atom.h
@@ -57,18 +57,6 @@ class FixPropertyAtom : public Fix {
char *astyle;
int nmax_old; // length of peratom arrays the last time they grew
-
- // union data struct for packing 32-bit and 64-bit ints into double bufs
- // see atom_vec.h for documentation
-
- union ubuf {
- double d;
- int64_t i;
- ubuf(double arg) : d(arg) {}
- ubuf(int64_t arg) : i(arg) {}
- ubuf(int arg) : i(arg) {}
- };
-
};
}
diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp
index 33f717c896..70b0d72d02 100644
--- a/src/fix_restrain.cpp
+++ b/src/fix_restrain.cpp
@@ -512,7 +512,9 @@ void FixRestrain::restrain_dihedral(int m)
MPI_Comm_rank(world,&me);
if (screen) {
char str[128];
- sprintf(str,"Restrain problem: %d " BIGINT_FORMAT " %d %d %d %d",
+ sprintf(str,"Restrain problem: %d " BIGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT,
me,update->ntimestep,
atom->tag[i1],atom->tag[i2],atom->tag[i3],atom->tag[i4]);
error->warning(FLERR,str);
diff --git a/src/fix_shear_history.cpp b/src/fix_shear_history.cpp
index bebd23386d..96461d2930 100644
--- a/src/fix_shear_history.cpp
+++ b/src/fix_shear_history.cpp
@@ -119,7 +119,7 @@ void FixShearHistory::allocate_pages()
pgsize = neighbor->pgsize;
oneatom = neighbor->oneatom;
int nmypage = comm->nthreads;
- ipage = new MyPage[nmypage];
+ ipage = new MyPage[nmypage];
dpage = new MyPage[nmypage];
for (int i = 0; i < nmypage; i++) {
ipage[i].init(oneatom,pgsize);
@@ -177,7 +177,7 @@ void FixShearHistory::pre_exchange()
// calculate npartner for each owned atom
// nlocal_neigh = nlocal when neigh list was built, may be smaller than nlocal
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
NeighList *list = pair->list;
inum = list->inum;
ilist = list->ilist;
@@ -302,8 +302,8 @@ double FixShearHistory::memory_usage()
void FixShearHistory::grow_arrays(int nmax)
{
memory->grow(npartner,nmax,"shear_history:npartner");
- partner = (int **) memory->srealloc(partner,nmax*sizeof(int *),
- "shear_history:partner");
+ partner = (tagint **) memory->srealloc(partner,nmax*sizeof(tagint *),
+ "shear_history:partner");
typedef double (*sptype)[3];
shearpartner = (sptype *)
memory->srealloc(shearpartner,nmax*sizeof(sptype),
@@ -370,7 +370,7 @@ int FixShearHistory::unpack_exchange(int nlocal, double *buf)
partner[nlocal] = ipage->get(npartner[nlocal]);
shearpartner[nlocal] = dpage->get(npartner[nlocal]);
for (int n = 0; n < npartner[nlocal]; n++) {
- partner[nlocal][n] = static_cast (buf[m++]);
+ partner[nlocal][n] = static_cast (buf[m++]);
shearpartner[nlocal][n][0] = buf[m++];
shearpartner[nlocal][n][1] = buf[m++];
shearpartner[nlocal][n][2] = buf[m++];
@@ -421,7 +421,7 @@ void FixShearHistory::unpack_restart(int nlocal, int nth)
partner[nlocal] = ipage->get(npartner[nlocal]);
shearpartner[nlocal] = dpage->get(npartner[nlocal]);
for (int n = 0; n < npartner[nlocal]; n++) {
- partner[nlocal][n] = static_cast (extra[nlocal][m++]);
+ partner[nlocal][n] = static_cast (extra[nlocal][m++]);
shearpartner[nlocal][n][0] = extra[nlocal][m++];
shearpartner[nlocal][n][1] = extra[nlocal][m++];
shearpartner[nlocal][n][2] = extra[nlocal][m++];
diff --git a/src/fix_shear_history.h b/src/fix_shear_history.h
index 498ecb9069..f4f6f36254 100644
--- a/src/fix_shear_history.h
+++ b/src/fix_shear_history.h
@@ -52,7 +52,7 @@ class FixShearHistory : public Fix {
protected:
int *npartner; // # of touching partners of each atom
- int **partner; // tags for the partners
+ tagint **partner; // global atom IDs for the partners
double (**shearpartner)[3]; // 3 shear values with the partner
int maxtouch; // max # of touching partners for my atoms
@@ -60,7 +60,7 @@ class FixShearHistory : public Fix {
int *computeflag; // computeflag in PairGranHookeHistory
int pgsize,oneatom; // copy of settings in Neighbor
- MyPage *ipage; // pages of partner atom IDs
+ MyPage *ipage; // pages of partner atom IDs
MyPage *dpage; // pages of shear history with partners
void allocate_pages();
diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp
index bd95daf7a2..addcffcab4 100644
--- a/src/fix_store_state.cpp
+++ b/src/fix_store_state.cpp
@@ -588,7 +588,7 @@ int FixStoreState::size_restart(int nlocal)
void FixStoreState::pack_id(int n)
{
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *mask = atom->mask;
int nlocal = atom->nlocal;
diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp
index 1a10594478..8ac0533fff 100644
--- a/src/fix_tmd.cpp
+++ b/src/fix_tmd.cpp
@@ -394,7 +394,8 @@ void FixTMD::readfile(char *file)
char *buffer = new char[CHUNK*MAXLINE];
char *next,*bufptr;
- int i,m,nlines,tag,imageflag,ix,iy,iz;
+ int i,m,nlines,imageflag,ix,iy,iz;
+ tagint itag;
double x,y,z,xprd,yprd,zprd;
int firstline = 1;
@@ -457,11 +458,12 @@ void FixTMD::readfile(char *file)
}
if (imageflag)
- sscanf(bufptr,"%d %lg %lg %lg %d %d %d",&tag,&x,&y,&z,&ix,&iy,&iz);
+ sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg %d %d %d",
+ &itag,&x,&y,&z,&ix,&iy,&iz);
else
- sscanf(bufptr,"%d %lg %lg %lg",&tag,&x,&y,&z);
+ sscanf(bufptr,TAGINT_FORMAT " %lg %lg %lg",&itag,&x,&y,&z);
- m = atom->map(tag);
+ m = atom->map(itag);
if (m >= 0 && m < nlocal && mask[m] & groupbit) {
if (imageflag) {
xf[m][0] = x + ix*xprd;
diff --git a/src/force.cpp b/src/force.cpp
index 23699fdb2a..d486493c92 100644
--- a/src/force.cpp
+++ b/src/force.cpp
@@ -690,6 +690,40 @@ void Force::bounds(char *str, int nmax, int &nlo, int &nhi, int nmin)
error->all(FLERR,"Numeric index is out of bounds");
}
+/* ----------------------------------------------------------------------
+ compute bounds implied by numeric str with a possible wildcard asterik
+ 1 = lower bound, nmax = upper bound
+ 5 possibilities:
+ (1) i = i to i, (2) * = nmin to nmax,
+ (3) i* = i to nmax, (4) *j = nmin to j, (5) i*j = i to j
+ return nlo,nhi
+------------------------------------------------------------------------- */
+
+void Force::boundsbig(char *str, bigint nmax, bigint &nlo, bigint &nhi,
+ bigint nmin)
+{
+ char *ptr = strchr(str,'*');
+
+ if (ptr == NULL) {
+ nlo = nhi = ATOBIGINT(str);
+ } else if (strlen(str) == 1) {
+ nlo = nmin;
+ nhi = nmax;
+ } else if (ptr == str) {
+ nlo = nmin;
+ nhi = ATOBIGINT(ptr+1);
+ } else if (strlen(ptr+1) == 0) {
+ nlo = ATOBIGINT(str);
+ nhi = nmax;
+ } else {
+ nlo = ATOBIGINT(str);
+ nhi = ATOBIGINT(ptr+1);
+ }
+
+ if (nlo < nmin || nhi > nmax)
+ error->all(FLERR,"Numeric index is out of bounds");
+}
+
/* ----------------------------------------------------------------------
read a floating point value from a string
generate an error if not a legitimate floating point value
@@ -728,6 +762,24 @@ int Force::inumeric(const char *file, int line, char *str)
return atoi(str);
}
+/* ----------------------------------------------------------------------
+ read a big integer value from a string
+ generate an error if not a legitimate integer value
+ called by various commands to check validity of their arguments
+------------------------------------------------------------------------- */
+
+bigint Force::bnumeric(const char *file, int line, char *str)
+{
+ int n = strlen(str);
+ for (int i = 0; i < n; i++) {
+ if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue;
+ error->all(file,line,
+ "Expected integer parameter in input script or data file");
+ }
+
+ return ATOLL(str);
+}
+
/* ----------------------------------------------------------------------
memory usage of force classes
------------------------------------------------------------------------- */
diff --git a/src/force.h b/src/force.h
index c866656def..c2109d0899 100644
--- a/src/force.h
+++ b/src/force.h
@@ -100,8 +100,10 @@ class Force : protected Pointers {
void set_special(int, char **);
void bounds(char *, int, int &, int &, int nmin=1);
+ void boundsbig(char *, bigint, bigint &, bigint &, bigint nmin=1);
double numeric(const char *, int, char *);
int inumeric(const char *, int, char *);
+ bigint bnumeric(const char *, int, char *);
bigint memory_usage();
private:
diff --git a/src/group.cpp b/src/group.cpp
index d525c79281..22b9035cc4 100644
--- a/src/group.cpp
+++ b/src/group.cpp
@@ -174,7 +174,7 @@ void Group::assign(int narg, char **arg)
strcmp(arg[2],"<=") == 0 || strcmp(arg[2],">=") == 0 ||
strcmp(arg[2],"<>") == 0)) {
- int condition,bound1,bound2;
+ int condition;
if (strcmp(arg[2],"<") == 0) condition = LT;
else if (strcmp(arg[2],"<=") == 0) condition = LE;
else if (strcmp(arg[2],">") == 0) condition = GT;
@@ -184,66 +184,127 @@ void Group::assign(int narg, char **arg)
else if (strcmp(arg[2],"<>") == 0) condition = BETWEEN;
else error->all(FLERR,"Illegal group command");
- bound1 = force->inumeric(FLERR,arg[3]);
+ tagint bound1,bound2;
+ if (sizeof(tagint) == sizeof(smallint))
+ bound1 = force->inumeric(FLERR,arg[3]);
+ else
+ bound1 = force->bnumeric(FLERR,arg[3]);
bound2 = -1;
if (condition == BETWEEN) {
if (narg != 5) error->all(FLERR,"Illegal group command");
- bound2 = force->inumeric(FLERR,arg[4]);
+ if (sizeof(tagint) == sizeof(smallint))
+ bound2 = force->inumeric(FLERR,arg[4]);
+ else
+ bound2 = force->bnumeric(FLERR,arg[4]);
} else if (narg != 4) error->all(FLERR,"Illegal group command");
+ tagint *tag = atom->tag;
int *attribute;
if (category == TYPE) attribute = atom->type;
else if (category == MOLECULE) attribute = atom->molecule;
- else if (category == ID) attribute = atom->tag;
+ else if (category == ID) attribute = NULL;
// add to group if meets condition
- if (condition == LT) {
- for (i = 0; i < nlocal; i++) if (attribute[i] < bound1) mask[i] |= bit;
- } else if (condition == LE) {
- for (i = 0; i < nlocal; i++) if (attribute[i] <= bound1) mask[i] |= bit;
- } else if (condition == GT) {
- for (i = 0; i < nlocal; i++) if (attribute[i] > bound1) mask[i] |= bit;
- } else if (condition == GE) {
- for (i = 0; i < nlocal; i++) if (attribute[i] >= bound1) mask[i] |= bit;
- } else if (condition == EQ) {
- for (i = 0; i < nlocal; i++) if (attribute[i] == bound1) mask[i] |= bit;
- } else if (condition == NEQ) {
- for (i = 0; i < nlocal; i++) if (attribute[i] != bound1) mask[i] |= bit;
- } else if (condition == BETWEEN) {
- for (i = 0; i < nlocal; i++)
- if (attribute[i] >= bound1 && attribute[i] <= bound2) mask[i] |= bit;
+ if (attribute) {
+ if (condition == LT) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] < bound1) mask[i] |= bit;
+ } else if (condition == LE) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] <= bound1) mask[i] |= bit;
+ } else if (condition == GT) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] > bound1) mask[i] |= bit;
+ } else if (condition == GE) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] >= bound1) mask[i] |= bit;
+ } else if (condition == EQ) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] == bound1) mask[i] |= bit;
+ } else if (condition == NEQ) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] != bound1) mask[i] |= bit;
+ } else if (condition == BETWEEN) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] >= bound1 && attribute[i] <= bound2)
+ mask[i] |= bit;
+ }
+ } else {
+ if (condition == LT) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] < bound1) mask[i] |= bit;
+ } else if (condition == LE) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] <= bound1) mask[i] |= bit;
+ } else if (condition == GT) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] > bound1) mask[i] |= bit;
+ } else if (condition == GE) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] >= bound1) mask[i] |= bit;
+ } else if (condition == EQ) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] == bound1) mask[i] |= bit;
+ } else if (condition == NEQ) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] != bound1) mask[i] |= bit;
+ } else if (condition == BETWEEN) {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] >= bound1 && tag[i] <= bound2)
+ mask[i] |= bit;
+ }
}
-
+
// args = list of values
} else {
+ tagint *tag = atom->tag;
int *attribute;
if (category == TYPE) attribute = atom->type;
else if (category == MOLECULE) attribute = atom->molecule;
- else if (category == ID) attribute = atom->tag;
-
+ else if (category == ID) attribute = NULL;
+
char *ptr;
- int start,stop,delta;
+ tagint start,stop,delta;
for (int iarg = 2; iarg < narg; iarg++) {
- if (strchr(arg[iarg],':')) {
- start = atoi(strtok(arg[iarg],":"));
- stop = atoi(strtok(NULL,":"));
- ptr = strtok(NULL,":");
- if (ptr) delta = atoi(ptr);
- else delta = 1;
+ if (attribute) {
+ if (strchr(arg[iarg],':')) {
+ start = atoi(strtok(arg[iarg],":"));
+ stop = atoi(strtok(NULL,":"));
+ ptr = strtok(NULL,":");
+ if (ptr) delta = atoi(ptr);
+ else delta = 1;
+ } else {
+ start = stop = atoi(arg[iarg]);
+ delta = 1;
+ }
} else {
- start = stop = atoi(arg[iarg]);
- delta = 1;
+ if (strchr(arg[iarg],':')) {
+ start = ATOTAGINT(strtok(arg[iarg],":"));
+ stop = ATOTAGINT(strtok(NULL,":"));
+ ptr = strtok(NULL,":");
+ if (ptr) delta = ATOTAGINT(ptr);
+ else delta = 1;
+ } else {
+ start = stop = ATOTAGINT(arg[iarg]);
+ delta = 1;
+ }
}
// add to group if attribute matches value or sequence
- for (i = 0; i < nlocal; i++)
- if (attribute[i] >= start && attribute[i] <= stop &&
- (attribute[i]-start) % delta == 0) mask[i] |= bit;
+ if (attribute) {
+ for (i = 0; i < nlocal; i++)
+ if (attribute[i] >= start && attribute[i] <= stop &&
+ (attribute[i]-start) % delta == 0) mask[i] |= bit;
+ } else {
+ for (i = 0; i < nlocal; i++)
+ if (tag[i] >= start && tag[i] <= stop &&
+ (tag[i]-start) % delta == 0) mask[i] |= bit;
+ }
}
}
diff --git a/src/lammps.cpp b/src/lammps.cpp
index 69034f97bf..ae44e92f1f 100644
--- a/src/lammps.cpp
+++ b/src/lammps.cpp
@@ -381,7 +381,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
error->all(FLERR,"Imageint setting in lmptype.h is invalid");
if (sizeof(tagint) < sizeof(smallint))
error->all(FLERR,"Tagint setting in lmptype.h is invalid");
- if (sizeof(bigint) < sizeof(tagint))
+ if (sizeof(bigint) < sizeof(imageint) || sizeof(bigint) < sizeof(tagint))
error->all(FLERR,"Bigint setting in lmptype.h is invalid");
int mpisize;
@@ -393,17 +393,17 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator)
#ifdef LAMMPS_SMALLBIG
if (sizeof(smallint) != 4 || sizeof(imageint) != 4 ||
sizeof(tagint) != 4 || sizeof(bigint) != 8)
- error->all(FLERR,"Small, tag, big integers are not sized correctly");
+ error->all(FLERR,"Small to big integers are not sized correctly");
#endif
#ifdef LAMMPS_BIGBIG
if (sizeof(smallint) != 4 || sizeof(imageint) != 8 ||
sizeof(tagint) != 8 || sizeof(bigint) != 8)
- error->all(FLERR,"Small, tag, big integers are not sized correctly");
+ error->all(FLERR,"Small to big integers are not sized correctly");
#endif
#ifdef LAMMPS_SMALLSMALL
if (sizeof(smallint) != 4 || sizeof(imageint) != 4 ||
sizeof(tagint) != 4 || sizeof(bigint) != 4)
- error->all(FLERR,"Small, tag, big integers are not sized correctly");
+ error->all(FLERR,"Small to big integers are not sized correctly");
#endif
// create CUDA class if USER-CUDA installed, unless explicitly switched off
diff --git a/src/library.cpp b/src/library.cpp
index 2e28232449..60b07548dd 100644
--- a/src/library.cpp
+++ b/src/library.cpp
@@ -412,7 +412,7 @@ void lammps_gather_atoms(void *ptr, char *name,
lmp->memory->create(copy,count*natoms,"lib/gather:copy");
for (i = 0; i < count*natoms; i++) copy[i] = 0;
- int *tag = lmp->atom->tag;
+ tagint *tag = lmp->atom->tag;
int nlocal = lmp->atom->nlocal;
if (count == 1)
@@ -438,7 +438,7 @@ void lammps_gather_atoms(void *ptr, char *name,
lmp->memory->create(copy,count*natoms,"lib/gather:copy");
for (i = 0; i < count*natoms; i++) copy[i] = 0.0;
- int *tag = lmp->atom->tag;
+ tagint *tag = lmp->atom->tag;
int nlocal = lmp->atom->nlocal;
if (count == 1) {
diff --git a/src/lmptype.h b/src/lmptype.h
index 1c3b783e26..a23aa9113b 100644
--- a/src/lmptype.h
+++ b/src/lmptype.h
@@ -54,7 +54,7 @@ namespace LAMMPS_NS {
#define SBBITS 30
#define NEIGHMASK 0x3FFFFFFF
-// default to 32-bit smallint and tagint, 64-bit bigint
+// default to 32-bit smallint and other ints, 64-bit bigint
#if !defined(LAMMPS_SMALLSMALL) && !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG)
#define LAMMPS_SMALLBIG
@@ -71,7 +71,7 @@ namespace LAMMPS_NS {
#endif
// for atomic problems that exceed 2 billion (2^31) atoms
-// 32-bit smallint and imageint and tagint, 64-bit bigint
+// 32-bit smallint/imageint/tagint, 64-bit bigint
#ifdef LAMMPS_SMALLBIG
@@ -84,6 +84,7 @@ typedef int64_t bigint;
#define MAXTAGINT INT_MAX
#define MAXBIGINT INT64_MAX
+#define MPI_LMP_TAGINT MPI_INT
#define MPI_LMP_BIGINT MPI_LL
#define TAGINT_FORMAT "%d"
@@ -101,7 +102,7 @@ typedef int64_t bigint;
// for molecular problems that exceed 2 billion (2^31) atoms
// or problems where atoms wrap around the periodic box more than 512 times
-// 32-bit smallint, 64-bit imageint and tagint and bigint
+// 32-bit smallint, 64-bit imageint/tagint/bigint
#ifdef LAMMPS_BIGBIG
@@ -114,6 +115,7 @@ typedef int64_t bigint;
#define MAXTAGINT INT64_MAX
#define MAXBIGINT INT64_MAX
+#define MPI_LMP_TAGINT MPI_LL
#define MPI_LMP_BIGINT MPI_LL
#define TAGINT_FORMAT "%" PRId64
@@ -130,7 +132,7 @@ typedef int64_t bigint;
#endif
// for machines that do not support 64-bit ints
-// 32-bit smallint and imageint and tagint and bigint
+// 32-bit smallint/imageint/tagint/bigint
#ifdef LAMMPS_SMALLSMALL
@@ -143,6 +145,7 @@ typedef int bigint;
#define MAXTAGINT INT_MAX
#define MAXBIGINT INT_MAX
+#define MPI_LMP_TAGINT MPI_INT
#define MPI_LMP_BIGINT MPI_INT
#define TAGINT_FORMAT "%d"
diff --git a/src/molecule.cpp b/src/molecule.cpp
index 669a34ce13..389a9cf797 100644
--- a/src/molecule.cpp
+++ b/src/molecule.cpp
@@ -402,29 +402,29 @@ void Molecule::read(int flag)
} else if (strcmp(keyword,"Bonds") == 0) {
if (nbonds == 0)
error->all(FLERR,"Molecule file has bonds but no nbonds setting");
- bondflag = 1;
+ bondflag = tag_require = 1;
bonds(flag,line);
} else if (strcmp(keyword,"Angles") == 0) {
if (nangles == 0)
error->all(FLERR,"Molecule file has angles but no nangles setting");
- angleflag = 1;
+ angleflag = tag_require = 1;
angles(flag,line);
} else if (strcmp(keyword,"Dihedrals") == 0) {
if (ndihedrals == 0) error->all(FLERR,"Molecule file has dihedrals "
"but no ndihedrals setting");
- dihedralflag = 1;
+ dihedralflag = tag_require = 1;
dihedrals(flag,line);
} else if (strcmp(keyword,"Impropers") == 0) {
if (nimpropers == 0) error->all(FLERR,"Molecule file has impropers "
"but no nimpropers setting");
- improperflag = 1;
+ improperflag = tag_require = 1;
impropers(flag,line);
} else if (strcmp(keyword,"Special Bond Counts") == 0) {
nspecialflag = 1;
nspecial_read(flag,line);
} else if (strcmp(keyword,"Special Bonds") == 0) {
- specialflag = 1;
+ specialflag = tag_require = 1;
if (flag) special_read(line);
else skip_lines(natoms,line);
@@ -433,7 +433,7 @@ void Molecule::read(int flag)
if (flag) shakeflag_read(line);
else skip_lines(natoms,line);
} else if (strcmp(keyword,"Shake Atoms") == 0) {
- shakeatomflag = 1;
+ shakeatomflag = tag_require = 1;
if (shaketypeflag) shakeflag = 1;
if (!shakeflagflag)
error->all(FLERR,"Molecule file shake flags not before shake atoms");
@@ -1007,6 +1007,7 @@ void Molecule::initialize()
shakeflag = shakeflagflag = shakeatomflag = shaketypeflag = 0;
centerflag = massflag = comflag = inertiaflag = 0;
+ tag_require = 0;
x = NULL;
type = NULL;
diff --git a/src/molecule.h b/src/molecule.h
index 11a9c9a22d..7b35f77d1f 100644
--- a/src/molecule.h
+++ b/src/molecule.h
@@ -44,6 +44,10 @@ class Molecule : protected Pointers {
int centerflag,massflag,comflag,inertiaflag;
+ // 1 if molecule fields require atom IDs
+
+ int tag_require;
+
// attributes
double **x; // displacement of each atom from origin
diff --git a/src/neigh_bond.cpp b/src/neigh_bond.cpp
index a73ed41b44..17a6e55fd8 100644
--- a/src/neigh_bond.cpp
+++ b/src/neigh_bond.cpp
@@ -41,9 +41,9 @@ void Neighbor::bond_all()
int nlocal = atom->nlocal;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_bond = force->newton_bond;
int lostbond = output->thermo->lostbond;
@@ -57,8 +57,8 @@ void Neighbor::bond_all()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+ sprintf(str,"Bond atoms " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
tag[i],bond_atom[i][m],me,update->ntimestep);
error->one(FLERR,str);
}
@@ -98,9 +98,9 @@ void Neighbor::bond_partial()
int nlocal = atom->nlocal;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **bond_type = atom->bond_type;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int newton_bond = force->newton_bond;
int lostbond = output->thermo->lostbond;
@@ -115,8 +115,8 @@ void Neighbor::bond_partial()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Bond atoms %d %d missing on proc %d at step " BIGINT_FORMAT,
+ sprintf(str,"Bond atoms " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
tag[i],bond_atom[i][m],me,update->ntimestep);
error->one(FLERR,str);
}
@@ -181,9 +181,9 @@ void Neighbor::angle_all()
int nlocal = atom->nlocal;
int *num_angle = atom->num_angle;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
int newton_bond = force->newton_bond;
@@ -200,9 +200,9 @@ void Neighbor::angle_all()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Angle atoms %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Angle atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
me,update->ntimestep);
error->one(FLERR,str);
@@ -246,9 +246,9 @@ void Neighbor::angle_partial()
int nlocal = atom->nlocal;
int *num_angle = atom->num_angle;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom2 = atom->angle_atom2;
- int **angle_atom3 = atom->angle_atom3;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom2 = atom->angle_atom2;
+ tagint **angle_atom3 = atom->angle_atom3;
int **angle_type = atom->angle_type;
int newton_bond = force->newton_bond;
@@ -266,9 +266,9 @@ void Neighbor::angle_partial()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Angle atoms %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Angle atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
angle_atom1[i][m],angle_atom2[i][m],angle_atom3[i][m],
me,update->ntimestep);
error->one(FLERR,str);
@@ -351,10 +351,10 @@ void Neighbor::dihedral_all()
int nlocal = atom->nlocal;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
int **dihedral_type = atom->dihedral_type;
int newton_bond = force->newton_bond;
@@ -372,9 +372,10 @@ void Neighbor::dihedral_all()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Dihedral atoms %d %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Dihedral atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
dihedral_atom1[i][m],dihedral_atom2[i][m],
dihedral_atom3[i][m],dihedral_atom4[i][m],
me,update->ntimestep);
@@ -422,10 +423,10 @@ void Neighbor::dihedral_partial()
int nlocal = atom->nlocal;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
int **dihedral_type = atom->dihedral_type;
int newton_bond = force->newton_bond;
@@ -444,9 +445,10 @@ void Neighbor::dihedral_partial()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Dihedral atoms %d %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Dihedral atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
dihedral_atom1[i][m],dihedral_atom2[i][m],
dihedral_atom3[i][m],dihedral_atom4[i][m],
me,update->ntimestep);
@@ -550,10 +552,10 @@ void Neighbor::improper_all()
int nlocal = atom->nlocal;
int *num_improper = atom->num_improper;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
int **improper_type = atom->improper_type;
int newton_bond = force->newton_bond;
@@ -571,9 +573,10 @@ void Neighbor::improper_all()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Improper atoms %d %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Improper atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
improper_atom1[i][m],improper_atom2[i][m],
improper_atom3[i][m],improper_atom4[i][m],
me,update->ntimestep);
@@ -621,10 +624,10 @@ void Neighbor::improper_partial()
int nlocal = atom->nlocal;
int *num_improper = atom->num_improper;
- int **improper_atom1 = atom->improper_atom1;
- int **improper_atom2 = atom->improper_atom2;
- int **improper_atom3 = atom->improper_atom3;
- int **improper_atom4 = atom->improper_atom4;
+ tagint **improper_atom1 = atom->improper_atom1;
+ tagint **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom3 = atom->improper_atom3;
+ tagint **improper_atom4 = atom->improper_atom4;
int **improper_type = atom->improper_type;
int newton_bond = force->newton_bond;
@@ -643,9 +646,10 @@ void Neighbor::improper_partial()
nmissing++;
if (lostbond == ERROR) {
char str[128];
- sprintf(str,
- "Improper atoms %d %d %d %d missing on proc %d at step "
- BIGINT_FORMAT,
+ sprintf(str,"Improper atoms "
+ TAGINT_FORMAT " " TAGINT_FORMAT " "
+ TAGINT_FORMAT " " TAGINT_FORMAT
+ " missing on proc %d at step " BIGINT_FORMAT,
improper_atom1[i][m],improper_atom2[i][m],
improper_atom3[i][m],improper_atom4[i][m],
me,update->ntimestep);
diff --git a/src/neigh_full.cpp b/src/neigh_full.cpp
index 0c830b3720..7b536f4699 100644
--- a/src/neigh_full.cpp
+++ b/src/neigh_full.cpp
@@ -32,9 +32,9 @@ void Neighbor::full_nsq(NeighList *list)
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *neighptr;
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -115,9 +115,9 @@ void Neighbor::full_nsq_ghost(NeighList *list)
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *neighptr;
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -212,9 +212,9 @@ void Neighbor::full_bin(NeighList *list)
bin_atoms();
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -303,9 +303,9 @@ void Neighbor::full_bin_ghost(NeighList *list)
bin_atoms();
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -424,9 +424,9 @@ void Neighbor::full_multi(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
diff --git a/src/neigh_gran.cpp b/src/neigh_gran.cpp
index 204988e230..465e6af863 100644
--- a/src/neigh_gran.cpp
+++ b/src/neigh_gran.cpp
@@ -37,7 +37,8 @@ void Neighbor::granular_nsq_no_newton(NeighList *list)
double *shearptr;
NeighList *listgranhistory;
- int *npartner,**partner;
+ int *npartner;
+ tagint **partner;
double (**shearpartner)[3];
int **firsttouch;
double **firstshear;
@@ -46,7 +47,7 @@ void Neighbor::granular_nsq_no_newton(NeighList *list)
double **x = atom->x;
double *radius = atom->radius;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
int *molecule = atom->molecule;
@@ -174,7 +175,7 @@ void Neighbor::granular_nsq_newton(NeighList *list)
double **x = atom->x;
double *radius = atom->radius;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
int *molecule = atom->molecule;
@@ -264,7 +265,8 @@ void Neighbor::granular_bin_no_newton(NeighList *list)
double *shearptr;
NeighList *listgranhistory;
- int *npartner,**partner;
+ int *npartner;
+ tagint **partner;
double (**shearpartner)[3];
int **firsttouch;
double **firstshear;
@@ -279,7 +281,7 @@ void Neighbor::granular_bin_no_newton(NeighList *list)
double **x = atom->x;
double *radius = atom->radius;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *type = atom->type;
int *mask = atom->mask;
int *molecule = atom->molecule;
diff --git a/src/neigh_half_bin.cpp b/src/neigh_half_bin.cpp
index ef55cb5ba1..75736e97d2 100644
--- a/src/neigh_half_bin.cpp
+++ b/src/neigh_half_bin.cpp
@@ -39,9 +39,9 @@ void Neighbor::half_bin_no_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -134,9 +134,9 @@ void Neighbor::half_bin_no_newton_ghost(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -256,9 +256,9 @@ void Neighbor::half_bin_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -375,9 +375,9 @@ void Neighbor::half_bin_newton_tri(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
diff --git a/src/neigh_half_multi.cpp b/src/neigh_half_multi.cpp
index 46a76be6db..fddc683fb7 100644
--- a/src/neigh_half_multi.cpp
+++ b/src/neigh_half_multi.cpp
@@ -41,9 +41,9 @@ void Neighbor::half_multi_no_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -140,9 +140,9 @@ void Neighbor::half_multi_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -267,9 +267,9 @@ void Neighbor::half_multi_newton_tri(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
diff --git a/src/neigh_half_nsq.cpp b/src/neigh_half_nsq.cpp
index 8446c9d982..f8fad972bb 100644
--- a/src/neigh_half_nsq.cpp
+++ b/src/neigh_half_nsq.cpp
@@ -32,9 +32,9 @@ void Neighbor::half_nsq_no_newton(NeighList *list)
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *neighptr;
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -116,9 +116,9 @@ void Neighbor::half_nsq_no_newton_ghost(NeighList *list)
double xtmp,ytmp,ztmp,delx,dely,delz,rsq;
int *neighptr;
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -221,9 +221,9 @@ void Neighbor::half_nsq_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
diff --git a/src/neigh_respa.cpp b/src/neigh_respa.cpp
index 41ee06c9e2..346a893af7 100644
--- a/src/neigh_respa.cpp
+++ b/src/neigh_respa.cpp
@@ -36,9 +36,9 @@ void Neighbor::respa_nsq_no_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -179,9 +179,9 @@ void Neighbor::respa_nsq_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -344,9 +344,9 @@ void Neighbor::respa_bin_no_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -497,9 +497,9 @@ void Neighbor::respa_bin_newton(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
@@ -691,9 +691,9 @@ void Neighbor::respa_bin_newton_tri(NeighList *list)
// loop over each atom, storing neighbors
- int **special = atom->special;
+ tagint **special = atom->special;
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
double **x = atom->x;
int *type = atom->type;
diff --git a/src/neighbor.h b/src/neighbor.h
index 13590dd473..751e155231 100644
--- a/src/neighbor.h
+++ b/src/neighbor.h
@@ -284,8 +284,8 @@ class Neighbor : protected Pointers {
// if it is and special flag is 2 (otherwise), return 1,2,3
// for which level of neighbor it is (and which coeff it maps to)
- inline int find_special(const int *list, const int *nspecial,
- const int tag) const {
+ inline int find_special(const tagint *list, const int *nspecial,
+ const tagint tag) const {
const int n1 = nspecial[0];
const int n2 = nspecial[1];
const int n3 = nspecial[2];
diff --git a/src/read_data.cpp b/src/read_data.cpp
index 67bebe6fb8..2a512350fe 100644
--- a/src/read_data.cpp
+++ b/src/read_data.cpp
@@ -49,6 +49,8 @@ using namespace LAMMPS_NS;
// customize for new sections
#define NSECTIONS 25 // change when add to header::section_keywords
+/* ---------------------------------------------------------------------- */
+
// compare two style strings and compare under consideration of possibly
// having suffixes which should be ignored (like /cuda, /gpu, /omp, /opt)
// we also need to strip off all coulomb related parts, since they do not
@@ -91,7 +93,6 @@ static int style_match(const char *one, const char *two)
return 0;
}
-
/* ---------------------------------------------------------------------- */
ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp)
@@ -183,257 +184,359 @@ void ReadData::command(int narg, char **arg)
} else error->all(FLERR,"Illegal read_data command");
}
- // scan data file to determine max topology needed per atom
- // allocate initial topology arrays
- if (atom->molecular) {
+ // perform 1-pass read if no molecular topoogy in file
+ // perform 2-pass read if molecular topology
+ // 1st pass calculates max topology/atom
+
+ int atomflag,topoflag;
+ int bondflag,angleflag,dihedralflag,improperflag;
+ int ellipsoidflag,lineflag,triflag,bodyflag;
+
+ atomflag = topoflag = 0;
+ bondflag = angleflag = dihedralflag = improperflag = 0;
+ ellipsoidflag = lineflag = triflag = bodyflag = 0;
+
+ int firstpass = 1;
+
+ while (1) {
+
+ // open file on proc 0
+
if (me == 0) {
- if (screen) fprintf(screen,"Scanning data file ...\n");
+ if (firstpass && screen) fprintf(screen,"Reading data file ...\n");
open(arg[0]);
- header(0);
- scan(atom->bond_per_atom,atom->angle_per_atom,
- atom->dihedral_per_atom,atom->improper_per_atom);
+ } else fp = NULL;
+
+ // read header info
+
+ header();
+
+ // problem setup using info from header
+ // 1st pass only
+
+ if (firstpass) {
+ domain->box_exist = 1;
+ update->ntimestep = 0;
+
+ int n;
+ if (comm->nprocs == 1) n = static_cast (atom->natoms);
+ else n = static_cast (LB_FACTOR * atom->natoms / comm->nprocs);
+
+ atom->allocate_type_arrays();
+ atom->avec->grow(n);
+ n = atom->nmax;
+
+ domain->print_box(" ");
+ domain->set_initial_box();
+ domain->set_global_box();
+ comm->set_proc_grid();
+ domain->set_local_box();
+ }
+
+ // customize for new sections
+ // read rest of file in free format
+
+ while (strlen(keyword)) {
+
+ // if special fix matches, it processes section
+
+ if (nfix) {
+ int i;
+ for (i = 0; i < nfix; i++)
+ if (strcmp(keyword,fix_section[i]) == 0) {
+ if (firstpass) fix(i,keyword);
+ else skip_lines(modify->fix[fix_index[i]]->
+ read_data_skip_lines(keyword));
+ parse_keyword(0);
+ break;
+ }
+ if (i < nfix) continue;
+ }
+
+ if (strcmp(keyword,"Atoms") == 0) {
+ atomflag = 1;
+ if (firstpass) {
+ if (me == 0 && !style_match(style,atom->atom_style))
+ error->warning(FLERR,"Recommended atom style in data file differs");
+ atoms();
+ } else skip_lines(atom->natoms);
+ } else if (strcmp(keyword,"Velocities") == 0) {
+ if (atomflag == 0)
+ error->all(FLERR,"Must read Atoms before Velocities");
+ if (firstpass) velocities();
+ else skip_lines(atom->natoms);
+
+ } else if (strcmp(keyword,"Bonds") == 0) {
+ topoflag = bondflag = 1;
+ if (atom->avec->bonds_allow == 0)
+ error->all(FLERR,"Invalid data file section: Bonds");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
+ bonds(firstpass);
+ } else if (strcmp(keyword,"Angles") == 0) {
+ topoflag = angleflag = 1;
+ if (atom->avec->angles_allow == 0)
+ error->all(FLERR,"Invalid data file section: Angles");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
+ angles(firstpass);
+ } else if (strcmp(keyword,"Dihedrals") == 0) {
+ topoflag = dihedralflag = 1;
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,"Invalid data file section: Dihedrals");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
+ dihedrals(firstpass);
+ } else if (strcmp(keyword,"Impropers") == 0) {
+ topoflag = improperflag = 1;
+ if (atom->avec->impropers_allow == 0)
+ error->all(FLERR,"Invalid data file section: Impropers");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
+ impropers(firstpass);
+
+ } else if (strcmp(keyword,"Ellipsoids") == 0) {
+ ellipsoidflag = 1;
+ if (!avec_ellipsoid)
+ error->all(FLERR,"Invalid data file section: Ellipsoids");
+ if (atomflag == 0)
+ error->all(FLERR,"Must read Atoms before Ellipsoids");
+ if (firstpass)
+ bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
+ else skip_lines(nellipsoids);
+ } else if (strcmp(keyword,"Lines") == 0) {
+ lineflag = 1;
+ if (!avec_line)
+ error->all(FLERR,"Invalid data file section: Lines");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
+ if (firstpass) bonus(nlines,(AtomVec *) avec_line,"lines");
+ else skip_lines(nlines);
+ } else if (strcmp(keyword,"Triangles") == 0) {
+ triflag = 1;
+ if (!avec_tri)
+ error->all(FLERR,"Invalid data file section: Triangles");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
+ if (firstpass) bonus(ntris,(AtomVec *) avec_tri,"triangles");
+ else skip_lines(ntris);
+ } else if (strcmp(keyword,"Bodies") == 0) {
+ bodyflag = 1;
+ if (!avec_body)
+ error->all(FLERR,"Invalid data file section: Bodies");
+ if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bodies");
+ bodies(firstpass);
+
+ } else if (strcmp(keyword,"Masses") == 0) {
+ if (firstpass) mass();
+ else skip_lines(atom->ntypes);
+ } else if (strcmp(keyword,"Pair Coeffs") == 0) {
+ if (force->pair == NULL)
+ error->all(FLERR,"Must define pair_style before Pair Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->pair_style))
+ error->warning(FLERR,"Recommended pair style in data file differs");
+ paircoeffs();
+ } else skip_lines(atom->ntypes);
+ } else if (strcmp(keyword,"PairIJ Coeffs") == 0) {
+ if (force->pair == NULL)
+ error->all(FLERR,"Must define pair_style before PairIJ Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->pair_style))
+ error->warning(FLERR,"Recommended pair style in data file differs");
+ pairIJcoeffs();
+ } else skip_lines(atom->ntypes*(atom->ntypes+1)/2);
+ } else if (strcmp(keyword,"Bond Coeffs") == 0) {
+ if (atom->avec->bonds_allow == 0)
+ error->all(FLERR,"Invalid data file section: Bond Coeffs");
+ if (force->bond == NULL)
+ error->all(FLERR,"Must define bond_style before Bond Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->bond_style))
+ error->warning(FLERR,"Recommended bond style in data file differs");
+ bondcoeffs();
+ } else skip_lines(atom->nbondtypes);
+ } else if (strcmp(keyword,"Angle Coeffs") == 0) {
+ if (atom->avec->angles_allow == 0)
+ error->all(FLERR,"Invalid data file section: Angle Coeffs");
+ if (force->angle == NULL)
+ error->all(FLERR,"Must define angle_style before Angle Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->angle_style))
+ error->warning(FLERR,"Recommended angle style in data file differs");
+ anglecoeffs(0);
+ } else skip_lines(atom->nangletypes);
+ } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->dihedral_style))
+ error->warning(FLERR,"Recommended dihedral style in data file differs");
+ dihedralcoeffs(0);
+ } else skip_lines(atom->ndihedraltypes);
+ } else if (strcmp(keyword,"Improper Coeffs") == 0) {
+ if (atom->avec->impropers_allow == 0)
+ error->all(FLERR,"Invalid data file section: Improper Coeffs");
+ if (force->improper == NULL)
+ error->all(FLERR,"Must define improper_style before Improper Coeffs");
+ if (firstpass) {
+ if (me == 0 && !style_match(style,force->improper_style))
+ error->warning(FLERR,"Recommended improper style in data file differs");
+ impropercoeffs(0);
+ } else skip_lines(atom->nimpropertypes);
+
+ } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
+ if (atom->avec->angles_allow == 0)
+ error->all(FLERR,"Invalid data file section: BondBond Coeffs");
+ if (force->angle == NULL)
+ error->all(FLERR,"Must define angle_style before BondBond Coeffs");
+ if (firstpass) anglecoeffs(1);
+ else skip_lines(atom->nangletypes);
+ } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
+ if (atom->avec->angles_allow == 0)
+ error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
+ if (force->angle == NULL)
+ error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
+ if (firstpass) anglecoeffs(2);
+ else skip_lines(atom->nangletypes);
+
+ } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,
+ "Invalid data file section: MiddleBondTorsion Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,
+ "Must define dihedral_style before "
+ "MiddleBondTorsion Coeffs");
+ if (firstpass) dihedralcoeffs(1);
+ else skip_lines(atom->ndihedraltypes);
+ } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,
+ "Must define dihedral_style before EndBondTorsion Coeffs");
+ if (firstpass) dihedralcoeffs(2);
+ else skip_lines(atom->ndihedraltypes);
+ } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,
+ "Must define dihedral_style before AngleTorsion Coeffs");
+ if (firstpass) dihedralcoeffs(3);
+ else skip_lines(atom->ndihedraltypes);
+ } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,
+ "Invalid data file section: AngleAngleTorsion Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,
+ "Must define dihedral_style before "
+ "AngleAngleTorsion Coeffs");
+ if (firstpass) dihedralcoeffs(4);
+ else skip_lines(atom->ndihedraltypes);
+ } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
+ if (atom->avec->dihedrals_allow == 0)
+ error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
+ if (force->dihedral == NULL)
+ error->all(FLERR,
+ "Must define dihedral_style before BondBond13 Coeffs");
+ if (firstpass) dihedralcoeffs(5);
+ else skip_lines(atom->ndihedraltypes);
+
+ } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
+ if (atom->avec->impropers_allow == 0)
+ error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
+ if (force->improper == NULL)
+ error->all(FLERR,
+ "Must define improper_style before AngleAngle Coeffs");
+ if (firstpass) impropercoeffs(1);
+ else skip_lines(atom->nimpropertypes);
+
+ } else {
+ char str[128];
+ sprintf(str,"Unknown identifier in data file: %s",keyword);
+ error->all(FLERR,str);
+ }
+
+ parse_keyword(0);
+ }
+
+ // error if natoms > 0 yet no atoms were read
+
+ if (atom->natoms > 0 && atomflag == 0)
+ error->all(FLERR,"No atoms in data file");
+
+ // close file
+
+ if (me == 0) {
if (compressed) pclose(fp);
else fclose(fp);
- atom->bond_per_atom += atom->extra_bond_per_atom;
- atom->angle_per_atom += atom->extra_angle_per_atom;
- atom->dihedral_per_atom += atom->extra_dihedral_per_atom;
- atom->improper_per_atom += atom->extra_improper_per_atom;
}
- MPI_Bcast(&atom->bond_per_atom,1,MPI_INT,0,world);
- MPI_Bcast(&atom->angle_per_atom,1,MPI_INT,0,world);
- MPI_Bcast(&atom->dihedral_per_atom,1,MPI_INT,0,world);
- MPI_Bcast(&atom->improper_per_atom,1,MPI_INT,0,world);
+ // done if this was 2nd pass
- } else
- atom->bond_per_atom = atom->angle_per_atom =
- atom->dihedral_per_atom = atom->improper_per_atom = 0;
+ if (!firstpass) break;
- // read header info
+ // at end of 1st pass, error check for required sections
+ // customize for new sections
- if (me == 0) {
- if (screen) fprintf(screen,"Reading data file ...\n");
- open(arg[0]);
- } else fp = NULL;
- header(1);
- domain->box_exist = 1;
+ if ((atom->nbonds && !bondflag) || (atom->nangles && !angleflag) ||
+ (atom->ndihedrals && !dihedralflag) ||
+ (atom->nimpropers && !improperflag))
+ error->one(FLERR,"Needed molecular topology not in data file");
- // problem setup using info from header
+ if ((nellipsoids && !ellipsoidflag) || (nlines && !lineflag) ||
+ (ntris && !triflag) || (nbodies && !bodyflag))
+ error->one(FLERR,"Needed bonus data not in data file");
- update->ntimestep = 0;
+ // break out of loop if no molecular topology in file
+ // else make 2nd pass
+
+ if (!topoflag) break;
+ firstpass = 0;
- int n;
- if (comm->nprocs == 1) n = static_cast (atom->natoms);
- else n = static_cast (LB_FACTOR * atom->natoms / comm->nprocs);
+ // reallocate bond,angle,diehdral,improper arrays via grow(),
+ // using new bond,angle,dihedral,improper per-atom values from 1st pass
+ // should leave other atom arrays unchanged, since already nmax in length
- atom->allocate_type_arrays();
- atom->avec->grow(n);
- n = atom->nmax;
-
- domain->print_box(" ");
- domain->set_initial_box();
- domain->set_global_box();
- comm->set_proc_grid();
- domain->set_local_box();
-
- // customize for new sections
- // read rest of file in free format
-
- int atomflag = 0;
-
- while (strlen(keyword)) {
-
- // allow special fixes first chance to match and process the section
- // if fix matches, continue to next section
-
- if (nfix) {
- for (n = 0; n < nfix; n++)
- if (strcmp(keyword,fix_section[n]) == 0) {
- fix(n,keyword);
- parse_keyword(0,1);
- break;
- }
- if (n < nfix) continue;
+ if (bondflag) {
+ memory->destroy(atom->bond_type);
+ memory->destroy(atom->bond_atom);
+ atom->bond_type = NULL;
+ atom->bond_atom = NULL;
+ }
+ if (angleflag) {
+ memory->destroy(atom->angle_type);
+ memory->destroy(atom->angle_atom1);
+ memory->destroy(atom->angle_atom2);
+ memory->destroy(atom->angle_atom3);
+ atom->angle_type = NULL;
+ atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL;
+ }
+ if (dihedralflag) {
+ memory->destroy(atom->dihedral_type);
+ memory->destroy(atom->dihedral_atom1);
+ memory->destroy(atom->dihedral_atom2);
+ memory->destroy(atom->dihedral_atom3);
+ memory->destroy(atom->dihedral_atom4);
+ atom->dihedral_type = NULL;
+ atom->dihedral_atom1 = atom->dihedral_atom2 =
+ atom->dihedral_atom3 = atom->dihedral_atom4 = NULL;
+ }
+ if (improperflag) {
+ memory->destroy(atom->improper_type);
+ memory->destroy(atom->improper_atom1);
+ memory->destroy(atom->improper_atom2);
+ memory->destroy(atom->improper_atom3);
+ memory->destroy(atom->improper_atom4);
+ atom->improper_type = NULL;
+ atom->improper_atom1 = atom->improper_atom2 =
+ atom->improper_atom3 = atom->improper_atom4 = NULL;
}
- if (strcmp(keyword,"Atoms") == 0) {
- if (me == 0 && !style_match(style,atom->atom_style))
- error->warning(FLERR,"Recommended atom style in data file differs");
- atoms();
- atomflag = 1;
- } else if (strcmp(keyword,"Velocities") == 0) {
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Velocities");
- velocities();
-
- } else if (strcmp(keyword,"Ellipsoids") == 0) {
- if (!avec_ellipsoid)
- error->all(FLERR,"Invalid data file section: Ellipsoids");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Ellipsoids");
- bonus(nellipsoids,(AtomVec *) avec_ellipsoid,"ellipsoids");
- } else if (strcmp(keyword,"Lines") == 0) {
- if (!avec_line)
- error->all(FLERR,"Invalid data file section: Lines");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Lines");
- bonus(nlines,(AtomVec *) avec_line,"lines");
- } else if (strcmp(keyword,"Triangles") == 0) {
- if (!avec_tri)
- error->all(FLERR,"Invalid data file section: Triangles");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Triangles");
- bonus(ntris,(AtomVec *) avec_tri,"triangles");
- } else if (strcmp(keyword,"Bodies") == 0) {
- if (!avec_body)
- error->all(FLERR,"Invalid data file section: Bodies");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bodies");
- bodies();
-
- } else if (strcmp(keyword,"Bonds") == 0) {
- if (atom->avec->bonds_allow == 0)
- error->all(FLERR,"Invalid data file section: Bonds");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Bonds");
- bonds();
- } else if (strcmp(keyword,"Angles") == 0) {
- if (atom->avec->angles_allow == 0)
- error->all(FLERR,"Invalid data file section: Angles");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Angles");
- angles();
- } else if (strcmp(keyword,"Dihedrals") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: Dihedrals");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Dihedrals");
- dihedrals();
- } else if (strcmp(keyword,"Impropers") == 0) {
- if (atom->avec->impropers_allow == 0)
- error->all(FLERR,"Invalid data file section: Impropers");
- if (atomflag == 0) error->all(FLERR,"Must read Atoms before Impropers");
- impropers();
-
- } else if (strcmp(keyword,"Masses") == 0) {
- mass();
- } else if (strcmp(keyword,"Pair Coeffs") == 0) {
- if (force->pair == NULL)
- error->all(FLERR,"Must define pair_style before Pair Coeffs");
- if (me == 0 && !style_match(style,force->pair_style))
- error->warning(FLERR,"Recommended pair style in data file differs");
- paircoeffs();
- } else if (strcmp(keyword,"PairIJ Coeffs") == 0) {
- if (force->pair == NULL)
- error->all(FLERR,"Must define pair_style before PairIJ Coeffs");
- if (me == 0 && !style_match(style,force->pair_style))
- error->warning(FLERR,"Recommended pair style in data file differs");
- pairIJcoeffs();
- } else if (strcmp(keyword,"Bond Coeffs") == 0) {
- if (atom->avec->bonds_allow == 0)
- error->all(FLERR,"Invalid data file section: Bond Coeffs");
- if (force->bond == NULL)
- error->all(FLERR,"Must define bond_style before Bond Coeffs");
- if (me == 0 && !style_match(style,force->bond_style))
- error->warning(FLERR,"Recommended bond style in data file differs");
- bondcoeffs();
- } else if (strcmp(keyword,"Angle Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->all(FLERR,"Invalid data file section: Angle Coeffs");
- if (force->angle == NULL)
- error->all(FLERR,"Must define angle_style before Angle Coeffs");
- if (me == 0 && !style_match(style,force->angle_style))
- error->warning(FLERR,"Recommended angle style in data file differs");
- anglecoeffs(0);
- } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: Dihedral Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs");
- if (me == 0 && !style_match(style,force->dihedral_style))
- error->warning(FLERR,"Recommended dihedral style in data file differs");
- dihedralcoeffs(0);
- } else if (strcmp(keyword,"Improper Coeffs") == 0) {
- if (atom->avec->impropers_allow == 0)
- error->all(FLERR,"Invalid data file section: Improper Coeffs");
- if (force->improper == NULL)
- error->all(FLERR,"Must define improper_style before Improper Coeffs");
- if (me == 0 && !style_match(style,force->improper_style))
- error->warning(FLERR,"Recommended improper style in data file differs");
- impropercoeffs(0);
-
- } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->all(FLERR,"Invalid data file section: BondBond Coeffs");
- if (force->angle == NULL)
- error->all(FLERR,"Must define angle_style before BondBond Coeffs");
- anglecoeffs(1);
- } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->all(FLERR,"Invalid data file section: BondAngle Coeffs");
- if (force->angle == NULL)
- error->all(FLERR,"Must define angle_style before BondAngle Coeffs");
- anglecoeffs(2);
-
- } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,
- "Must define dihedral_style before "
- "MiddleBondTorsion Coeffs");
- dihedralcoeffs(1);
- } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,
- "Must define dihedral_style before EndBondTorsion Coeffs");
- dihedralcoeffs(2);
- } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,
- "Must define dihedral_style before AngleTorsion Coeffs");
- dihedralcoeffs(3);
- } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,
- "Must define dihedral_style before "
- "AngleAngleTorsion Coeffs");
- dihedralcoeffs(4);
- } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->all(FLERR,"Invalid data file section: BondBond13 Coeffs");
- if (force->dihedral == NULL)
- error->all(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
- dihedralcoeffs(5);
-
- } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
- if (atom->avec->impropers_allow == 0)
- error->all(FLERR,"Invalid data file section: AngleAngle Coeffs");
- if (force->improper == NULL)
- error->all(FLERR,"Must define improper_style before AngleAngle Coeffs");
- impropercoeffs(1);
-
- } else {
- char str[128];
- sprintf(str,"Unknown identifier in data file: %s",keyword);
- error->all(FLERR,str);
- }
-
- parse_keyword(0,1);
+ atom->avec->grow(atom->nmax);
}
- // close file
-
- if (me == 0) {
- if (compressed) pclose(fp);
- else fclose(fp);
- }
-
- // error if natoms > 0 yet no atoms were read
-
- if (atom->natoms > 0 && atomflag == 0)
- error->all(FLERR,"No atoms in data file");
-
- // create bond topology now that system is defined
+ // create special bond lists for molecular systems
if (atom->molecular) {
Special special(lmp);
@@ -443,8 +546,6 @@ void ReadData::command(int narg, char **arg)
/* ----------------------------------------------------------------------
read free-format header of data file
- if flag = 0, only called by proc 0
- if flag = 1, called by all procs so bcast lines as read them
1st line and blank lines are skipped
non-blank lines are checked for header keywords and leading value is read
header ends with EOF or non-blank line containing no header keyword
@@ -452,7 +553,7 @@ void ReadData::command(int narg, char **arg)
else line has first keyword line for rest of file
------------------------------------------------------------------------- */
-void ReadData::header(int flag)
+void ReadData::header()
{
int n;
char *ptr;
@@ -485,7 +586,7 @@ void ReadData::header(int flag)
if (fgets(line,MAXLINE,fp) == NULL) n = 0;
else n = strlen(line) + 1;
}
- if (flag) MPI_Bcast(&n,1,MPI_INT,0,world);
+ MPI_Bcast(&n,1,MPI_INT,0,world);
// if n = 0 then end-of-file so return with blank line
@@ -494,9 +595,7 @@ void ReadData::header(int flag)
return;
}
- // bcast line if flag is set
-
- if (flag) MPI_Bcast(line,n,MPI_CHAR,0,world);
+ MPI_Bcast(line,n,MPI_CHAR,0,world);
// trim anything from '#' onward
// if line is blank, continue
@@ -584,17 +683,17 @@ void ReadData::header(int flag)
// error check on total system size
- if (atom->natoms < 0 || atom->natoms > MAXBIGINT ||
- atom->nbonds < 0 || atom->nbonds > MAXBIGINT ||
- atom->nangles < 0 || atom->nangles > MAXBIGINT ||
- atom->ndihedrals < 0 || atom->ndihedrals > MAXBIGINT ||
- atom->nimpropers < 0 || atom->nimpropers > MAXBIGINT) {
+ if (atom->natoms < 0 || atom->natoms >= MAXBIGINT ||
+ atom->nbonds < 0 || atom->nbonds >= MAXBIGINT ||
+ atom->nangles < 0 || atom->nangles >= MAXBIGINT ||
+ atom->ndihedrals < 0 || atom->ndihedrals >= MAXBIGINT ||
+ atom->nimpropers < 0 || atom->nimpropers >= MAXBIGINT) {
if (me == 0) error->one(FLERR,"System in data file is too big");
}
// check that exiting string is a valid section keyword
- parse_keyword(1,flag);
+ parse_keyword(1);
for (n = 0; n < NSECTIONS; n++)
if (strcmp(keyword,section_keywords[n]) == 0) break;
if (n == NSECTIONS && me == 0) {
@@ -636,6 +735,11 @@ void ReadData::atoms()
{
int nchunk,eof;
+ if (me == 0) {
+ if (screen) fprintf(screen," reading atoms ...\n");
+ if (logfile) fprintf(logfile," reading atoms ...\n");
+ }
+
bigint nread = 0;
bigint natoms = atom->natoms;
@@ -659,41 +763,14 @@ void ReadData::atoms()
if (natoms != atom->natoms)
error->all(FLERR,"Did not assign all atoms correctly");
+
+ // check that atom IDs are valid
- // if any atom ID < 0, error
- // if all atom IDs = 0, tag_enable = 0
- // if any atom ID > 0, error if any atom ID == 0
- // not checking if atom IDs > natoms or are unique
+ atom->tag_check();
- int nlocal = atom->nlocal;
- int *tag = atom->tag;
+ // if molecular system or user-requested, create global mapping of atoms
- int flag = 0;
- for (int i = 0; i < nlocal; i++)
- if (tag[i] < 0) flag = 1;
- int flag_all;
- MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
- if (flag_all)
- error->all(FLERR,"Invalid atom ID in Atoms section of data file");
-
- flag = 0;
- for (int i = 0; i < nlocal; i++)
- if (tag[i] > 0) flag = 1;
- MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
- if (flag_all == 0) atom->tag_enable = 0;
-
- if (atom->tag_enable) {
- flag = 0;
- for (int i = 0; i < nlocal; i++)
- if (tag[i] == 0) flag = 1;
- MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_SUM,world);
- if (flag_all)
- error->all(FLERR,"Invalid atom ID in Atoms section of data file");
- }
-
- // create global mapping
-
- if (atom->map_style) {
+ if (atom->molecular || atom->map_user) {
atom->map_init();
atom->map_set();
}
@@ -708,10 +785,14 @@ void ReadData::velocities()
{
int nchunk,eof;
+ if (me == 0) {
+ if (screen) fprintf(screen," reading velocities ...\n");
+ if (logfile) fprintf(logfile," reading velocities ...\n");
+ }
+
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
- atom->map_style = 1;
atom->map_init();
atom->map_set();
}
@@ -738,6 +819,302 @@ void ReadData::velocities()
}
}
+/* ----------------------------------------------------------------------
+ scan or read all bonds
+------------------------------------------------------------------------- */
+
+void ReadData::bonds(int firstpass)
+{
+ if (me == 0) {
+ if (firstpass) {
+ if (screen) fprintf(screen," scanning bonds ...\n");
+ if (logfile) fprintf(logfile," scanning bonds ...\n");
+ } else {
+ if (screen) fprintf(screen," reading bonds ...\n");
+ if (logfile) fprintf(logfile," reading bonds ...\n");
+ }
+ }
+
+ // allocate count if firstpass
+
+ int nlocal = atom->nlocal;
+ int *count = NULL;
+ if (firstpass) {
+ memory->create(count,nlocal,"read_data:count");
+ for (int i = 0; i < nlocal; i++) count[i] = 0;
+ }
+
+ // read and process bonds
+
+ int nchunk,eof;
+ bigint nread = 0;
+ bigint nbonds = atom->nbonds;
+
+ while (nread < nbonds) {
+ nchunk = MIN(nbonds-nread,CHUNK);
+ eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
+ if (eof) error->all(FLERR,"Unexpected end of data file");
+ atom->data_bonds(nchunk,buffer,count);
+ nread += nchunk;
+ }
+
+ // if firstpass: tally max bond/atom and return
+
+ if (firstpass) {
+ int max = 0;
+ for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
+ int maxall;
+ MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
+
+ if (me == 0) {
+ if (screen) fprintf(screen," %d = max bonds/atom\n",maxall);
+ if (logfile) fprintf(logfile," %d = max bonds/atom\n",maxall);
+ }
+ atom->bond_per_atom = maxall;
+ memory->destroy(count);
+ return;
+ }
+
+ // if 2nd pass: check that bonds were assigned correctly
+
+ bigint n = 0;
+ for (int i = 0; i < nlocal; i++) n += atom->num_bond[i];
+ bigint sum;
+ MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
+ int factor = 1;
+ if (!force->newton_bond) factor = 2;
+
+ if (me == 0) {
+ if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
+ if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
+ }
+
+ if (sum != factor*atom->nbonds)
+ error->all(FLERR,"Bonds assigned incorrectly");
+}
+
+/* ----------------------------------------------------------------------
+ scan or read all angles
+------------------------------------------------------------------------- */
+
+void ReadData::angles(int firstpass)
+{
+ if (me == 0) {
+ if (firstpass) {
+ if (screen) fprintf(screen," scanning angles ...\n");
+ if (logfile) fprintf(logfile," scanning angles ...\n");
+ } else {
+ if (screen) fprintf(screen," reading angles ...\n");
+ if (logfile) fprintf(logfile," reading angles ...\n");
+ }
+ }
+
+ // allocate count if firstpass
+
+ int nlocal = atom->nlocal;
+ int *count = NULL;
+ if (firstpass) {
+ memory->create(count,nlocal,"read_data:count");
+ for (int i = 0; i < nlocal; i++) count[i] = 0;
+ }
+
+ // read and process angles
+
+ int nchunk,eof;
+ bigint nread = 0;
+ bigint nangles = atom->nangles;
+
+ while (nread < nangles) {
+ nchunk = MIN(nangles-nread,CHUNK);
+ eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
+ if (eof) error->all(FLERR,"Unexpected end of data file");
+ atom->data_angles(nchunk,buffer,count);
+ nread += nchunk;
+ }
+
+ // if firstpass: tally max angle/atom and return
+
+ if (firstpass) {
+ int max = 0;
+ for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
+ int maxall;
+ MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
+
+ if (me == 0) {
+ if (screen) fprintf(screen," %d = max angles/atom\n",maxall);
+ if (logfile) fprintf(logfile," %d = max angles/atom\n",maxall);
+ }
+ atom->angle_per_atom = maxall;
+ memory->destroy(count);
+ return;
+ }
+
+ // if 2nd pass: check that angles were assigned correctly
+
+ bigint n = 0;
+ for (int i = 0; i < nlocal; i++) n += atom->num_angle[i];
+ bigint sum;
+ MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
+ int factor = 1;
+ if (!force->newton_bond) factor = 3;
+
+ if (me == 0) {
+ if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
+ if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
+ }
+
+ if (sum != factor*atom->nangles)
+ error->all(FLERR,"Angles assigned incorrectly");
+}
+
+/* ----------------------------------------------------------------------
+ scan or read all dihedrals
+------------------------------------------------------------------------- */
+
+void ReadData::dihedrals(int firstpass)
+{
+ if (me == 0) {
+ if (firstpass) {
+ if (screen) fprintf(screen," scanning dihedrals ...\n");
+ if (logfile) fprintf(logfile," scanning dihedrals ...\n");
+ } else {
+ if (screen) fprintf(screen," reading dihedrals ...\n");
+ if (logfile) fprintf(logfile," reading dihedrals ...\n");
+ }
+ }
+
+ // allocate count if firstpass
+
+ int nlocal = atom->nlocal;
+ int *count = NULL;
+ if (firstpass) {
+ memory->create(count,nlocal,"read_data:count");
+ for (int i = 0; i < nlocal; i++) count[i] = 0;
+ }
+
+ // read and process dihedrals
+
+ int nchunk,eof;
+ bigint nread = 0;
+ bigint ndihedrals = atom->ndihedrals;
+
+ while (nread < ndihedrals) {
+ nchunk = MIN(ndihedrals-nread,CHUNK);
+ eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
+ if (eof) error->all(FLERR,"Unexpected end of data file");
+ atom->data_dihedrals(nchunk,buffer,count);
+ nread += nchunk;
+ }
+
+ // if firstpass: tally max dihedral/atom and return
+
+ if (firstpass) {
+ int max = 0;
+ for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
+ int maxall;
+ MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
+
+ if (me == 0) {
+ if (screen) fprintf(screen," %d = max dihedrals/atom\n",maxall);
+ if (logfile) fprintf(logfile," %d = max dihedrals/atom\n",maxall);
+ }
+ atom->dihedral_per_atom = maxall;
+ memory->destroy(count);
+ return;
+ }
+
+ // if 2nd pass: check that dihedrals were assigned correctly
+
+ bigint n = 0;
+ for (int i = 0; i < nlocal; i++) n += atom->num_dihedral[i];
+ bigint sum;
+ MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
+ int factor = 1;
+ if (!force->newton_bond) factor = 4;
+
+ if (me == 0) {
+ if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",sum/factor);
+ if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",sum/factor);
+ }
+
+ if (sum != factor*atom->ndihedrals)
+ error->all(FLERR,"Dihedrals assigned incorrectly");
+}
+
+/* ----------------------------------------------------------------------
+ scan or read all impropers
+------------------------------------------------------------------------- */
+
+void ReadData::impropers(int firstpass)
+{
+ if (me == 0) {
+ if (firstpass) {
+ if (screen) fprintf(screen," scanning impropers ...\n");
+ if (logfile) fprintf(logfile," scanning impropers ...\n");
+ } else {
+ if (screen) fprintf(screen," reading impropers ...\n");
+ if (logfile) fprintf(logfile," reading impropers ...\n");
+ }
+ }
+
+ // allocate count if firstpass
+
+ int nlocal = atom->nlocal;
+ int *count = NULL;
+ if (firstpass) {
+ memory->create(count,nlocal,"read_data:count");
+ for (int i = 0; i < nlocal; i++) count[i] = 0;
+ }
+
+ // read and process impropers
+
+ int nchunk,eof;
+ bigint nread = 0;
+ bigint nimpropers = atom->nimpropers;
+
+ while (nread < nimpropers) {
+ nchunk = MIN(nimpropers-nread,CHUNK);
+ eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
+ if (eof) error->all(FLERR,"Unexpected end of data file");
+ atom->data_impropers(nchunk,buffer,count);
+ nread += nchunk;
+ }
+
+ // if firstpass: tally max improper/atom and return
+
+ if (firstpass) {
+ int max = 0;
+ for (int i = 0; i < nlocal; i++) max = MAX(max,count[i]);
+ int maxall;
+ MPI_Allreduce(&max,&maxall,1,MPI_INT,MPI_MAX,world);
+
+ if (me == 0) {
+ if (screen) fprintf(screen," %d = max impropers/atom\n",maxall);
+ if (logfile) fprintf(logfile," %d = max impropers/atom\n",maxall);
+ }
+ atom->improper_per_atom = maxall;
+ memory->destroy(count);
+ return;
+ }
+
+ // if 2nd pass: check that impropers were assigned correctly
+
+ bigint n = 0;
+ for (int i = 0; i < nlocal; i++) n += atom->num_improper[i];
+ bigint sum;
+ MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
+ int factor = 1;
+ if (!force->newton_bond) factor = 4;
+
+ if (me == 0) {
+ if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",sum/factor);
+ if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",sum/factor);
+ }
+
+ if (sum != factor*atom->nimpropers)
+ error->all(FLERR,"Impropers assigned incorrectly");
+}
+
/* ----------------------------------------------------------------------
read all bonus data
to find atoms, must build atom map if not a molecular system
@@ -750,7 +1127,6 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
- atom->map_style = 1;
atom->map_init();
atom->map_set();
}
@@ -781,17 +1157,17 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type)
read all body data
variable amount of info per body, described by ninteger and ndouble
to find atoms, must build atom map if not a molecular system
+ if not firstpass, just read but no processing of data
------------------------------------------------------------------------- */
-void ReadData::bodies()
+void ReadData::bodies(int firstpass)
{
int i,m,nchunk,nmax,ninteger,ndouble,tmp,onebody;
char *eof;
int mapflag = 0;
- if (atom->map_style == 0) {
+ if (atom->map_style == 0 && firstpass) {
mapflag = 1;
- atom->map_style = 1;
atom->map_init();
atom->map_set();
}
@@ -842,16 +1218,16 @@ void ReadData::bodies()
MPI_Bcast(&m,1,MPI_INT,0,world);
MPI_Bcast(buffer,m,MPI_CHAR,0,world);
- atom->data_bodies(nchunk,buffer,avec_body);
+ if (firstpass) atom->data_bodies(nchunk,buffer,avec_body);
nread += nchunk;
}
- if (mapflag) {
+ if (mapflag && firstpass) {
atom->map_delete();
atom->map_style = 0;
}
- if (me == 0) {
+ if (me == 0 && firstpass) {
if (screen) fprintf(screen," " BIGINT_FORMAT " bodies\n",natoms);
if (logfile) fprintf(logfile," " BIGINT_FORMAT " bodies\n",natoms);
}
@@ -859,149 +1235,9 @@ void ReadData::bodies()
/* ---------------------------------------------------------------------- */
-void ReadData::bonds()
-{
- int i,nchunk,eof;
-
- bigint nread = 0;
- bigint nbonds = atom->nbonds;
-
- while (nread < nbonds) {
- nchunk = MIN(nbonds-nread,CHUNK);
- eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
- if (eof) error->all(FLERR,"Unexpected end of data file");
- atom->data_bonds(nchunk,buffer);
- nread += nchunk;
- }
-
- // check that bonds were assigned correctly
-
- int nlocal = atom->nlocal;
- bigint sum;
- bigint n = 0;
- for (i = 0; i < nlocal; i++) n += atom->num_bond[i];
- MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
- int factor = 1;
- if (!force->newton_bond) factor = 2;
-
- if (me == 0) {
- if (screen) fprintf(screen," " BIGINT_FORMAT " bonds\n",sum/factor);
- if (logfile) fprintf(logfile," " BIGINT_FORMAT " bonds\n",sum/factor);
- }
- if (sum != factor*atom->nbonds)
- error->all(FLERR,"Bonds assigned incorrectly");
-}
-
-/* ---------------------------------------------------------------------- */
-
-void ReadData::angles()
-{
- int i,nchunk,eof;
-
- bigint nread = 0;
- bigint nangles = atom->nangles;
-
- while (nread < nangles) {
- nchunk = MIN(nangles-nread,CHUNK);
- eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
- if (eof) error->all(FLERR,"Unexpected end of data file");
- atom->data_angles(nchunk,buffer);
- nread += nchunk;
- }
-
- // check that ang
-
- int nlocal = atom->nlocal;
- bigint sum;
- bigint n = 0;
- for (i = 0; i < nlocal; i++) n += atom->num_angle[i];
- MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
- int factor = 1;
- if (!force->newton_bond) factor = 3;
-
- if (me == 0) {
- if (screen) fprintf(screen," " BIGINT_FORMAT " angles\n",sum/factor);
- if (logfile) fprintf(logfile," " BIGINT_FORMAT " angles\n",sum/factor);
- }
- if (sum != factor*atom->nangles)
- error->all(FLERR,"Angles assigned incorrectly");
-}
-
-/* ---------------------------------------------------------------------- */
-
-void ReadData::dihedrals()
-{
- int i,nchunk,eof;
-
- bigint nread = 0;
- bigint ndihedrals = atom->ndihedrals;
-
- while (nread < ndihedrals) {
- nchunk = MIN(ndihedrals-nread,CHUNK);
- eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
- if (eof) error->all(FLERR,"Unexpected end of data file");
- atom->data_dihedrals(nchunk,buffer);
- nread += nchunk;
- }
-
- // check that dihedrals were assigned correctly
-
- int nlocal = atom->nlocal;
- bigint sum;
- bigint n = 0;
- for (i = 0; i < nlocal; i++) n += atom->num_dihedral[i];
- MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
- int factor = 1;
- if (!force->newton_bond) factor = 4;
-
- if (me == 0) {
- if (screen) fprintf(screen," " BIGINT_FORMAT " dihedrals\n",sum/factor);
- if (logfile) fprintf(logfile," " BIGINT_FORMAT " dihedrals\n",sum/factor);
- }
- if (sum != factor*atom->ndihedrals)
- error->all(FLERR,"Dihedrals assigned incorrectly");
-}
-
-/* ---------------------------------------------------------------------- */
-
-void ReadData::impropers()
-{
- int i,nchunk,eof;
-
- bigint nread = 0;
- bigint nimpropers = atom->nimpropers;
-
- while (nread < nimpropers) {
- nchunk = MIN(nimpropers-nread,CHUNK);
- eof = comm->read_lines_from_file(fp,nchunk,MAXLINE,buffer);
- if (eof) error->all(FLERR,"Unexpected end of data file");
- atom->data_impropers(nchunk,buffer);
- nread += nchunk;
- }
-
- // check that impropers were assigned correctly
-
- int nlocal = atom->nlocal;
- bigint sum;
- bigint n = 0;
- for (i = 0; i < nlocal; i++) n += atom->num_improper[i];
- MPI_Allreduce(&n,&sum,1,MPI_LMP_BIGINT,MPI_SUM,world);
- int factor = 1;
- if (!force->newton_bond) factor = 4;
-
- if (me == 0) {
- if (screen) fprintf(screen," " BIGINT_FORMAT " impropers\n",sum/factor);
- if (logfile) fprintf(logfile," " BIGINT_FORMAT " impropers\n",sum/factor);
- }
- if (sum != factor*atom->nimpropers)
- error->all(FLERR,"Impropers assigned incorrectly");
-}
-
-/* ---------------------------------------------------------------------- */
-
void ReadData::mass()
{
- int i;
+ int i,m;
char *next;
char *buf = new char[atom->ntypes*MAXLINE];
@@ -1177,314 +1413,6 @@ void ReadData::fix(int ifix, char *keyword)
}
}
-/* ----------------------------------------------------------------------
- proc 0 scans the data file for topology maximums
-------------------------------------------------------------------------- */
-
-void ReadData::scan(int &bond_per_atom, int &angle_per_atom,
- int &dihedral_per_atom, int &improper_per_atom)
-{
- int i,tmp1,tmp2,atom1,atom2,atom3,atom4;
- char *eof;
-
- if (atom->natoms > MAXSMALLINT)
- error->one(FLERR,"Molecular data file has too many atoms");
-
- // customize for new sections
-
- int natoms = static_cast (atom->natoms);
- bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0;
- int ellipsoid_flag = 0;
- int line_flag = 0;
- int tri_flag = 0;
- int body_flag = 0;
-
- // customize for new sections
- // allocate topology counting vector
- // initially, array length = 1 to natoms
- // will grow via reallocate() if atom IDs > natoms
-
- int cmax = natoms + 1;
- int *count;
- memory->create(count,cmax,"read_data:count");
-
- while (strlen(keyword)) {
-
- // allow special fixes first chance to match and process the section
- // if fix matches, continue to next section
-
- if (nfix) {
- for (i = 0; i < nfix; i++) {
- if (strcmp(keyword,fix_section[i]) == 0) {
- int n = modify->fix[fix_index[i]]->read_data_skip_lines(keyword);
- skip_lines(n);
- parse_keyword(0,0);
- break;
- }
- }
- if (i < nfix) continue;
- }
-
- if (strcmp(keyword,"Masses") == 0) skip_lines(atom->ntypes);
- else if (strcmp(keyword,"Atoms") == 0) skip_lines(natoms);
- else if (strcmp(keyword,"Velocities") == 0) skip_lines(natoms);
-
- else if (strcmp(keyword,"Ellipsoids") == 0) {
- if (!avec_ellipsoid)
- error->one(FLERR,"Invalid data file section: Ellipsoids");
- ellipsoid_flag = 1;
- skip_lines(nellipsoids);
- } else if (strcmp(keyword,"Lines") == 0) {
- if (!avec_line) error->one(FLERR,"Invalid data file section: Lines");
- line_flag = 1;
- skip_lines(nlines);
- } else if (strcmp(keyword,"Triangles") == 0) {
- if (!avec_tri) error->one(FLERR,"Invalid data file section: Triangles");
- tri_flag = 1;
- skip_lines(ntris);
- } else if (strcmp(keyword,"Bodies") == 0) {
- if (!avec_body) error->one(FLERR,"Invalid data file section: Bodies");
- body_flag = 1;
- skip_lines(nbodies);
-
- } else if (strcmp(keyword,"Pair Coeffs") == 0) {
- if (force->pair == NULL)
- error->one(FLERR,"Must define pair_style before Pair Coeffs");
- skip_lines(atom->ntypes);
- } else if (strcmp(keyword,"PairIJ Coeffs") == 0) {
- if (force->pair == NULL)
- error->one(FLERR,"Must define pair_style before Pair Coeffs");
- skip_lines(atom->ntypes*(atom->ntypes+1)/2);
- } else if (strcmp(keyword,"Bond Coeffs") == 0) {
- if (atom->avec->bonds_allow == 0)
- error->one(FLERR,"Invalid data file section: Bond Coeffs");
- if (force->bond == NULL)
- error->one(FLERR,"Must define bond_style before Bond Coeffs");
- skip_lines(atom->nbondtypes);
- } else if (strcmp(keyword,"Angle Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->one(FLERR,"Invalid data file section: Angle Coeffs");
- if (force->angle == NULL)
- error->one(FLERR,"Must define angle_style before Angle Coeffs");
- skip_lines(atom->nangletypes);
- } else if (strcmp(keyword,"Dihedral Coeffs") == 0) {
- skip_lines(atom->ndihedraltypes);
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: Dihedral Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,"Must define dihedral_style before Dihedral Coeffs");
- } else if (strcmp(keyword,"Improper Coeffs") == 0) {
- if (atom->avec->impropers_allow == 0)
- error->one(FLERR,"Invalid data file section: Improper Coeffs");
- if (force->improper == NULL)
- error->one(FLERR,"Must define improper_style before Improper Coeffs");
- skip_lines(atom->nimpropertypes);
-
- } else if (strcmp(keyword,"BondBond Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->one(FLERR,"Invalid data file section: BondBond Coeffs");
- if (force->angle == NULL)
- error->one(FLERR,"Must define angle_style before BondBond Coeffs");
- skip_lines(atom->nangletypes);
- } else if (strcmp(keyword,"BondAngle Coeffs") == 0) {
- if (atom->avec->angles_allow == 0)
- error->one(FLERR,"Invalid data file section: BondAngle Coeffs");
- if (force->angle == NULL)
- error->one(FLERR,"Must define angle_style before BondAngle Coeffs");
- skip_lines(atom->nangletypes);
- } else if (strcmp(keyword,"MiddleBondTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: MiddleBondTorsion Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,
- "Must define dihedral_style before "
- "MiddleBondTorsion Coeffs");
- skip_lines(atom->ndihedraltypes);
- } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: EndBondTorsion Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,
- "Must define dihedral_style before EndBondTorsion Coeffs");
- skip_lines(atom->ndihedraltypes);
- } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: AngleTorsion Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,
- "Must define dihedral_style before AngleTorsion Coeffs");
- skip_lines(atom->ndihedraltypes);
- } else if (strcmp(keyword,"AngleAngleTorsion Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: AngleAngleTorsion Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,
- "Must define dihedral_style before "
- "AngleAngleTorsion Coeffs");
- skip_lines(atom->ndihedraltypes);
- } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) {
- if (atom->avec->dihedrals_allow == 0)
- error->one(FLERR,"Invalid data file section: BondBond13 Coeffs");
- if (force->dihedral == NULL)
- error->one(FLERR,"Must define dihedral_style before BondBond13 Coeffs");
- skip_lines(atom->ndihedraltypes);
- } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) {
- if (atom->avec->impropers_allow == 0)
- error->one(FLERR,"Invalid data file section: AngleAngle Coeffs");
- if (force->improper == NULL)
- error->one(FLERR,"Must define improper_style before AngleAngle Coeffs");
- skip_lines(atom->nimpropertypes);
-
- } else if (strcmp(keyword,"Bonds") == 0) {
- for (i = 1; i < cmax; i++) count[i] = 0;
- if (force->newton_bond)
- for (i = 0; i < atom->nbonds; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
- if (atom1 >= cmax) cmax = reallocate(&count,cmax,atom1);
- count[atom1]++;
- }
- else
- for (i = 0; i < atom->nbonds; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d",&tmp1,&tmp2,&atom1,&atom2);
- int amax = MAX(atom1,atom2);
- if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
- count[atom1]++;
- count[atom2]++;
- }
- for (i = 1; i < cmax; i++) bond_per_atom = MAX(bond_per_atom,count[i]);
- if (screen) fprintf(screen," %d = max bonds/atom\n",bond_per_atom);
- if (logfile) fprintf(logfile," %d = max bonds/atom\n",bond_per_atom);
-
- } else if (strcmp(keyword,"Angles") == 0) {
- for (i = 1; i < cmax; i++) count[i] = 0;
- if (force->newton_bond)
- for (i = 0; i < atom->nangles; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
- if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
- count[atom2]++;
- }
- else
- for (i = 0; i < atom->nangles; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d",&tmp1,&tmp2,&atom1,&atom2,&atom3);
- int amax = MAX(atom1,atom2);
- amax = MAX(amax,atom3);
- if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
- count[atom1]++;
- count[atom2]++;
- count[atom3]++;
- }
- for (i = 1; i < cmax; i++) angle_per_atom = MAX(angle_per_atom,count[i]);
- if (screen) fprintf(screen," %d = max angles/atom\n",angle_per_atom);
- if (logfile) fprintf(logfile," %d = max angles/atom\n",angle_per_atom);
-
- } else if (strcmp(keyword,"Dihedrals") == 0) {
- for (i = 1; i < cmax; i++) count[i] = 0;
- if (force->newton_bond)
- for (i = 0; i < atom->ndihedrals; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d %d",
- &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
- if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
- count[atom2]++;
- }
- else
- for (i = 0; i < atom->ndihedrals; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d %d",
- &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
- int amax = MAX(atom1,atom2);
- amax = MAX(amax,atom3);
- amax = MAX(amax,atom4);
- if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
- count[atom1]++;
- count[atom2]++;
- count[atom3]++;
- count[atom4]++;
- }
- for (i = 1; i < cmax; i++)
- dihedral_per_atom = MAX(dihedral_per_atom,count[i]);
- if (screen)
- fprintf(screen," %d = max dihedrals/atom\n",dihedral_per_atom);
- if (logfile)
- fprintf(logfile," %d = max dihedrals/atom\n",dihedral_per_atom);
-
- } else if (strcmp(keyword,"Impropers") == 0) {
- for (i = 1; i < cmax; i++) count[i] = 0;
- if (force->newton_bond)
- for (i = 0; i < atom->nimpropers; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d %d",
- &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
- if (atom2 >= cmax) cmax = reallocate(&count,cmax,atom2);
- count[atom2]++;
- }
- else
- for (i = 0; i < atom->nimpropers; i++) {
- eof = fgets(line,MAXLINE,fp);
- if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
- sscanf(line,"%d %d %d %d %d %d",
- &tmp1,&tmp2,&atom1,&atom2,&atom3,&atom4);
- int amax = MAX(atom1,atom2);
- amax = MAX(amax,atom3);
- amax = MAX(amax,atom4);
- if (amax >= cmax) cmax = reallocate(&count,cmax,amax);
- count[atom1]++;
- count[atom2]++;
- count[atom3]++;
- count[atom4]++;
- }
- for (i = 1; i < cmax; i++)
- improper_per_atom = MAX(improper_per_atom,count[i]);
- if (screen)
- fprintf(screen," %d = max impropers/atom\n",improper_per_atom);
- if (logfile)
- fprintf(logfile," %d = max impropers/atom\n",improper_per_atom);
-
- } else {
- char str[128];
- sprintf(str,"Unknown identifier in data file: %s",keyword);
- error->one(FLERR,str);
- }
-
- parse_keyword(0,0);
- }
-
- // free topology counting vector
-
- memory->destroy(count);
-
- // error check that topology was specified in file
-
- if ((atom->nbonds && !bond_per_atom) ||
- (atom->nangles && !angle_per_atom) ||
- (atom->ndihedrals && !dihedral_per_atom) ||
- (atom->nimpropers && !improper_per_atom))
- error->one(FLERR,"Needed topology not in data file");
-
- // customize for new sections
- // error check that Bonus sections were speficied in file
-
- if (nellipsoids && !ellipsoid_flag)
- error->one(FLERR,"Needed bonus data not in data file");
- if (nlines && !line_flag)
- error->one(FLERR,"Needed bonus data not in data file");
- if (ntris && !tri_flag)
- error->one(FLERR,"Needed bonus data not in data file");
- if (nbodies && !body_flag)
- error->one(FLERR,"Needed bonus data not in data file");
-}
-
/* ----------------------------------------------------------------------
reallocate the count vector from cmax to amax+1 and return new length
zero new locations
@@ -1540,11 +1468,9 @@ void ReadData::open(char *file)
read one additional line (assumed blank)
if any read hits EOF, set keyword to empty
if first = 1, line variable holds non-blank line that ended header
- if flag = 0, only proc 0 is calling so no bcast
- else flag = 1, bcast keyword line to all procs
------------------------------------------------------------------------- */
-void ReadData::parse_keyword(int first, int flag)
+void ReadData::parse_keyword(int first)
{
int eof = 0;
@@ -1563,7 +1489,7 @@ void ReadData::parse_keyword(int first, int flag)
// if eof, set keyword empty and return
- if (flag) MPI_Bcast(&eof,1,MPI_INT,0,world);
+ MPI_Bcast(&eof,1,MPI_INT,0,world);
if (eof) {
keyword[0] = '\0';
return;
@@ -1571,12 +1497,10 @@ void ReadData::parse_keyword(int first, int flag)
// bcast keyword line to all procs
- if (flag) {
- int n;
- if (me == 0) n = strlen(line) + 1;
- MPI_Bcast(&n,1,MPI_INT,0,world);
- MPI_Bcast(line,n,MPI_CHAR,0,world);
- }
+ int n;
+ if (me == 0) n = strlen(line) + 1;
+ MPI_Bcast(&n,1,MPI_INT,0,world);
+ MPI_Bcast(line,n,MPI_CHAR,0,world);
// handle comments following the keyword
// truncate string and increment pointer over whitespace
@@ -1606,14 +1530,14 @@ void ReadData::parse_keyword(int first, int flag)
/* ----------------------------------------------------------------------
proc 0 reads N lines from file
- NOTE: needs to be called with bigint in some cases
- if called with int, will it be promoted to bigint?
+ could be skipping Natoms lines, so use bigints
------------------------------------------------------------------------- */
-void ReadData::skip_lines(int n)
+void ReadData::skip_lines(bigint n)
{
+ if (me) return;
char *eof;
- for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
+ for (bigint i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp);
if (eof == NULL) error->one(FLERR,"Unexpected end of data file");
}
diff --git a/src/read_data.h b/src/read_data.h
index 6169532aa7..e9100105af 100644
--- a/src/read_data.h
+++ b/src/read_data.h
@@ -37,7 +37,7 @@ class ReadData : protected Pointers {
char **arg;
int me,narg,maxarg,compressed;
- int nfix; // # of extra fixes that process/store info in data file
+ int nfix; // # of extra fixes that process/store info in data file
int *fix_index;
char **fix_header;
char **fix_section;
@@ -54,20 +54,22 @@ class ReadData : protected Pointers {
void open(char *);
void scan(int &, int &, int &, int &);
int reallocate(int **, int, int);
- void header(int);
- void parse_keyword(int, int);
- void skip_lines(int);
+ void header();
+ void parse_keyword(int);
+ void skip_lines(bigint);
void parse_coeffs(char *, const char *, int);
void atoms();
void velocities();
- void bonus(bigint, class AtomVec *, const char *);
- void bodies();
- void bonds();
- void angles();
- void dihedrals();
- void impropers();
+ void bonds(int);
+ void bond_scan(int, char *, int *);
+ void angles(int);
+ void dihedrals(int);
+ void impropers(int);
+
+ void bonus(bigint, class AtomVec *, const char *);
+ void bodies(int);
void mass();
void paircoeffs();
diff --git a/src/read_dump.cpp b/src/read_dump.cpp
index 6196f876c1..3256d28a46 100644
--- a/src/read_dump.cpp
+++ b/src/read_dump.cpp
@@ -444,7 +444,6 @@ void ReadDump::atoms()
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
- atom->map_style = 1;
atom->map_init();
atom->map_set();
}
@@ -477,11 +476,9 @@ void ReadDump::atoms()
if (addflag) {
bigint nblocal = atom->nlocal;
MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world);
- if (atom->natoms < 0 || atom->natoms > MAXBIGINT)
+ if (atom->natoms < 0 || atom->natoms >= MAXBIGINT)
error->all(FLERR,"Too many total atoms");
- // change these to MAXTAGINT when allow tagint = bigint
- if (atom->natoms > MAXSMALLINT) atom->tag_enable = 0;
- if (atom->natoms <= MAXSMALLINT) atom->tag_extend();
+ if (atom->tag_enable) atom->tag_extend();
}
// if trimflag set, delete atoms not replaced by snapshot atoms
@@ -553,6 +550,10 @@ void ReadDump::atoms()
irregular->migrate_atoms();
delete irregular;
if (triclinic) domain->lamda2x(atom->nlocal);
+
+ // check that atom IDs are valid
+
+ atom->tag_check();
}
/* ----------------------------------------------------------------------
@@ -710,24 +711,27 @@ int ReadDump::fields_and_keywords(int narg, char **arg)
void ReadDump::process_atoms(int n)
{
- int i,m,ifield,itype,itag;;
+ int i,m,ifield,itype;
int xbox,ybox,zbox;
+ tagint tag;
double **x = atom->x;
double **v = atom->v;
double *q = atom->q;
imageint *image = atom->image;
int nlocal = atom->nlocal;
- int map_tag_max = atom->map_tag_max;
+ tagint map_tag_max = atom->map_tag_max;
for (i = 0; i < n; i++) {
ucflag[i] = 0;
// check if new atom matches one I own
// setting m = -1 forces new atom not to match
+ // NOTE: atom ID in fields is stored as double, not as ubuf
+ // so can only cast it to tagint, thus cannot be full 64-bit ID
- itag = static_cast (fields[i][0]);
- if (itag <= map_tag_max) m = atom->map(static_cast (fields[i][0]));
+ tag = static_cast (fields[i][0]);
+ if (tag <= map_tag_max) m = atom->map(tag);
else m = -1;
if (m < 0 || m >= nlocal) continue;
diff --git a/src/read_restart.cpp b/src/read_restart.cpp
index 937b10548b..31549b69dc 100644
--- a/src/read_restart.cpp
+++ b/src/read_restart.cpp
@@ -503,20 +503,19 @@ void ReadRestart::command(int narg, char **arg)
}
}
- // check if tags are being used
- // create global mapping and bond topology now that system is defined
+ // check that atom IDs are valid
- flag = 0;
- for (int i = 0; i < atom->nlocal; i++)
- if (atom->tag[i] > 0) flag = 1;
- int flag_all;
- MPI_Allreduce(&flag,&flag_all,1,MPI_INT,MPI_MAX,world);
- if (flag_all == 0) atom->tag_enable = 0;
+ atom->tag_check();
- if (atom->map_style) {
+ // if molecular system or user-requested, create global mapping of atoms
+
+ if (atom->molecular || atom->map_user) {
atom->map_init();
atom->map_set();
}
+
+ // create special bond lists for molecular systems
+
if (atom->molecular) {
Special special(lmp);
special.build();
diff --git a/src/replicate.cpp b/src/replicate.cpp
index d0b3b71ab2..9b4e9bcf48 100644
--- a/src/replicate.cpp
+++ b/src/replicate.cpp
@@ -73,11 +73,13 @@ void Replicate::command(int narg, char **arg)
// maxtag = largest atom tag across all existing atoms
- int maxtag = 0;
- for (i = 0; i < atom->nlocal; i++) maxtag = MAX(atom->tag[i],maxtag);
- int maxtag_all;
- MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_INT,MPI_MAX,world);
- maxtag = maxtag_all;
+ tagint maxtag = 0;
+ if (atom->tag_enable) {
+ for (i = 0; i < atom->nlocal; i++) maxtag = MAX(atom->tag[i],maxtag);
+ tagint maxtag_all;
+ MPI_Allreduce(&maxtag,&maxtag_all,1,MPI_LMP_TAGINT,MPI_MAX,world);
+ maxtag = maxtag_all;
+ }
// maxmol = largest molecule tag across all existing atoms
@@ -124,25 +126,20 @@ void Replicate::command(int narg, char **arg)
atom->create_avec(old->atom_style,nstyles,keywords);
// check that new system will not be too large
- // if molecular and N > MAXTAGINT, error
- // if atomic and new N > MAXTAGINT, turn off tags for existing and new atoms
- // new system cannot exceed MAXBIGINT
- // NOTE: change these 2 to MAXTAGINT when allow tagint = bigint
+ // new tags cannot exceed MAXTAGINT
+ // new system sizes cannot exceed MAXBIGINT
- if (atom->molecular &&
- (nrep*old->natoms < 0 || nrep*old->natoms > MAXSMALLINT))
- error->all(FLERR,"Replicated molecular system atom IDs are too big");
- if (nrep*old->natoms < 0 || nrep*old->natoms > MAXSMALLINT)
- atom->tag_enable = 0;
- if (atom->tag_enable == 0)
- for (int i = 0; i < atom->nlocal; i++)
- atom->tag[i] = 0;
+ if (atom->tag_enable) {
+ bigint maxnewtag = maxtag + (nrep-1)*old->natoms;
+ if (maxnewtag < 0 || maxnewtag >= MAXTAGINT)
+ error->all(FLERR,"Replicated system atom IDs are too big");
+ }
- if (nrep*old->natoms < 0 || nrep*old->natoms > MAXBIGINT ||
- nrep*old->nbonds < 0 || nrep*old->nbonds > MAXBIGINT ||
- nrep*old->nangles < 0 || nrep*old->nangles > MAXBIGINT ||
- nrep*old->ndihedrals < 0 || nrep*old->ndihedrals > MAXBIGINT ||
- nrep*old->nimpropers < 0 || nrep*old->nimpropers > MAXBIGINT)
+ if (nrep*old->natoms < 0 || nrep*old->natoms >= MAXBIGINT ||
+ nrep*old->nbonds < 0 || nrep*old->nbonds >= MAXBIGINT ||
+ nrep*old->nangles < 0 || nrep*old->nangles >= MAXBIGINT ||
+ nrep*old->ndihedrals < 0 || nrep*old->ndihedrals >= MAXBIGINT ||
+ nrep*old->nimpropers < 0 || nrep*old->nimpropers >= MAXBIGINT)
error->all(FLERR,"Replicated system is too big");
// assign atom and topology counts in new class from old one
@@ -257,7 +254,8 @@ void Replicate::command(int narg, char **arg)
AtomVec *old_avec = old->avec;
AtomVec *avec = atom->avec;
- int ix,iy,iz,atom_offset,mol_offset;
+ int ix,iy,iz,mol_offset;
+ tagint atom_offset;
imageint image;
double x[3],lamda[3];
double *coord;
@@ -393,13 +391,19 @@ void Replicate::command(int narg, char **arg)
}
}
- // create global mapping and bond topology now that system is defined
+ // check that atom IDs are valid
- if (atom->map_style) {
- atom->nghost = 0;
+ atom->tag_check();
+
+ // if molecular system or user-requested, create global mapping of atoms
+
+ if (atom->molecular || atom->map_user) {
atom->map_init();
atom->map_set();
}
+
+ // create special bond lists for molecular systems
+
if (atom->molecular) {
Special special(lmp);
special.build();
diff --git a/src/set.cpp b/src/set.cpp
index 046dc67f48..562b8f94ce 100644
--- a/src/set.cpp
+++ b/src/set.cpp
@@ -440,11 +440,12 @@ void Set::selection(int n)
if (style == ATOM_SELECT) {
if (atom->tag_enable == 0)
error->all(FLERR,"Cannot use set atom with no atom IDs defined");
- force->bounds(id,BIG,nlo,nhi);
+ bigint nlobig,nhibig;
+ force->boundsbig(id,MAXTAGINT,nlobig,nhibig);
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
for (int i = 0; i < n; i++)
- if (tag[i] >= nlo && tag[i] <= nhi) select[i] = 1;
+ if (tag[i] >= nlobig && tag[i] <= nhibig) select[i] = 1;
else select[i] = 0;
} else if (style == MOL_SELECT) {
@@ -711,7 +712,7 @@ void Set::set(int keyword)
/* ----------------------------------------------------------------------
set an owned atom property randomly
- set seed based on atom tag
+ set seed based on atom coordinates
make atom result independent of what proc owns it
------------------------------------------------------------------------- */
diff --git a/src/special.cpp b/src/special.cpp
index 170115521f..d081a82abe 100644
--- a/src/special.cpp
+++ b/src/special.cpp
@@ -56,15 +56,15 @@ void Special::build()
{
int i,j,k,size;
int max,maxall,nbuf;
- int *buf;
+ tagint *buf;
MPI_Barrier(world);
int nlocal = atom->nlocal;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_bond = atom->num_bond;
- int **bond_atom = atom->bond_atom;
+ tagint **bond_atom = atom->bond_atom;
int **nspecial = atom->nspecial;
if (me == 0 && screen) fprintf(screen,"Finding 1-2 1-3 1-4 neighbors ...\n");
@@ -109,7 +109,7 @@ void Special::build()
// when find one, increment nspecial count for that atom
sptr = this;
- comm->ring(size,sizeof(int),buf,1,ring_one,NULL);
+ comm->ring(size,sizeof(tagint),buf,1,ring_one,NULL);
memory->destroy(buf);
}
@@ -167,7 +167,7 @@ void Special::build()
// when find one, add 1st-atom tag to onetwo list for 2nd atom
sptr = this;
- comm->ring(size,sizeof(int),buf,2,ring_two,NULL);
+ comm->ring(size,sizeof(tagint),buf,2,ring_two,NULL);
memory->destroy(buf);
}
@@ -214,7 +214,7 @@ void Special::build()
// subtracting one since my list will contain original atom
sptr = this;
- comm->ring(size,sizeof(int),buf,3,ring_three,buf);
+ comm->ring(size,sizeof(tagint),buf,3,ring_three,buf);
// extract count from buffer that has cycled back to me
// nspecial[i][1] = # of 1-3 neighbors of atom i
@@ -275,7 +275,7 @@ void Special::build()
// this process may include duplicates but they will be culled later
sptr = this;
- comm->ring(size,sizeof(int),buf,4,ring_four,buf);
+ comm->ring(size,sizeof(tagint),buf,4,ring_four,buf);
// fill onethree with buffer values that have been returned to me
// sanity check: accumulated buf[i+3] count should equal
@@ -330,7 +330,7 @@ void Special::build()
// may include duplicates and original atom but they will be culled later
sptr = this;
- comm->ring(size,sizeof(int),buf,5,ring_five,buf);
+ comm->ring(size,sizeof(tagint),buf,5,ring_five,buf);
// extract count from buffer that has cycled back to me
// nspecial[i][2] = # of 1-4 neighbors of atom i
@@ -389,7 +389,7 @@ void Special::build()
// this process may include duplicates but they will be culled later
sptr = this;
- comm->ring(size,sizeof(int),buf,6,ring_six,buf);
+ comm->ring(size,sizeof(tagint),buf,6,ring_six,buf);
// fill onefour with buffer values that have been returned to me
// sanity check: accumulated buf[i+2] count should equal
@@ -418,7 +418,8 @@ void Special::build()
void Special::dedup()
{
- int i,j,m;
+ int i,j;
+ tagint m;
// clear map so it can be used as scratch space
@@ -430,7 +431,7 @@ void Special::dedup()
// must unset map for each atom
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
int unique;
@@ -494,13 +495,14 @@ void Special::dedup()
void Special::combine()
{
- int i,j,m;
+ int i,j;
+ tagint m;
int me;
MPI_Comm_rank(world,&me);
int **nspecial = atom->nspecial;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int nlocal = atom->nlocal;
// ----------------------------------------------------
@@ -574,7 +576,7 @@ void Special::combine()
memory->create(atom->special,atom->nmax,atom->maxspecial,"atom:special");
atom->avec->grow_reset();
- int **special = atom->special;
+ tagint **special = atom->special;
// ----------------------------------------------------
// fill special array with 1-2, 1-3, 1-4 neighs for each atom
@@ -638,12 +640,12 @@ void Special::angle_trim()
int *num_angle = atom->num_angle;
int *num_dihedral = atom->num_dihedral;
- int **angle_atom1 = atom->angle_atom1;
- int **angle_atom3 = atom->angle_atom3;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom2 = atom->dihedral_atom2;
- int **dihedral_atom3 = atom->dihedral_atom3;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **angle_atom1 = atom->angle_atom1;
+ tagint **angle_atom3 = atom->angle_atom3;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom3 = atom->dihedral_atom3;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
@@ -716,7 +718,7 @@ void Special::angle_trim()
// when find one, scan its 1-3 neigh list and mark I,J as in an angle
sptr = this;
- comm->ring(size,sizeof(int),buf,7,ring_seven,NULL);
+ comm->ring(size,sizeof(tagint),buf,7,ring_seven,NULL);
// delete 1-3 neighbors if they are not flagged in dflag
@@ -764,8 +766,8 @@ void Special::dihedral_trim()
int i,j,m,n;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom1 = atom->dihedral_atom1;
- int **dihedral_atom4 = atom->dihedral_atom4;
+ tagint **dihedral_atom1 = atom->dihedral_atom1;
+ tagint **dihedral_atom4 = atom->dihedral_atom4;
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
@@ -822,7 +824,7 @@ void Special::dihedral_trim()
// when find one, scan its 1-4 neigh list and mark I,J as in a dihedral
sptr = this;
- comm->ring(size,sizeof(int),buf,8,ring_eight,NULL);
+ comm->ring(size,sizeof(tagint),buf,8,ring_eight,NULL);
// delete 1-4 neighbors if they are not flagged in dflag
@@ -871,7 +873,7 @@ void Special::ring_one(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int m;
for (int i = 0; i < ndatum; i++) {
@@ -890,10 +892,10 @@ void Special::ring_two(int ndatum, char *cbuf)
Atom *atom = sptr->atom;
int nlocal = atom->nlocal;
- int **onetwo = sptr->onetwo;
+ tagint **onetwo = sptr->onetwo;
int *count = sptr->count;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int m;
for (int i = 1; i < ndatum; i += 2) {
@@ -914,7 +916,7 @@ void Special::ring_three(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int i,j,m,n,num12;
i = 0;
@@ -945,10 +947,11 @@ void Special::ring_four(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int **onetwo = sptr->onetwo;
+ tagint **onetwo = sptr->onetwo;
- int *buf = (int *) cbuf;
- int i,j,k,m,n,original,num12,num13;
+ tagint *buf = (tagint *) cbuf;
+ tagint original;
+ int i,j,k,m,n,num12,num13;
i = 0;
while (i < ndatum) {
@@ -980,7 +983,7 @@ void Special::ring_five(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int i,j,m,n,num13;
i = 0;
@@ -1009,9 +1012,9 @@ void Special::ring_six(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int **onetwo = sptr->onetwo;
+ tagint **onetwo = sptr->onetwo;
- int *buf = (int *) cbuf;
+ tagint *buf = (tagint *) cbuf;
int i,j,k,m,n,num13,num14;
i = 0;
@@ -1041,11 +1044,12 @@ void Special::ring_seven(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int **onethree = sptr->onethree;
+ tagint **onethree = sptr->onethree;
int **dflag = sptr->dflag;
- int *buf = (int *) cbuf;
- int i,m,iglobal,jglobal,ilocal,jlocal;
+ tagint *buf = (tagint *) cbuf;
+ tagint iglobal,jglobal;
+ int i,m,ilocal,jlocal;
i = 0;
while (i < ndatum) {
@@ -1080,11 +1084,12 @@ void Special::ring_eight(int ndatum, char *cbuf)
int **nspecial = atom->nspecial;
int nlocal = atom->nlocal;
- int **onefour = sptr->onefour;
+ tagint **onefour = sptr->onefour;
int **dflag = sptr->dflag;
- int *buf = (int *) cbuf;
- int i,m,iglobal,jglobal,ilocal,jlocal;
+ tagint *buf = (tagint *) cbuf;
+ tagint iglobal,jglobal;
+ int i,m,ilocal,jlocal;
i = 0;
while (i < ndatum) {
diff --git a/src/special.h b/src/special.h
index b44de6b6eb..987ca490ea 100644
--- a/src/special.h
+++ b/src/special.h
@@ -26,7 +26,7 @@ class Special : protected Pointers {
private:
int me,nprocs;
- int **onetwo,**onethree,**onefour;
+ tagint **onetwo,**onethree,**onefour;
// data used by ring callback methods
diff --git a/src/variable.cpp b/src/variable.cpp
index 3ccf70560b..6ace068ba2 100644
--- a/src/variable.cpp
+++ b/src/variable.cpp
@@ -60,7 +60,7 @@ enum{DONE,ADD,SUBTRACT,MULTIPLY,DIVIDE,CARAT,MODULO,UNARY,
SQRT,EXP,LN,LOG,ABS,SIN,COS,TAN,ASIN,ACOS,ATAN,ATAN2,
RANDOM,NORMAL,CEIL,FLOOR,ROUND,RAMP,STAGGER,LOGFREQ,STRIDE,
VDISPLACE,SWIGGLE,CWIGGLE,GMASK,RMASK,GRMASK,
- VALUE,ATOMARRAY,TYPEARRAY,INTARRAY};
+ VALUE,ATOMARRAY,TYPEARRAY,INTARRAY,BIGINTARRAY};
// customize by adding a special function
@@ -1685,7 +1685,8 @@ double Variable::evaluate(char *str, Tree **tree)
/* ----------------------------------------------------------------------
one-time collapse of an atom-style variable parse tree
tree was created by one-time parsing of formula string via evaulate()
- only keep tree nodes that depend on ATOMARRAY, TYPEARRAY, INTARRAY
+ only keep tree nodes that depend on
+ ATOMARRAY, TYPEARRAY, INTARRAY, BIGINTARRAY
remainder is converted to single VALUE
this enables optimal eval_tree loop over atoms
customize by adding a function:
@@ -1704,6 +1705,7 @@ double Variable::collapse_tree(Tree *tree)
if (tree->type == ATOMARRAY) return 0.0;
if (tree->type == TYPEARRAY) return 0.0;
if (tree->type == INTARRAY) return 0.0;
+ if (tree->type == BIGINTARRAY) return 0.0;
if (tree->type == ADD) {
arg1 = collapse_tree(tree->left);
@@ -2149,6 +2151,7 @@ double Variable::eval_tree(Tree *tree, int i)
if (tree->type == ATOMARRAY) return tree->array[i*tree->nstride];
if (tree->type == TYPEARRAY) return tree->array[atom->type[i]];
if (tree->type == INTARRAY) return (double) tree->iarray[i*tree->nstride];
+ if (tree->type == BIGINTARRAY) return (double) tree->barray[i*tree->nstride];
if (tree->type == ADD)
return eval_tree(tree->left,i) + eval_tree(tree->right,i);
@@ -3523,9 +3526,14 @@ void Variable::atom_vector(char *word, Tree **tree,
treestack[ntreestack++] = newtree;
if (strcmp(word,"id") == 0) {
- newtree->type = INTARRAY;
+ if (sizeof(tagint) == sizeof(smallint)) {
+ newtree->type = INTARRAY;
+ newtree->iarray = (int *) atom->tag;
+ } else {
+ newtree->type = BIGINTARRAY;
+ newtree->barray = (bigint *) atom->tag;
+ }
newtree->nstride = 1;
- newtree->iarray = atom->tag;
} else if (strcmp(word,"mass") == 0) {
if (atom->rmass) {
newtree->nstride = 1;
@@ -4011,7 +4019,8 @@ int VarReader::read_scalar(char *str)
int VarReader::read_peratom()
{
- int i,m,n,tagdata,nchunk,eof;
+ int i,m,n,nchunk,eof;
+ tagint tag;
char *ptr,*next;
double value;
@@ -4044,7 +4053,7 @@ int VarReader::read_peratom()
MPI_Bcast(str,n,MPI_CHAR,0,world);
bigint nlines = ATOBIGINT(str);
- int map_tag_max = atom->map_tag_max;
+ tagint map_tag_max = atom->map_tag_max;
bigint nread = 0;
while (nread < nlines) {
@@ -4056,10 +4065,10 @@ int VarReader::read_peratom()
for (i = 0; i < nchunk; i++) {
next = strchr(buf,'\n');
*next = '\0';
- sscanf(buf,"%d %lg",&tagdata,&value);
- if (tagdata <= 0 || tagdata > map_tag_max)
+ sscanf(buf,TAGINT_FORMAT " %lg",&tag,&value);
+ if (tag <= 0 || tag > map_tag_max)
error->one(FLERR,"Invalid atom ID in variable file");
- if ((m = atom->map(tagdata)) >= 0) vstore[m] = value;
+ if ((m = atom->map(tag)) >= 0) vstore[m] = value;
buf = next + 1;
}
diff --git a/src/variable.h b/src/variable.h
index 6b13bbdc96..83bac48282 100644
--- a/src/variable.h
+++ b/src/variable.h
@@ -63,6 +63,7 @@ class Variable : protected Pointers {
double value; // single scalar
double *array; // per-atom or per-type list of doubles
int *iarray; // per-atom list of ints
+ bigint *barray; // per-atom list of bigints
int type; // operation, see enum{} in variable.cpp
int nstride; // stride between atoms if array is a 2d array
int selfalloc; // 1 if array is allocated here, else 0
diff --git a/src/velocity.cpp b/src/velocity.cpp
index 1d44bcaf58..f27aa57058 100644
--- a/src/velocity.cpp
+++ b/src/velocity.cpp
@@ -205,7 +205,6 @@ void Velocity::create(double t_desired, int seed)
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
- atom->map_style = 1;
atom->nghost = 0;
atom->map_init();
atom->map_set();
diff --git a/src/version.h b/src/version.h
index 41e89ad5f9..adf240332d 100644
--- a/src/version.h
+++ b/src/version.h
@@ -1 +1 @@
-#define LAMMPS_VERSION "13 Jan 2014"
+#define LAMMPS_VERSION "17 Jan 2014"
diff --git a/src/write_data.cpp b/src/write_data.cpp
index 994a78c536..a07c280e4a 100644
--- a/src/write_data.cpp
+++ b/src/write_data.cpp
@@ -415,7 +415,7 @@ void WriteData::bonds()
int maxrow;
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
- int **buf;
+ tagint **buf;
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
@@ -436,10 +436,10 @@ void WriteData::bonds()
fprintf(fp,"\nBonds\n\n");
for (int iproc = 0; iproc < nprocs; iproc++) {
if (iproc) {
- MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_INT,iproc,0,world,&request);
+ MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_LMP_TAGINT,iproc,0,world,&request);
MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
MPI_Wait(&request,&status);
- MPI_Get_count(&status,MPI_INT,&recvrow);
+ MPI_Get_count(&status,MPI_LMP_TAGINT,&recvrow);
recvrow /= ncol;
} else recvrow = sendrow;
@@ -449,7 +449,7 @@ void WriteData::bonds()
} else {
MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
- MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_INT,0,0,world);
+ MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_LMP_TAGINT,0,0,world);
}
memory->destroy(buf);
@@ -468,7 +468,7 @@ void WriteData::angles()
int maxrow;
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
- int **buf;
+ tagint **buf;
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
@@ -489,10 +489,10 @@ void WriteData::angles()
fprintf(fp,"\nAngles\n\n");
for (int iproc = 0; iproc < nprocs; iproc++) {
if (iproc) {
- MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_INT,iproc,0,world,&request);
+ MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_LMP_TAGINT,iproc,0,world,&request);
MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
MPI_Wait(&request,&status);
- MPI_Get_count(&status,MPI_INT,&recvrow);
+ MPI_Get_count(&status,MPI_LMP_TAGINT,&recvrow);
recvrow /= ncol;
} else recvrow = sendrow;
@@ -502,7 +502,7 @@ void WriteData::angles()
} else {
MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
- MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_INT,0,0,world);
+ MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_LMP_TAGINT,0,0,world);
}
memory->destroy(buf);
@@ -519,9 +519,9 @@ void WriteData::dihedrals()
int ncol = 5;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_dihedral = atom->num_dihedral;
- int **dihedral_atom2 = atom->dihedral_atom2;
+ tagint **dihedral_atom2 = atom->dihedral_atom2;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -539,7 +539,7 @@ void WriteData::dihedrals()
int maxrow;
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
- int **buf;
+ tagint **buf;
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
@@ -560,10 +560,10 @@ void WriteData::dihedrals()
fprintf(fp,"\nDihedrals\n\n");
for (int iproc = 0; iproc < nprocs; iproc++) {
if (iproc) {
- MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_INT,iproc,0,world,&request);
+ MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_LMP_TAGINT,iproc,0,world,&request);
MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
MPI_Wait(&request,&status);
- MPI_Get_count(&status,MPI_INT,&recvrow);
+ MPI_Get_count(&status,MPI_LMP_TAGINT,&recvrow);
recvrow /= ncol;
} else recvrow = sendrow;
@@ -573,7 +573,7 @@ void WriteData::dihedrals()
} else {
MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
- MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_INT,0,0,world);
+ MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_LMP_TAGINT,0,0,world);
}
memory->destroy(buf);
@@ -590,9 +590,9 @@ void WriteData::impropers()
int ncol = 5;
- int *tag = atom->tag;
+ tagint *tag = atom->tag;
int *num_improper = atom->num_improper;
- int **improper_atom2 = atom->improper_atom2;
+ tagint **improper_atom2 = atom->improper_atom2;
int nlocal = atom->nlocal;
int newton_bond = force->newton_bond;
@@ -610,7 +610,7 @@ void WriteData::impropers()
int maxrow;
MPI_Allreduce(&sendrow,&maxrow,1,MPI_INT,MPI_MAX,world);
- int **buf;
+ tagint **buf;
if (me == 0) memory->create(buf,MAX(1,maxrow),ncol,"write_data:buf");
else memory->create(buf,MAX(1,sendrow),ncol,"write_data:buf");
@@ -631,10 +631,10 @@ void WriteData::impropers()
fprintf(fp,"\nImpropers\n\n");
for (int iproc = 0; iproc < nprocs; iproc++) {
if (iproc) {
- MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_INT,iproc,0,world,&request);
+ MPI_Irecv(&buf[0][0],maxrow*ncol,MPI_LMP_TAGINT,iproc,0,world,&request);
MPI_Send(&tmp,0,MPI_INT,iproc,0,world);
MPI_Wait(&request,&status);
- MPI_Get_count(&status,MPI_INT,&recvrow);
+ MPI_Get_count(&status,MPI_LMP_TAGINT,&recvrow);
recvrow /= ncol;
} else recvrow = sendrow;
@@ -644,7 +644,7 @@ void WriteData::impropers()
} else {
MPI_Recv(&tmp,0,MPI_INT,0,0,world,&status);
- MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_INT,0,0,world);
+ MPI_Rsend(&buf[0][0],sendrow*ncol,MPI_LMP_TAGINT,0,0,world);
}
memory->destroy(buf);