Unverified Commit c9cf3fba authored by Richard Berger's avatar Richard Berger Committed by GitHub
Browse files

Merge pull request #1013 from lammps/cslib

new MESSAGE package for client/server/coupling
parents 75403646 5f0423b9
Loading
Loading
Loading
Loading
+35 −2
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ if(ENABLE_TESTING)
endif(ENABLE_TESTING)

set(DEFAULT_PACKAGES ASPHERE BODY CLASS2 COLLOID COMPRESS DIPOLE GRANULAR
  KSPACE MANYBODY MC MEAM MISC MOLECULE PERI REAX REPLICA RIGID SHOCK SPIN SNAP
  KSPACE MANYBODY MC MEAM MESSAGE MISC MOLECULE PERI REAX REPLICA RIGID SHOCK SPIN SNAP
  SRD KIM PYTHON MSCG MPIIO VORONOI POEMS LATTE USER-ATC USER-AWPMD USER-BOCS
  USER-CGDNA USER-MESO USER-CGSDK USER-COLVARS USER-DIFFRACTION USER-DPD USER-DRUDE
  USER-EFF USER-FEP USER-H5MD USER-LB USER-MANIFOLD USER-MEAMC USER-MGPT USER-MISC
@@ -504,6 +504,39 @@ if(PKG_KIM)
  include_directories(${KIM_INCLUDE_DIRS})
endif()

if(PKG_MESSAGE)
  option(MESSAGE_ZMQ "Use ZeroMQ in MESSAGE package" OFF)
  file(GLOB_RECURSE cslib_SOURCES ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.F
      ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.c ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/*.cpp)

  if(BUILD_SHARED_LIBS)
      add_library(cslib SHARED ${cslib_SOURCES})
  else()
      add_library(cslib STATIC ${cslib_SOURCES})
  endif()

  if(BUILD_MPI)
    target_compile_definitions(cslib PRIVATE -DMPI_YES)
    set_target_properties(cslib PROPERTIES OUTPUT_NAME "csmpi")
  else()
    target_compile_definitions(cslib PRIVATE -DMPI_NO)
    set_target_properties(cslib PROPERTIES OUTPUT_NAME "csnompi")
  endif()

  if(MESSAGE_ZMQ)
    target_compile_definitions(cslib PRIVATE -DZMQ_YES)
    find_package(ZMQ REQUIRED)
    target_include_directories(cslib PRIVATE ${ZMQ_INCLUDE_DIRS})
    target_link_libraries(cslib PUBLIC ${ZMQ_LIBRARIES})
  else()
    target_compile_definitions(cslib PRIVATE -DZMQ_NO)
    target_include_directories(cslib PRIVATE ${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src/STUBS_ZMQ)
  endif()

  list(APPEND LAMMPS_LINK_LIBS cslib)
  include_directories(${LAMMPS_LIB_SOURCE_DIR}/message/cslib/src)
endif()

if(PKG_MSCG)
  find_package(GSL REQUIRED)
  option(DOWNLOAD_MSCG "Download latte (instead of using the system's one)" OFF)
@@ -1200,7 +1233,7 @@ endif()
###############################################################################
# Print package summary
###############################################################################
foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES})
foreach(PKG ${DEFAULT_PACKAGES} ${ACCEL_PACKAGES} ${OTHER_PACKAGES})
  if(PKG_${PKG})
    message(STATUS "Building package: ${PKG}")
  endif()
+8 −0
Original line number Diff line number Diff line
find_path(ZMQ_INCLUDE_DIR zmq.h)
find_library(ZMQ_LIBRARY NAMES zmq)

set(ZMQ_LIBRARIES ${ZMQ_LIBRARY})
set(ZMQ_INCLUDE_DIRS ${ZMQ_INCLUDE_DIR})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZMQ DEFAULT_MSG ZMQ_LIBRARY ZMQ_INCLUDE_DIR)
+34 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ This is the list of packages that may require additional steps.
"KOKKOS"_#kokkos,
"LATTE"_#latte,
"MEAM"_#meam,
"MESSAGE"_#message,
"MSCG"_#mscg,
"OPT"_#opt,
"POEMS"_#poems,
@@ -361,6 +362,10 @@ make lib-meam args="-m mpi" # build with default Fortran compiler compatible
make lib-meam args="-m serial" # build with compiler compatible with "make serial" (GNU Fortran)
make lib-meam args="-m ifort"  # build with Intel Fortran compiler using Makefile.ifort :pre

NOTE: You should test building the MEAM library with both the Intel
and GNU compilers to see if a simulation runs faster with one versus
the other on your system.

The build should produce two files: lib/meam/libmeam.a and
lib/meam/Makefile.lammps.  The latter is copied from an existing
Makefile.lammps.* and has settings needed to link C++ (LAMMPS) with
@@ -373,6 +378,35 @@ file.

:line
 
MESSAGE package :h4,link(message)

This package can optionally include support for messaging via sockets,
using the open-source "ZeroMQ library"_http://zeromq.org, which must
be installed on your system.

[CMake build]:

-D MESSAGE_ZMQ=value    # build with ZeroMQ support, value = no (default) or yes

[Traditional make]:

Before building LAMMPS, you must build the CSlib library in
lib/message.  You can build the CSlib library manually if you prefer;
follow the instructions in lib/message/README.  You can also do it in
one step from the lammps/src dir, using a command like these, which
simply invoke the lib/message/Install.py script with the specified args:

make lib-message               # print help message
make lib-message args="-m -z"  # build with MPI and socket (ZMQ) support
make lib-message args="-s"     # build as serial lib with no ZMQ support

The build should produce two files: lib/message/cslib/src/libmessage.a
and lib/message/Makefile.lammps.  The latter is copied from an
existing Makefile.lammps.* and has settings to link with the ZeroMQ
library if requested in the build.

:line
 
MSCG package :h4,link(mscg)

To build with this package, you must download and build the MS-CG
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ packages:
"KOKKOS"_Build_extras.html#kokkos,
"LATTE"_Build_extras.html#latte,
"MEAM"_Build_extras.html#meam,
"MESSAGE"_#Build_extras.html#message,
"MSCG"_Build_extras.html#mscg,
"OPT"_Build_extras.html#opt,
"POEMS"_Build_extras.html#poems,
+2 −0
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ An alphabetic list of all LAMMPS commands.
"lattice"_lattice.html,
"log"_log.html,
"mass"_mass.html,
"message"_message.html,
"minimize"_minimize.html,
"min_modify"_min_modify.html,
"min_style"_min_style.html,
@@ -103,6 +104,7 @@ An alphabetic list of all LAMMPS commands.
"restart"_restart.html,
"run"_run.html,
"run_style"_run_style.html,
"server"_server.html,
"set"_set.html,
"shell"_shell.html,
"special_bonds"_special_bonds.html,
Loading