From 48e9f451f44131b759c859d458773ef0a637f293 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 19 Apr 2021 01:23:54 -0400 Subject: [PATCH] disallow using the same GPU pair style multiple times as hybrid sub-style --- src/pair_hybrid.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 48ba1ccff7..b67f98a726 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -547,6 +547,15 @@ void PairHybrid::init_style() if (used == 0) error->all(FLERR,"Pair hybrid sub-style is not used"); } + // The GPU library uses global data for each pair style, so the + // same style must not be used multiple times + + for (istyle = 0; istyle < nstyles; istyle++) { + bool is_gpu = (((PairHybrid *)styles[m])->suffix_flag & Suffix::GPU); + if (multiple[istyle] && is_gpu) + error->all(FLERR,"GPU package styles must not be used multiple times"); + } + // check if special_lj/special_coul overrides are compatible for (istyle = 0; istyle < nstyles; istyle++) {