Merge pull request #1504 from akohlmey/collected-small-fixes

Collected small bugfixes and changes
This commit is contained in:
Axel Kohlmeyer 2019-06-11 20:20:19 -04:00 committed by GitHub
commit 0b25d2feef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 13 deletions

View File

@ -33,7 +33,6 @@ include(LAMMPSUtils)
get_lammps_version(${LAMMPS_SOURCE_DIR}/version.h LAMMPS_VERSION)
include(PreventInSourceBuilds)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
@ -51,6 +50,7 @@ check_for_autogen_files(${LAMMPS_SOURCE_DIR})
# these need ot be done early (before further tests).
#####################################################################
include(CheckCCompilerFlag)
include(CheckIncludeFileCXX)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Intel")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -restrict")
@ -186,10 +186,6 @@ if(LAMMPS_EXCEPTIONS)
set(LAMMPS_API_DEFINES "${LAMMPS_API_DEFINES} -DLAMMPS_EXCEPTIONS")
endif()
option(CMAKE_VERBOSE_MAKEFILE "Verbose makefile" OFF)
# "hard" dependencies between packages resulting
# in an error instead of skipping over files
pkg_depends(MPIIO MPI)
@ -198,7 +194,6 @@ pkg_depends(USER-LB MPI)
pkg_depends(USER-PHONON KSPACE)
pkg_depends(USER-SCAFACOS MPI)
include(CheckIncludeFileCXX)
find_package(OpenMP QUIET)
# TODO: this is a temporary workaround until a better solution is found. AK 2019-05-30

View File

@ -1,5 +1,4 @@
if(PKG_USER-INTEL)
include(CheckIncludeFile)
check_include_file_cxx(immintrin.h FOUND_IMMINTRIN)
if(NOT FOUND_IMMINTRIN)
message(FATAL_ERROR "immintrin.h header not found, Intel package won't work without it")

View File

@ -67,7 +67,7 @@
namespace LAMMPS_NS {
// same as in variable.cpp
enum {INDEX,LOOP,WORLD,UNIVERSE,ULOOP,STRING,GETENV,
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,PYTHON};
SCALARFILE,ATOMFILE,FORMAT,EQUAL,ATOM,VECTOR,PYTHON,INTERNAL};
enum {COMPUTES=1<<0,
DUMPS=1<<1,
@ -106,7 +106,7 @@ static const int STYLES = ATOM_STYLES | INTEGRATE_STYLES | MINIMIZE_STYLES
static const char *varstyles[] = {
"index", "loop", "world", "universe", "uloop", "string", "getenv",
"file", "atomfile", "format", "equal", "atom", "python", "(unknown)"};
"file", "atomfile", "format", "equal", "atom", "vector", "python", "internal", "(unknown)"};
static const char *mapstyles[] = { "none", "array", "hash" };
@ -599,6 +599,10 @@ void Info::command(int narg, char **arg)
int ndata = 1;
fprintf(out,"Variable[%3d]: %-10s, style = %-10s, def =",
i,names[i],varstyles[style[i]]);
if (style[i] == INTERNAL) {
fprintf(out,"%g\n",input->variable->dvalue[i]);
continue;
}
if ((style[i] != LOOP) && (style[i] != ULOOP))
ndata = input->variable->num[i];
for (int j=0; j < ndata; ++j)

View File

@ -288,11 +288,11 @@ void Variable::set(int narg, char **arg)
int maxcopy = strlen(arg[2]) + 1;
int maxwork = maxcopy;
char *scopy = new char[maxcopy];
char *work = new char[maxwork];
char *scopy = (char *) memory->smalloc(maxcopy,"var:string/copy");
char *work = (char *) memory->smalloc(maxwork,"var:string/work");
strcpy(scopy,arg[2]);
input->substitute(scopy,work,maxcopy,maxwork,1);
delete [] work;
memory->sfree(work);
int ivar = find(arg[0]);
if (ivar >= 0) {
@ -310,7 +310,7 @@ void Variable::set(int narg, char **arg)
data[nvar] = new char*[num[nvar]];
copy(1,&scopy,data[nvar]);
}
delete [] scopy;
memory->sfree(scopy);
// GETENV
// remove pre-existing var if also style GETENV (allows it to be reset)