Make Zstd support optional
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
find_package(ZLIB REQUIRED)
|
||||
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)
|
||||
endif()
|
||||
|
||||
@ -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
|
||||
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
|
||||
this packaging.
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#include "dump_atom_zstd.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
@ -189,3 +191,5 @@ int DumpAtomZstd::modify_param(int narg, char **arg)
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(atom/zstd,DumpAtomZstd)
|
||||
@ -47,6 +49,7 @@ class DumpAtomZstd : public DumpAtom {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
#include "dump_cfg_zstd.h"
|
||||
#include "atom.h"
|
||||
#include "domain.h"
|
||||
@ -192,3 +193,4 @@ int DumpCFGZstd::modify_param(int narg, char **arg)
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(cfg/zstd,DumpCFGZstd)
|
||||
@ -47,6 +48,7 @@ class DumpCFGZstd : public DumpCFG {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#include "dump_custom_zstd.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
@ -189,3 +191,5 @@ int DumpCustomZstd::modify_param(int narg, char **arg)
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(custom/zstd,DumpCustomZstd)
|
||||
@ -48,6 +50,7 @@ class DumpCustomZstd : public DumpCustom {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#include "dump_local_zstd.h"
|
||||
#include "domain.h"
|
||||
#include "error.h"
|
||||
@ -189,3 +191,5 @@ int DumpLocalZstd::modify_param(int narg, char **arg)
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(local/zstd,DumpLocalZstd)
|
||||
@ -47,6 +49,7 @@ class DumpLocalZstd : public DumpLocal {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#include "dump_xyz_zstd.h"
|
||||
#include "error.h"
|
||||
#include "update.h"
|
||||
@ -164,3 +166,5 @@ int DumpXYZZstd::modify_param(int narg, char **arg)
|
||||
}
|
||||
return consumed;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
Contributing author: Richard Berger (Temple U)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef LAMMPS_ZSTD
|
||||
|
||||
#ifdef DUMP_CLASS
|
||||
|
||||
DumpStyle(xyz/zstd,DumpXYZZstd)
|
||||
@ -47,6 +49,7 @@ class DumpXYZZstd : public DumpXYZ {
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user