diff --git a/src/error.cpp b/src/error.cpp index a524ea8c64..448858b02d 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -135,6 +135,7 @@ void Error::message(const char *file, int line, const char *str, int logflag) } /* ---------------------------------------------------------------------- + shutdown LAMMPS called by all procs in one world close all output, screen, and log files in world no abort, so insure all procs in world call, else will hang diff --git a/src/input.cpp b/src/input.cpp index b409f916d4..865975c68c 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -420,6 +420,7 @@ int Input::execute_command() else if (!strcmp(command,"next")) next_command(); else if (!strcmp(command,"partition")) partition(); else if (!strcmp(command,"print")) print(); + else if (!strcmp(command,"quit")) quit(); else if (!strcmp(command,"shell")) shell(); else if (!strcmp(command,"variable")) variable_command(); @@ -792,6 +793,14 @@ void Input::print() /* ---------------------------------------------------------------------- */ +void Input::quit() +{ + if (narg) error->all(FLERR,"Illegal quit command"); + error->done(); +} + +/* ---------------------------------------------------------------------- */ + void Input::shell() { if (narg < 1) error->all(FLERR,"Illegal shell command"); diff --git a/src/input.h b/src/input.h index 3fe588989d..5ecca5a9c4 100644 --- a/src/input.h +++ b/src/input.h @@ -59,6 +59,7 @@ class Input : protected Pointers { void next_command(); void partition(); void print(); + void quit(); void shell(); void variable_command(); diff --git a/src/lammps.cpp b/src/lammps.cpp index 537ab1748e..3b188392c3 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -404,7 +404,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) create(); post_create(); - // if helpflag set, print help and exit + // if helpflag set, print help and quit if (helpflag) { if (universe->me == 0) print_styles();