better error message when trying to unload an unsupported plugin style

This commit is contained in:
Axel Kohlmeyer
2021-03-13 12:17:45 -05:00
parent 76cff1ed1e
commit dd94bac0c8

View File

@ -167,6 +167,16 @@ namespace LAMMPS_NS
{
int me = lmp->comm->me;
// ignore unload request from unsupported style categories
if ((strcmp(style,"pair") != 0)
&& (strcmp(style,"fix") != 0)
&& (strcmp(style,"command") != 0)) {
if (me == 0)
utils::logmesg(lmp,fmt::format("Ignoring unload: {} is not a "
"supported plugin style\n",style));
return;
}
// ignore unload request if not loaded from a plugin
int idx = plugin_find(style,name);
if (idx < 0) {