implement "mem" command into LAMMPS shell to print current and max memory use
This commit is contained in:
@ -463,6 +463,7 @@ static void init_commands()
|
||||
commands.push_back("exit");
|
||||
commands.push_back("pwd");
|
||||
commands.push_back("cd");
|
||||
commands.push_back("mem");
|
||||
commands.push_back("history");
|
||||
commands.push_back("clear_history");
|
||||
|
||||
@ -562,6 +563,13 @@ static int shell_cmd(const std::string &cmd)
|
||||
lammps_command(lmp, shellcmd.c_str());
|
||||
free(text);
|
||||
return 0;
|
||||
} else if (words[0] == "mem") {
|
||||
double meminfo[3];
|
||||
lammps_memory_usage(lmp,meminfo);
|
||||
std::cout << "Memory usage. Current: " << meminfo[0] << " MByte, "
|
||||
<< "Maximum : " << meminfo[2] << " MByte\n";
|
||||
free(text);
|
||||
return 0;
|
||||
} else if (words[0] == "history") {
|
||||
free(text);
|
||||
HIST_ENTRY **list = history_list();
|
||||
|
||||
Reference in New Issue
Block a user