From 34e0c05b092c5ebde43be80fbf3c49a9e88464f2 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 16 Dec 2018 20:36:48 -0500 Subject: [PATCH] allow -suffix and -package command line flags to be use independently --- src/lammps.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/lammps.cpp b/src/lammps.cpp index 29926732ec..944033264c 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -761,26 +761,27 @@ void LAMMPS::post_create() // check that KOKKOS package classes were instantiated // check that GPU, INTEL, USER-OMP fixes were compiled with LAMMPS - if (!suffix_enable) return; + if (suffix_enable) { - if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU")) - error->all(FLERR,"Using suffix gpu without GPU package installed"); - if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) - error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); - if (strcmp(suffix,"kk") == 0 && - (kokkos == NULL || kokkos->kokkos_exists == 0)) - error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); - if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) - error->all(FLERR,"Using suffix omp without USER-OMP package installed"); + if (strcmp(suffix,"gpu") == 0 && !modify->check_package("GPU")) + error->all(FLERR,"Using suffix gpu without GPU package installed"); + if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) + error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); + if (strcmp(suffix,"kk") == 0 && + (kokkos == NULL || kokkos->kokkos_exists == 0)) + error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); + if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) + error->all(FLERR,"Using suffix omp without USER-OMP package installed"); - if (strcmp(suffix,"gpu") == 0) input->one("package gpu 1"); - if (strcmp(suffix,"intel") == 0) input->one("package intel 1"); - if (strcmp(suffix,"omp") == 0) input->one("package omp 0"); + if (strcmp(suffix,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix,"intel") == 0) input->one("package intel 1"); + if (strcmp(suffix,"omp") == 0) input->one("package omp 0"); - if (suffix2) { - if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 1"); - if (strcmp(suffix2,"intel") == 0) input->one("package intel 1"); - if (strcmp(suffix2,"omp") == 0) input->one("package omp 0"); + if (suffix2) { + if (strcmp(suffix2,"gpu") == 0) input->one("package gpu 1"); + if (strcmp(suffix2,"intel") == 0) input->one("package intel 1"); + if (strcmp(suffix2,"omp") == 0) input->one("package omp 0"); + } } // invoke any command-line package commands