Make Zstd support optional

This commit is contained in:
Richard Berger
2020-08-31 18:21:58 -04:00
parent 3865de8705
commit 0925fc822d
12 changed files with 42 additions and 2 deletions

View File

@ -1,5 +1,9 @@
find_package(ZLIB REQUIRED) find_package(ZLIB REQUIRED)
target_link_libraries(lammps PRIVATE ZLIB::ZLIB) target_link_libraries(lammps PRIVATE ZLIB::ZLIB)
find_package(Zstd REQUIRED) find_package(Zstd)
if(Zstd_FOUND)
target_compile_definitions(lammps PRIVATE -DLAMMPS_ZSTD)
target_link_libraries(lammps PRIVATE Zstd::Zstd) target_link_libraries(lammps PRIVATE Zstd::Zstd)
endif()

View File

@ -10,5 +10,9 @@ alternative for compressed file I/O on systems where using a pipe can
cause problems, e.g. when using RDMA communication with pinned memory cause problems, e.g. when using RDMA communication with pinned memory
like clusters with Infiniband or Myrinet. like clusters with Infiniband or Myrinet.
Update 08/2020: Added variants that use the Zstd compression library instead
of zlib. To enable, set -DLAMMPS_ZSTD. These provide a wider range of
compression levels. See http://facebook.github.io/zstd/ for more details.
Currently a few selected dump styles are supported for writing via Currently a few selected dump styles are supported for writing via
this packaging. this packaging.

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#include "dump_atom_zstd.h" #include "dump_atom_zstd.h"
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
@ -189,3 +191,5 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
} }
return consumed; return consumed;
} }
#endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#ifdef DUMP_CLASS #ifdef DUMP_CLASS
DumpStyle(atom/zstd,DumpAtomZstd) DumpStyle(atom/zstd,DumpAtomZstd)
@ -47,6 +49,7 @@ class DumpAtomZstd : public DumpAtom {
} }
#endif
#endif #endif
#endif #endif

View File

@ -15,6 +15,7 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#include "dump_cfg_zstd.h" #include "dump_cfg_zstd.h"
#include "atom.h" #include "atom.h"
#include "domain.h" #include "domain.h"
@ -192,3 +193,4 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
} }
return consumed; return consumed;
} }
#endif

View File

@ -15,6 +15,7 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#ifdef DUMP_CLASS #ifdef DUMP_CLASS
DumpStyle(cfg/zstd,DumpCFGZstd) DumpStyle(cfg/zstd,DumpCFGZstd)
@ -47,6 +48,7 @@ class DumpCFGZstd : public DumpCFG {
} }
#endif
#endif #endif
#endif #endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#include "dump_custom_zstd.h" #include "dump_custom_zstd.h"
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
@ -189,3 +191,5 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
} }
return consumed; return consumed;
} }
#endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#ifdef DUMP_CLASS #ifdef DUMP_CLASS
DumpStyle(custom/zstd,DumpCustomZstd) DumpStyle(custom/zstd,DumpCustomZstd)
@ -48,6 +50,7 @@ class DumpCustomZstd : public DumpCustom {
} }
#endif
#endif #endif
#endif #endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#include "dump_local_zstd.h" #include "dump_local_zstd.h"
#include "domain.h" #include "domain.h"
#include "error.h" #include "error.h"
@ -189,3 +191,5 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
} }
return consumed; return consumed;
} }
#endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#ifdef DUMP_CLASS #ifdef DUMP_CLASS
DumpStyle(local/zstd,DumpLocalZstd) DumpStyle(local/zstd,DumpLocalZstd)
@ -47,6 +49,7 @@ class DumpLocalZstd : public DumpLocal {
} }
#endif
#endif #endif
#endif #endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#include "dump_xyz_zstd.h" #include "dump_xyz_zstd.h"
#include "error.h" #include "error.h"
#include "update.h" #include "update.h"
@ -164,3 +166,5 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
} }
return consumed; return consumed;
} }
#endif

View File

@ -15,6 +15,8 @@
Contributing author: Richard Berger (Temple U) Contributing author: Richard Berger (Temple U)
------------------------------------------------------------------------- */ ------------------------------------------------------------------------- */
#ifdef LAMMPS_ZSTD
#ifdef DUMP_CLASS #ifdef DUMP_CLASS
DumpStyle(xyz/zstd,DumpXYZZstd) DumpStyle(xyz/zstd,DumpXYZZstd)
@ -47,6 +49,7 @@ class DumpXYZZstd : public DumpXYZ {
} }
#endif
#endif #endif
#endif #endif