1 /* -*- c++ -*- ----------------------------------------------------------
2    LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
3    https://www.lammps.org/, Sandia National Laboratories
4    Steve Plimpton, sjplimp@sandia.gov
5 
6    Copyright (2003) Sandia Corporation.  Under the terms of Contract
7    DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
8    certain rights in this software.  This software is distributed under
9    the GNU General Public License.
10 
11    See the README file in the top-level LAMMPS directory.
12 ------------------------------------------------------------------------- */
13 
14 #ifdef COMMAND_CLASS
15 // clang-format off
16 CommandStyle(read_restart,ReadRestart);
17 // clang-format on
18 #else
19 
20 #ifndef LMP_READ_RESTART_H
21 #define LMP_READ_RESTART_H
22 
23 #include "command.h"
24 
25 namespace LAMMPS_NS {
26 
27 class ReadRestart : public Command {
28  public:
29   ReadRestart(class LAMMPS *);
30   void command(int, char **);
31 
32  private:
33   int me, nprocs;
34   FILE *fp;
35 
36   int multiproc;         // 0 = restart file is a single file
37                          // 1 = restart file is parallel (multiple files)
38   int multiproc_file;    // # of parallel files in restart
39   int nprocs_file;       // total # of procs that wrote restart file
40   int revision;          // revision number of the restart file format
41 
42   // MPI-IO values
43 
44   int mpiioflag;                // 1 for MPIIO output, else 0
45   class RestartMPIIO *mpiio;    // MPIIO for restart file input
46   bigint assignedChunkSize;
47   MPI_Offset assignedChunkOffset, headerOffset;
48 
49   std::string file_search(const std::string &);
50   void header();
51   void type_arrays();
52   void force_fields();
53 
54   void magic_string();
55   void endian();
56   void format_revision();
57   void check_eof_magic();
58   void file_layout();
59 
60   int read_int();
61   bigint read_bigint();
62   double read_double();
63   char *read_string();
64   void read_int_vec(int, int *);
65   void read_double_vec(int, double *);
66 };
67 
68 }    // namespace LAMMPS_NS
69 
70 #endif
71 #endif
72 
73 /* ERROR/WARNING messages:
74 
75 E: Illegal ... command
76 
77 Self-explanatory.  Check the input script syntax and compare to the
78 documentation for the command.  You can use -echo screen as a
79 command-line option when running LAMMPS to see the offending line.
80 
81 E: Cannot read_restart after simulation box is defined
82 
83 The read_restart command cannot be used after a read_data,
84 read_restart, or create_box command.
85 
86 E: Read restart MPI-IO input not allowed with % in filename
87 
88 This is because a % signifies one file per processor and MPI-IO
89 creates one large file for all processors.
90 
91 E: Reading from MPI-IO filename when MPIIO package is not installed
92 
93 Self-explanatory.
94 
95 E: Cannot open restart file %s
96 
97 Self-explanatory.
98 
99 E: Invalid flag in peratom section of restart file
100 
101 The format of this section of the file is not correct.
102 
103 E: Did not assign all restart atoms correctly
104 
105 Atoms read in from the restart file were not assigned correctly to
106 processors.  This is likely due to some atom coordinates being outside
107 a non-periodic simulation box.  Normally this should not happen.  You
108 may wish to use the "remap" option on the read_restart command to see
109 if this helps.
110 
111 E: Cannot open dir to search for restart file
112 
113 Using a "*" in the name of the restart file will open the current
114 directory to search for matching file names.
115 
116 E: Found no restart file matching pattern
117 
118 When using a "*" in the restart file name, no matching file was found.
119 
120 E: Restart file incompatible with current version
121 
122 This is probably because you are trying to read a file created with a
123 version of LAMMPS that is too old compared to the current version.
124 Use your older version of LAMMPS and convert the restart file
125 to a data file.
126 
127 E: Smallint setting in lmptype.h is not compatible
128 
129 Smallint stored in restart file is not consistent with LAMMPS version
130 you are running.
131 
132 E: Imageint setting in lmptype.h is not compatible
133 
134 Format of imageint stored in restart file is not consistent with
135 LAMMPS version you are running.  See the settings in src/lmptype.h
136 
137 E: Tagint setting in lmptype.h is not compatible
138 
139 Format of tagint stored in restart file is not consistent with LAMMPS
140 version you are running.  See the settings in src/lmptype.h
141 
142 E: Bigint setting in lmptype.h is not compatible
143 
144 Format of bigint stored in restart file is not consistent with LAMMPS
145 version you are running.  See the settings in src/lmptype.h
146 
147 E: Cannot run 2d simulation with non-periodic Z dimension
148 
149 Use the boundary command to make the z dimension periodic in order to
150 run a 2d simulation.
151 
152 W: Restart file used different # of processors
153 
154 The restart file was written out by a LAMMPS simulation running on a
155 different number of processors.  Due to round-off, the trajectories of
156 your restarted simulation may diverge a little more quickly than if
157 you ran on the same # of processors.
158 
159 W: Restart file used different 3d processor grid
160 
161 The restart file was written out by a LAMMPS simulation running on a
162 different 3d grid of processors.  Due to round-off, the trajectories
163 of your restarted simulation may diverge a little more quickly than if
164 you ran on the same # of processors.
165 
166 W: Restart file used different newton pair setting, using input script value
167 
168 The input script value will override the setting in the restart file.
169 
170 W: Restart file used different newton bond setting, using restart file value
171 
172 The restart file value will override the setting in the input script.
173 
174 W: Restart file used different boundary settings, using restart file values
175 
176 Your input script cannot change these restart file settings.
177 
178 E: Illegal or unset periodicity in restart
179 
180 This error should not normally occur unless the restart file is invalid.
181 
182 E: Invalid flag in header section of restart file
183 
184 Unrecognized entry in restart file.
185 
186 E: Invalid flag in type arrays section of restart file
187 
188 Unrecognized entry in restart file.
189 
190 E: Invalid flag in force field section of restart file
191 
192 Unrecognized entry in restart file.
193 
194 E: Restart file is not a multi-proc file
195 
196 The file is inconsistent with the filename you specified for it.
197 
198 E: Restart file is a multi-proc file
199 
200 The file is inconsistent with the filename you specified for it.
201 
202 E: Restart file is a MPI-IO file
203 
204 The file is inconsistent with the filename you specified for it.
205 
206 E: Restart file is not a MPI-IO file
207 
208 The file is inconsistent with the filename you specified for it.
209 
210 E: Invalid LAMMPS restart file
211 
212 The file does not appear to be a LAMMPS restart file since
213 it doesn't contain the correct magic string at the beginning.
214 
215 E: Restart file byte ordering is swapped
216 
217 The file was written on a machine with different byte-ordering than
218 the machine you are reading it on.  Convert it to a text data file
219 instead, on the machine you wrote it on.
220 
221 E: Restart file byte ordering is not recognized
222 
223 The file does not appear to be a LAMMPS restart file since it doesn't
224 contain a recognized byte-orderomg flag at the beginning.
225 
226 E: Illegal size string or corrupt restart
227 
228 This error should not normally occur unless the restart file is invalid.
229 
230 E: Illegal size integer vector read requested
231 
232 This error should not normally occur unless the restart file is invalid.
233 
234 E: Illegal size double vector read requested
235 
236 This error should not normally occur unless the restart file is invalid.
237 
238 */
239