Commit efc7b23b authored by sjplimp's avatar sjplimp Committed by GitHub
Browse files

Merge pull request #216 from akohlmey/user-nc-dump

USER-NC-DUMP package
parents 2106dce2 019bc0ba
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ Commands :h1
   dump_image
   dump_modify
   dump_molfile
   dump_nc
   echo
   fix
   fix_modify

doc/src/dump_nc.txt

0 → 100644
+64 −0
Original line number Diff line number Diff line
"LAMMPS WWW Site"_lws - "LAMMPS Documentation"_ld - "LAMMPS Commands"_lc :c

:link(lws,http://lammps.sandia.gov)
:link(ld,Manual.html)
:link(lc,Section_commands.html#comm)

:line

dump nc command :h3
dump nc/mpiio command :h3

[Syntax:]

dump ID group-ID nc N file.nc args
dump ID group-ID nc/mpiio N file.nc args :pre

ID = user-assigned name for the dump :ulb,l
group-ID = ID of the group of atoms to be imaged :l
{nc} or {nc/mpiio}  = style of dump command (other styles {atom} or {cfg} or {dcd} or {xtc} or {xyz} or {local} or {custom} are discussed on the "dump"_dump.html doc page) :l
N = dump every this many timesteps :l
file.nc = name of file to write to :l
args = list of per atom data elements to dump, same as for the 'custom' dump style. :l,ule

[Examples:]

dump 1 all nc 100 traj.nc type x y z vx vy vz
dump_modify 1 append yes at -1 global c_thermo_pe c_thermo_temp c_thermo_press :pre

dump 1 all nc/mpiio 1000 traj.nc id type x y z :pre

[Description:]

Dump a snapshot of atom coordinates every N timesteps in Amber-style
NetCDF file format. NetCDF files are binary, portable and self-describing.
This dump style will write only one file on the root node.  The dump
style {nc} uses the "standard NetCDF library"_netcdf-home all data is
collected on one processor and then written to the dump file. Dump style
{nc/mpiio} used the "parallel NetCDF library"_pnetcdf-home and MPI-IO;
it has better performance on a larger number of processors. Note that
'nc' outputs all atoms sorted by atom tag while 'nc/mpiio' outputs in
order of the MPI rank.

In addition to per-atom data, also global (i.e. not per atom, but per frame)
quantities can be included in the dump file. This can be variables, output
from computes or fixes data prefixed with v_, c_ and f_, respectively.
These properties are included via "dump_modify"_dump_modify.html {global}.

:line

[Restrictions:]

The {nc} and {nc/mpiio} dump styles are part of the USER-NC-DUMP package.
It is only enabled if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.

:link(netcdf-home,http://www.unidata.ucar.edu/software/netcdf/)
:link(pnetcdf-home,http://trac.mcs.anl.gov/projects/parallel-netcdf/)

:line

[Related commands:]

"dump"_dump.html, "dump_modify"_dump_modify.html, "undump"_undump.html
+19 −0
Original line number Diff line number Diff line
# Settings that the LAMMPS build will import when a package using the
# netCDF library is installed. This tries to automate configuration
# via the nc-config tool, which is part of the netCDF installation.

netcdf_SYSINC =
netcdf_SYSLIB =
netcdf_SYSPATH =

ifneq ($(shell which nc-config 2>> /dev/null),)
netcdf_SYSINC += -DLMP_HAS_NETCDF $(shell nc-config --cflags)
netcdf_SYSLIB += $(shell nc-config --libs)
endif

ifneq ($(shell which ncmpidump 2>> /dev/null),)
PNETCDF_PATH = $(shell which ncmpidump | sed -e 's,bin/ncmpidump,,')
netcdf_SYSINC += -DLMP_HAS_PNETCDF -I$(PNETCDF_PATH)/include
netcdf_SYSLIB += -lpnetcdf
netcdf_SYSPATH += -L$(PNETCDF_PATH)/lib
endif

lib/netcdf/README

0 → 100644
+43 −0
Original line number Diff line number Diff line
The Makefile.lammps file in this directory is used when building
LAMMPS with packages that make use of the NetCDF library or its
parallel version.  The file has several settings needed to compile
and link LAMMPS with the NetCDF and parallel NetCDF support.
For any regular NetCDF installation, all required flags should be
autodetected. Please note that parallel NetCDF support is
beneficial only when you run on a machine with very many processors
like an IBM BlueGene or Cray. For most people regular NetCDF
support should be sufficient and not cause any performance
penalties.

If you have problems compiling or linking, you may have to set
the flags manually. There are three makefile variables

1) netcdf_SYSINC
This is for setting preprocessor options and include file paths.
Set -DLMP_HAS_NETCDF, if you have NetCDF installed.
Set -DLMP_HAS_PNETCDF, if you have parallel NetCDF installed.
You can have either or both defines set. If none of these are
set, LAMMPS will compile, but the NetCDF enabled functionality
will not be available.
In addition you may have to point to the folder with the include
with -I/path/to/netcdf/include

Example for a Fedora 24 machine with serial NetCDF installed as
netcdf-devel-4.4.0-3.fc24.x86_64 RPM package:

netcdf_SYSINC = -DLMP_HAS_NETCDF -I/usr/include -I/usr/include/hdf

2) netcdf_SYSLIB
This is the setting for all required libraries that need to be linked to.

Example for a Fedora 24 machine with serial NetCDF installed as
netcdf-devel-4.4.0-3.fc24.x86_64 RPM package:

netcdf_SYSLIB = -lnetcdf

3) netcdf_SYSPATH
This is the setting for the path of directories with the NetCDF libraries.
Typically, this will be of the form -L/path/to/netcdf/lib

In the example from above, it can be left empty, because the Linux
distribution provided libraries are installed in a system library location.
+4 −0
Original line number Diff line number Diff line
@@ -271,6 +271,10 @@
/dump_custom_vtk.h
/dump_h5md.cpp
/dump_h5md.h
/dump_nc.cpp
/dump_nc.h
/dump_nc_mpiio.cpp
/dump_nc_mpiio.h
/dump_xtc.cpp
/dump_xtc.h
/dump_xyz_mpiio.cpp
Loading