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

Collected small fixes and update for the next patch
This commit is contained in:
Axel Kohlmeyer 2019-07-19 17:25:39 -04:00 committed by GitHub
commit 981b9a1f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 114 additions and 86 deletions

View File

@ -37,7 +37,7 @@ include(PreventInSourceBuilds)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
#release comes with -O3 by default #release comes with -O3 by default
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS) endif(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CXX_FLAGS)
string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE) string(TOUPPER "${CMAKE_BUILD_TYPE}" BTYPE)
@ -673,5 +673,10 @@ if(PKG_KOKKOS)
message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}") message(STATUS "Kokkos Arch: ${KOKKOS_ARCH}")
endif() endif()
if(PKG_KSPACE) if(PKG_KSPACE)
message(STATUS "Using ${FFT} as FFT") message(STATUS "Using ${FFT} as primary FFT library")
if(FFT_SINGLE)
message(STATUS "Using single precision FFTs")
else()
message(STATUS "Using double precision FFTs")
endif()
endif() endif()

View File

@ -1,5 +1,5 @@
if(PKG_KSPACE) if(PKG_KSPACE)
option(FFT_SINGLE "Use single precision FFT instead of double" OFF) option(FFT_SINGLE "Use single precision FFTs instead of double precision FFTs" OFF)
set(FFTW "FFTW3") set(FFTW "FFTW3")
if(FFT_SINGLE) if(FFT_SINGLE)
set(FFTW "FFTW3F") set(FFTW "FFTW3F")
@ -7,26 +7,30 @@ if(PKG_KSPACE)
endif() endif()
find_package(${FFTW} QUIET) find_package(${FFTW} QUIET)
if(${FFTW}_FOUND) if(${FFTW}_FOUND)
set(FFT "${FFTW}" CACHE STRING "FFT library for KSPACE package") set(FFT "FFTW3" CACHE STRING "FFT library for KSPACE package")
else() else()
set(FFT "KISS" CACHE STRING "FFT library for KSPACE package") set(FFT "KISS" CACHE STRING "FFT library for KSPACE package")
endif() endif()
set(FFT_VALUES KISS ${FFTW} MKL) set(FFT_VALUES KISS FFTW3 MKL)
set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES}) set_property(CACHE FFT PROPERTY STRINGS ${FFT_VALUES})
validate_option(FFT FFT_VALUES) validate_option(FFT FFT_VALUES)
string(TOUPPER ${FFT} FFT) string(TOUPPER ${FFT} FFT)
if(NOT FFT STREQUAL "KISS")
find_package(${FFT} REQUIRED) if(FFT STREQUAL "FFTW3")
if(NOT FFT STREQUAL "FFTW3F") find_package(${FFTW} REQUIRED)
add_definitions(-DFFT_FFTW) add_definitions(-DFFT_FFTW3)
else() include_directories(${${FFTW}_INCLUDE_DIRS})
add_definitions(-DFFT_${FFT}) list(APPEND LAMMPS_LINK_LIBS ${${FFTW}_LIBRARIES})
endif() elseif(FFT STREQUAL "MKL")
include_directories(${${FFT}_INCLUDE_DIRS}) find_package(MKL REQUIRED)
list(APPEND LAMMPS_LINK_LIBS ${${FFT}_LIBRARIES}) add_definitions(-DFFT_MKL)
include_directories(${MKL_INCLUDE_DIRS})
list(APPEND LAMMPS_LINK_LIBS ${MKL_LIBRARIES})
else() else()
# last option is KISSFFT
add_definitions(-DFFT_KISS) add_definitions(-DFFT_KISS)
endif() endif()
set(FFT_PACK "array" CACHE STRING "Optimization for FFT") set(FFT_PACK "array" CACHE STRING "Optimization for FFT")
set(FFT_PACK_VALUES array pointer memcpy) set(FFT_PACK_VALUES array pointer memcpy)
set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES}) set_property(CACHE FFT_PACK PROPERTY STRINGS ${FFT_PACK_VALUES})

View File

@ -171,42 +171,40 @@ The individual style names on the "Commands
compute"_Commands_compute.html doc page are followed by one or more of compute"_Commands_compute.html doc page are followed by one or more of
(g,i,k,o,t) to indicate which accelerated styles exist. (g,i,k,o,t) to indicate which accelerated styles exist.
"ackland/atom"_compute_ackland_atom.html - "ackland/atom"_compute_ackland_atom.html - determines the local lattice structure based on the Ackland formulation
"adf"_compute_adf.html - angular distribution function of triples of atoms "adf"_compute_adf.html - angular distribution function of triples of atoms
"aggregate/atom"_compute_cluster_atom.html - aggregate ID for each atom "aggregate/atom"_compute_cluster_atom.html - aggregate ID for each atom
"angle"_compute_angle.html - "angle"_compute_angle.html - energy of each angle sub-style
"angle/local"_compute_angle_local.html - "angle/local"_compute_angle_local.html - theta and energy of each angle
"angle/local"_compute_bond_local.html - theta and energy of each angle
"angmom/chunk"_compute_angmom_chunk.html - angular momentum for each chunk "angmom/chunk"_compute_angmom_chunk.html - angular momentum for each chunk
"basal/atom"_compute_basal_atom.html - "basal/atom"_compute_basal_atom.html - calculates the hexagonal close-packed “c” lattice vector of each atom
"body/local"_compute_body_local.html - attributes of body sub-particles "body/local"_compute_body_local.html - attributes of body sub-particles
"bond"_compute_bond.html - values computed by a bond style "bond"_compute_bond.html - energy of each bond sub-style
"bond/local"_compute_bond_local.html - distance and energy of each bond "bond/local"_compute_bond_local.html - distance and energy of each bond
"centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom "centro/atom"_compute_centro_atom.html - centro-symmetry parameter for each atom
"chunk/atom"_compute_chunk_atom.html - assign chunk IDs to each atom "chunk/atom"_compute_chunk_atom.html - assign chunk IDs to each atom
"chunk/spread/atom"_compute_chunk_spread_atom.html - spreads chunk values to each atom in chunk "chunk/spread/atom"_compute_chunk_spread_atom.html - spreads chunk values to each atom in chunk
"cluster/atom"_compute_cluster_atom.html - cluster ID for each atom "cluster/atom"_compute_cluster_atom.html - cluster ID for each atom
"cna/atom"_compute_cna_atom.html - common neighbor analysis (CNA) for each atom "cna/atom"_compute_cna_atom.html - common neighbor analysis (CNA) for each atom
"cnp/atom"_compute_cnp_atom.html - "cnp/atom"_compute_cnp_atom.html - common neighborhood parameter (CNP) for each atom
"com"_compute_com.html - center-of-mass of group of atoms "com"_compute_com.html - center-of-mass of group of atoms
"com/chunk"_compute_com_chunk.html - center-of-mass for each chunk "com/chunk"_compute_com_chunk.html - center-of-mass for each chunk
"contact/atom"_compute_contact_atom.html - contact count for each spherical particle "contact/atom"_compute_contact_atom.html - contact count for each spherical particle
"coord/atom"_compute_coord_atom.html - coordination number for each atom "coord/atom"_compute_coord_atom.html - coordination number for each atom
"damage/atom"_compute_damage_atom.html - Peridynamic damage for each atom "damage/atom"_compute_damage_atom.html - Peridynamic damage for each atom
"dihedral"_compute_dihedral.html - "dihedral"_compute_dihedral.html - energy of each dihedral sub-style
"dihedral/local"_compute_dihedral_local.html - angle of each dihedral "dihedral/local"_compute_dihedral_local.html - angle of each dihedral
"dilatation/atom"_compute_dilatation_atom.html - Peridynamic dilatation for each atom "dilatation/atom"_compute_dilatation_atom.html - Peridynamic dilatation for each atom
"dipole/chunk"_compute_dipole_chunk.html - "dipole/chunk"_compute_dipole_chunk.html - dipole vector and total dipole for each chunk
"displace/atom"_compute_displace_atom.html - displacement of each atom "displace/atom"_compute_displace_atom.html - displacement of each atom
"dpd"_compute_dpd.html - "dpd"_compute_dpd.html -
"dpd/atom"_compute_dpd_atom.html - "dpd/atom"_compute_dpd_atom.html -
"edpd/temp/atom"_compute_edpd_temp_atom.html - "edpd/temp/atom"_compute_edpd_temp_atom.html - per-atom temperature for each eDPD particle in a group
"entropy/atom"_compute_entropy_atom.html - "entropy/atom"_compute_entropy_atom.html - pair entropy fingerprint of each atom
"erotate/asphere"_compute_erotate_asphere.html - rotational energy of aspherical particles "erotate/asphere"_compute_erotate_asphere.html - rotational energy of aspherical particles
"erotate/rigid"_compute_erotate_rigid.html - rotational energy of rigid bodies "erotate/rigid"_compute_erotate_rigid.html - rotational energy of rigid bodies
"erotate/sphere"_compute_erotate_sphere.html - rotational energy of spherical particles "erotate/sphere"_compute_erotate_sphere.html - rotational energy of spherical particles
"erotate/sphere/atom"_compute_erotate_sphere.html - rotational energy for each spherical particle "erotate/sphere/atom"_compute_erotate_sphere_atom.html - rotational energy for each spherical particle
"erotate/sphere/atom"_compute_erotate_sphere_atom.html -
"event/displace"_compute_event_displace.html - detect event on atom displacement "event/displace"_compute_event_displace.html - detect event on atom displacement
"fep"_compute_fep.html - "fep"_compute_fep.html -
"force/tally"_compute_tally.html - "force/tally"_compute_tally.html -
@ -218,17 +216,17 @@ compute"_Commands_compute.html doc page are followed by one or more of
"heat/flux"_compute_heat_flux.html - heat flux through a group of atoms "heat/flux"_compute_heat_flux.html - heat flux through a group of atoms
"heat/flux/tally"_compute_tally.html - "heat/flux/tally"_compute_tally.html -
"hexorder/atom"_compute_hexorder_atom.html - bond orientational order parameter q6 "hexorder/atom"_compute_hexorder_atom.html - bond orientational order parameter q6
"improper"_compute_improper.html - "improper"_compute_improper.html - energy of each improper sub-style
"improper/local"_compute_improper_local.html - angle of each improper "improper/local"_compute_improper_local.html - angle of each improper
"inertia/chunk"_compute_inertia_chunk.html - inertia tensor for each chunk "inertia/chunk"_compute_inertia_chunk.html - inertia tensor for each chunk
"ke"_compute_ke.html - translational kinetic energy "ke"_compute_ke.html - translational kinetic energy
"ke/atom"_compute_ke_atom.html - kinetic energy for each atom "ke/atom"_compute_ke_atom.html - kinetic energy for each atom
"ke/atom/eff"_compute_ke_atom_eff.html - "ke/atom/eff"_compute_ke_atom_eff.html - per-atom translational and radial kinetic energy in the electron force field model
"ke/eff"_compute_ke_eff.html - "ke/eff"_compute_ke_eff.html - kinetic energy of a group of nuclei and electrons in the electron force field model
"ke/rigid"_compute_ke_rigid.html - translational kinetic energy of rigid bodies "ke/rigid"_compute_ke_rigid.html - translational kinetic energy of rigid bodies
"meso/e/atom"_compute_meso_e_atom.html - "meso/e/atom"_compute_meso_e_atom.html - per-atom internal energy of Smooth-Particle Hydrodynamics atoms
"meso/rho/atom"_compute_meso_rho_atom.html - "meso/rho/atom"_compute_meso_rho_atom.html - per-atom mesoscopic density of Smooth-Particle Hydrodynamics atoms
"meso/t/atom"_compute_meso_t_atom.html - "meso/t/atom"_compute_meso_t_atom.html - per-atom internal temperature of Smooth-Particle Hydrodynamics atoms
"msd"_compute_msd.html - mean-squared displacement of group of atoms "msd"_compute_msd.html - mean-squared displacement of group of atoms
"msd/chunk"_compute_msd_chunk.html - mean-squared displacement for each chunk "msd/chunk"_compute_msd_chunk.html - mean-squared displacement for each chunk
"msd/nongauss"_compute_msd_nongauss.html - MSD and non-Gaussian parameter of group of atoms "msd/nongauss"_compute_msd_nongauss.html - MSD and non-Gaussian parameter of group of atoms
@ -242,73 +240,72 @@ compute"_Commands_compute.html doc page are followed by one or more of
"pe/tally"_compute_tally.html - "pe/tally"_compute_tally.html -
"plasticity/atom"_compute_plasticity_atom.html - Peridynamic plasticity for each atom "plasticity/atom"_compute_plasticity_atom.html - Peridynamic plasticity for each atom
"pressure"_compute_pressure.html - total pressure and pressure tensor "pressure"_compute_pressure.html - total pressure and pressure tensor
"pressure/cylinder"_compute_pressure_cylinder.html - "pressure/cylinder"_compute_pressure_cylinder.html - pressure tensor in cylindrical coordinates
"pressure/uef"_compute_pressure_uef.html - "pressure/uef"_compute_pressure_uef.html - pressure tensor in the reference frame of an applied flow field
"property/atom"_compute_property_atom.html - convert atom attributes to per-atom vectors/arrays "property/atom"_compute_property_atom.html - convert atom attributes to per-atom vectors/arrays
"property/chunk"_compute_property_chunk.html - extract various per-chunk attributes "property/chunk"_compute_property_chunk.html - extract various per-chunk attributes
"property/local"_compute_property_local.html - convert local attributes to localvectors/arrays "property/local"_compute_property_local.html - convert local attributes to localvectors/arrays
"ptm/atom"_compute_ptm_atom.html - "ptm/atom"_compute_ptm_atom.html - determines the local lattice structure based on the Polyhedral Template Matching method
"rdf"_compute_rdf.html - radial distribution function g(r) histogram of group of atoms "rdf"_compute_rdf.html - radial distribution function g(r) histogram of group of atoms
"reduce"_compute_reduce.html - combine per-atom quantities into a single global value "reduce"_compute_reduce.html - combine per-atom quantities into a single global value
"reduce/chunk"_compute_reduce_chunk.html - reduce per-atom quantities within each chunk "reduce/chunk"_compute_reduce_chunk.html - reduce per-atom quantities within each chunk
"reduce/region"_compute_reduce.html - same as compute reduce, within a region "reduce/region"_compute_reduce.html - same as compute reduce, within a region
"rigid/local"_compute_rigid_local.html - extract rigid body attributes "rigid/local"_compute_rigid_local.html - extract rigid body attributes
"saed"_compute_saed.html - "saed"_compute_saed.html - electron diffraction intensity on a mesh of reciprocal lattice nodes
"slice"_compute_slice.html - extract values from global vector or array "slice"_compute_slice.html - extract values from global vector or array
"smd/contact/radius"_compute_smd_contact_radius.html - "smd/contact/radius"_compute_smd_contact_radius.html -
"smd/damage"_compute_smd_damage.html - "smd/damage"_compute_smd_damage.html - damage status of SPH particles in Smooth Mach Dynamics
"smd/hourglass/error"_compute_smd_hourglass_error.html - "smd/hourglass/error"_compute_smd_hourglass_error.html -
"smd/internal/energy"_compute_smd_internal_energy.html - "smd/internal/energy"_compute_smd_internal_energy.html - per-particle enthalpy in Smooth Mach Dynamics
"smd/plastic/strain"_compute_smd_plastic_strain.html - "smd/plastic/strain"_compute_smd_plastic_strain.html - equivalent plastic strain per particle in Smooth Mach Dynamics
"smd/plastic/strain/rate"_compute_smd_plastic_strain_rate.html - "smd/plastic/strain/rate"_compute_smd_plastic_strain_rate.html - time rate of the equivalent plastic strain in Smooth Mach Dynamics
"smd/rho"_compute_smd_rho.html - "smd/rho"_compute_smd_rho.html - per-particle mass density in Smooth Mach Dynamics
"smd/tlsph/defgrad"_compute_smd_tlsph_defgrad.html - "smd/tlsph/defgrad"_compute_smd_tlsph_defgrad.html - deformation gradient in Smooth Mach Dynamics
"smd/tlsph/dt"_compute_smd_tlsph_dt.html - "smd/tlsph/dt"_compute_smd_tlsph_dt.html - CFL-stable time increment per particle in Smooth Mach Dynamics
"smd/tlsph/num/neighs"_compute_smd_tlsph_num_neighs.html - "smd/tlsph/num/neighs"_compute_smd_tlsph_num_neighs.html -
"smd/tlsph/shape"_compute_smd_tlsph_shape.html - "smd/tlsph/shape"_compute_smd_tlsph_shape.html -
"smd/tlsph/strain"_compute_smd_tlsph_strain.html - "smd/tlsph/strain"_compute_smd_tlsph_strain.html -
"smd/tlsph/strain/rate"_compute_smd_tlsph_strain_rate.html - "smd/tlsph/strain/rate"_compute_smd_tlsph_strain_rate.html -
"smd/tlsph/stress"_compute_smd_tlsph_stress.html - "smd/tlsph/stress"_compute_smd_tlsph_stress.html - per-particle Cauchy stress tensor for SPH particles
"smd/triangle/vertices"_compute_smd_triangle_vertices.html -
"smd/triangle/vertices"_compute_smd_triangle_vertices.html - "smd/triangle/vertices"_compute_smd_triangle_vertices.html -
"smd/ulsph/num/neighs"_compute_smd_ulsph_num_neighs.html - "smd/ulsph/num/neighs"_compute_smd_ulsph_num_neighs.html -
"smd/ulsph/strain"_compute_smd_ulsph_strain.html - "smd/ulsph/strain"_compute_smd_ulsph_strain.html -
"smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html - "smd/ulsph/strain/rate"_compute_smd_ulsph_strain_rate.html -
"smd/ulsph/stress"_compute_smd_ulsph_stress.html - "smd/ulsph/stress"_compute_smd_ulsph_stress.html - per-particle Cauchy stress tensor and von Mises equivalent stress in Smooth Mach Dynamics
"smd/vol"_compute_smd_vol.html - "smd/vol"_compute_smd_vol.html - per-particle volumes and their sum in Smooth Mach Dynamics
"sna/atom"_compute_sna_atom.html - calculate bispectrum coefficients for each atom "sna/atom"_compute_sna_atom.html - calculate bispectrum coefficients for each atom
"snad/atom"_compute_sna_atom.html - derivative of bispectrum coefficients for each atom "snad/atom"_compute_sna_atom.html - derivative of bispectrum coefficients for each atom
"snav/atom"_compute_sna_atom.html - virial contribution from bispectrum coefficients for each atom "snav/atom"_compute_sna_atom.html - virial contribution from bispectrum coefficients for each atom
"spin"_compute_spin.html - "spin"_compute_spin.html - magnetic quantities for a system of atoms having spins
"stress/atom"_compute_stress_atom.html - stress tensor for each atom "stress/atom"_compute_stress_atom.html - stress tensor for each atom
"stress/mop"_compute_stress_mop.html - "stress/mop"_compute_stress_mop.html - normal components of the local stress tensor using the method of planes
"stress/mop/profile"_compute_stress_mop.html - "stress/mop/profile"_compute_stress_mop.html - profile of the normal components of the local stress tensor using the method of planes
"stress/tally"_compute_tally.html - "stress/tally"_compute_tally.html -
"tdpd/cc/atom"_compute_tdpd_cc_atom.html - "tdpd/cc/atom"_compute_tdpd_cc_atom.html - per-atom chemical concentration of a specified species for each tDPD particle
"temp"_compute_temp.html - temperature of group of atoms "temp"_compute_temp.html - temperature of group of atoms
"temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles "temp/asphere"_compute_temp_asphere.html - temperature of aspherical particles
"temp/body"_compute_temp_body.html - temperature of body particles "temp/body"_compute_temp_body.html - temperature of body particles
"temp/chunk"_compute_temp_chunk.html - temperature of each chunk "temp/chunk"_compute_temp_chunk.html - temperature of each chunk
"temp/com"_compute_temp_com.html - temperature after subtracting center-of-mass velocity "temp/com"_compute_temp_com.html - temperature after subtracting center-of-mass velocity
"temp/cs"_compute_temp_cs.html - "temp/cs"_compute_temp_cs.html - temperature based on the center-of-mass velocity of atom pairs that are bonded to each other
"temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity "temp/deform"_compute_temp_deform.html - temperature excluding box deformation velocity
"temp/deform/eff"_compute_temp_deform_eff.html - "temp/deform/eff"_compute_temp_deform_eff.html - temperature excluding box deformation velocity in the electron force field model
"temp/drude"_compute_temp_drude.html - "temp/drude"_compute_temp_drude.html - temperature of Core-Drude pairs
"temp/eff"_compute_temp_eff.html - "temp/eff"_compute_temp_eff.html - temperature of a group of nuclei and electrons in the electron force field model
"temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity "temp/partial"_compute_temp_partial.html - temperature excluding one or more dimensions of velocity
"temp/profile"_compute_temp_profile.html - temperature excluding a binned velocity profile "temp/profile"_compute_temp_profile.html - temperature excluding a binned velocity profile
"temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component "temp/ramp"_compute_temp_ramp.html - temperature excluding ramped velocity component
"temp/region"_compute_temp_region.html - temperature of a region of atoms "temp/region"_compute_temp_region.html - temperature of a region of atoms
"temp/region/eff"_compute_temp_region_eff.html - "temp/region/eff"_compute_temp_region_eff.html - temperature of a region of nuclei and electrons in the electron force field model
"temp/rotate"_compute_temp_rotate.html - "temp/rotate"_compute_temp_rotate.html - temperature of a group of atoms after subtracting out their center-of-mass and angular velocities
"temp/sphere"_compute_temp_sphere.html - temperature of spherical particles "temp/sphere"_compute_temp_sphere.html - temperature of spherical particles
"temp/uef"_compute_temp_uef.html - "temp/uef"_compute_temp_uef.html - kinetic energy tensor in the reference frame of an applied flow field
"ti"_compute_ti.html - thermodynamic integration free energy values "ti"_compute_ti.html - thermodynamic integration free energy values
"torque/chunk"_compute_torque_chunk.html - torque applied on each chunk "torque/chunk"_compute_torque_chunk.html - torque applied on each chunk
"vacf"_compute_vacf.html - velocity auto-correlation function of group of atoms "vacf"_compute_vacf.html - velocity auto-correlation function of group of atoms
"vcm/chunk"_compute_vcm_chunk.html - velocity of center-of-mass for each chunk "vcm/chunk"_compute_vcm_chunk.html - velocity of center-of-mass for each chunk
"voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom "voronoi/atom"_compute_voronoi_atom.html - Voronoi volume and neighbors for each atom
"xrd"_compute_xrd.html - :ul "xrd"_compute_xrd.html - x-ray diffraction intensity on a mesh of reciprocal lattice nodes :ul
[Restrictions:] none [Restrictions:] none

View File

@ -306,12 +306,6 @@ void PPPMKokkos<DeviceType>::init()
if (me == 0) { if (me == 0) {
#ifdef FFT_SINGLE
const char fft_prec[] = "single";
#else
const char fft_prec[] = "double";
#endif
if (screen) { if (screen) {
fprintf(screen," G vector (1/distance) = %g\n",g_ewald); fprintf(screen," G vector (1/distance) = %g\n",g_ewald);
fprintf(screen," grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm); fprintf(screen," grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm);
@ -320,7 +314,7 @@ void PPPMKokkos<DeviceType>::init()
estimated_accuracy); estimated_accuracy);
fprintf(screen," estimated relative force accuracy = %g\n", fprintf(screen," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force); estimated_accuracy/two_charge_force);
fprintf(screen," using %s precision FFTs\n",fft_prec); fprintf(screen," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(screen," 3d grid and FFT values/proc = %d %d\n", fprintf(screen," 3d grid and FFT values/proc = %d %d\n",
ngrid_max,nfft_both_max); ngrid_max,nfft_both_max);
} }
@ -332,7 +326,7 @@ void PPPMKokkos<DeviceType>::init()
estimated_accuracy); estimated_accuracy);
fprintf(logfile," estimated relative force accuracy = %g\n", fprintf(logfile," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force); estimated_accuracy/two_charge_force);
fprintf(logfile," using %s precision FFTs\n",fft_prec); fprintf(logfile," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(logfile," 3d grid and FFT values/proc = %d %d\n", fprintf(logfile," 3d grid and FFT values/proc = %d %d\n",
ngrid_max,nfft_both_max); ngrid_max,nfft_both_max);
} }

View File

@ -350,12 +350,6 @@ void PPPM::init()
if (me == 0) { if (me == 0) {
#ifdef FFT_SINGLE
const char fft_prec[] = "single";
#else
const char fft_prec[] = "double";
#endif
if (screen) { if (screen) {
fprintf(screen," G vector (1/distance) = %g\n",g_ewald); fprintf(screen," G vector (1/distance) = %g\n",g_ewald);
fprintf(screen," grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm); fprintf(screen," grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm);
@ -364,7 +358,7 @@ void PPPM::init()
estimated_accuracy); estimated_accuracy);
fprintf(screen," estimated relative force accuracy = %g\n", fprintf(screen," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force); estimated_accuracy/two_charge_force);
fprintf(screen," using %s precision FFTs\n",fft_prec); fprintf(screen," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(screen," 3d grid and FFT values/proc = %d %d\n", fprintf(screen," 3d grid and FFT values/proc = %d %d\n",
ngrid_max,nfft_both_max); ngrid_max,nfft_both_max);
} }
@ -376,7 +370,7 @@ void PPPM::init()
estimated_accuracy); estimated_accuracy);
fprintf(logfile," estimated relative force accuracy = %g\n", fprintf(logfile," estimated relative force accuracy = %g\n",
estimated_accuracy/two_charge_force); estimated_accuracy/two_charge_force);
fprintf(logfile," using %s precision FFTs\n",fft_prec); fprintf(logfile," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(logfile," 3d grid and FFT values/proc = %d %d\n", fprintf(logfile," 3d grid and FFT values/proc = %d %d\n",
ngrid_max,nfft_both_max); ngrid_max,nfft_both_max);
} }

View File

@ -23,11 +23,22 @@ KSpaceStyle(pppm,PPPM)
#include "lmptype.h" #include "lmptype.h"
#include <mpi.h> #include <mpi.h>
#if defined(FFT_FFTW3)
#define LMP_FFT_LIB "FFTW3"
#elif defined(FFT_MKL)
#define LMP_FFT_LIB "MKL FFT"
#else
#define LMP_FFT_LIB "KISS FFT"
#endif
#ifdef FFT_SINGLE #ifdef FFT_SINGLE
typedef float FFT_SCALAR; typedef float FFT_SCALAR;
#define LMP_FFT_PREC "single"
#define MPI_FFT_SCALAR MPI_FLOAT #define MPI_FFT_SCALAR MPI_FLOAT
#else #else
typedef double FFT_SCALAR; typedef double FFT_SCALAR;
#define LMP_FFT_PREC "double"
#define MPI_FFT_SCALAR MPI_DOUBLE #define MPI_FFT_SCALAR MPI_DOUBLE
#endif #endif

View File

@ -474,12 +474,6 @@ void PPPMDisp::init()
MPI_Allreduce(&nfft_both,&nfft_both_max,1,MPI_INT,MPI_MAX,world); MPI_Allreduce(&nfft_both,&nfft_both_max,1,MPI_INT,MPI_MAX,world);
if (me == 0) { if (me == 0) {
#ifdef FFT_SINGLE
const char fft_prec[] = "single";
#else
const char fft_prec[] = "double";
#endif
if (screen) { if (screen) {
fprintf(screen," Coulomb G vector (1/distance)= %g\n",g_ewald); fprintf(screen," Coulomb G vector (1/distance)= %g\n",g_ewald);
fprintf(screen," Coulomb grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm); fprintf(screen," Coulomb grid = %d %d %d\n",nx_pppm,ny_pppm,nz_pppm);
@ -488,7 +482,7 @@ void PPPMDisp::init()
acc); acc);
fprintf(screen," Coulomb estimated relative force accuracy = %g\n", fprintf(screen," Coulomb estimated relative force accuracy = %g\n",
acc/two_charge_force); acc/two_charge_force);
fprintf(screen," using %s precision FFTs\n",fft_prec); fprintf(screen," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(screen," 3d grid and FFT values/proc = %d %d\n", fprintf(screen," 3d grid and FFT values/proc = %d %d\n",
ngrid_max, nfft_both_max); ngrid_max, nfft_both_max);
} }
@ -501,7 +495,7 @@ void PPPMDisp::init()
acc); acc);
fprintf(logfile," Coulomb estimated relative force accuracy = %g\n", fprintf(logfile," Coulomb estimated relative force accuracy = %g\n",
acc/two_charge_force); acc/two_charge_force);
fprintf(logfile," using %s precision FFTs\n",fft_prec); fprintf(logfile," using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n");
fprintf(logfile," 3d grid and FFT values/proc = %d %d\n", fprintf(logfile," 3d grid and FFT values/proc = %d %d\n",
ngrid_max, nfft_both_max); ngrid_max, nfft_both_max);
} }

View File

@ -23,11 +23,21 @@ KSpaceStyle(pppm/disp,PPPMDisp)
#include "lmptype.h" #include "lmptype.h"
#include <mpi.h> #include <mpi.h>
#if defined(FFT_FFTW3)
#define LMP_FFT_LIB "FFTW3"
#elif defined(FFT_MKL)
#define LMP_FFT_LIB "MKL FFT"
#else
#define LMP_FFT_LIB "KISS FFT"
#endif
#ifdef FFT_SINGLE #ifdef FFT_SINGLE
typedef float FFT_SCALAR; typedef float FFT_SCALAR;
#define LMP_FFT_PREC "single"
#define MPI_FFT_SCALAR MPI_FLOAT #define MPI_FFT_SCALAR MPI_FLOAT
#else #else
typedef double FFT_SCALAR; typedef double FFT_SCALAR;
#define LMP_FFT_PREC "double"
#define MPI_FFT_SCALAR MPI_DOUBLE #define MPI_FFT_SCALAR MPI_DOUBLE
#endif #endif

View File

@ -55,7 +55,7 @@ AtomVecPeri::AtomVecPeri(LAMMPS *lmp) : AtomVec(lmp)
comm_f_only = 1; comm_f_only = 1;
size_forward = 4; size_forward = 4;
size_reverse = 3; size_reverse = 3;
size_border = 11; size_border = 12;
size_velocity = 3; size_velocity = 3;
size_data_atom = 7; size_data_atom = 7;
size_data_vel = 4; size_data_vel = 4;
@ -357,6 +357,7 @@ int AtomVecPeri::pack_border(int n, int *list, double *buf,
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -381,6 +382,7 @@ int AtomVecPeri::pack_border(int n, int *list, double *buf,
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -414,6 +416,7 @@ int AtomVecPeri::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -442,6 +445,7 @@ int AtomVecPeri::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -463,6 +467,7 @@ int AtomVecPeri::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -497,6 +502,7 @@ int AtomVecPeri::pack_border_hybrid(int n, int *list, double *buf)
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
j = list[i]; j = list[i];
buf[m++] = vfrac[j]; buf[m++] = vfrac[j];
buf[m++] = rmass[j];
buf[m++] = s0[j]; buf[m++] = s0[j];
buf[m++] = x0[j][0]; buf[m++] = x0[j][0];
buf[m++] = x0[j][1]; buf[m++] = x0[j][1];
@ -522,6 +528,7 @@ void AtomVecPeri::unpack_border(int n, int first, double *buf)
type[i] = (int) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i;
vfrac[i] = buf[m++]; vfrac[i] = buf[m++];
rmass[i] = buf[m++];
s0[i] = buf[m++]; s0[i] = buf[m++];
x0[i][0] = buf[m++]; x0[i][0] = buf[m++];
x0[i][1] = buf[m++]; x0[i][1] = buf[m++];
@ -551,6 +558,7 @@ void AtomVecPeri::unpack_border_vel(int n, int first, double *buf)
type[i] = (int) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i;
vfrac[i] = buf[m++]; vfrac[i] = buf[m++];
rmass[i] = buf[m++];
s0[i] = buf[m++]; s0[i] = buf[m++];
x0[i][0] = buf[m++]; x0[i][0] = buf[m++];
x0[i][1] = buf[m++]; x0[i][1] = buf[m++];
@ -576,6 +584,7 @@ int AtomVecPeri::unpack_border_hybrid(int n, int first, double *buf)
last = first + n; last = first + n;
for (i = first; i < last; i++) { for (i = first; i < last; i++) {
vfrac[i] = buf[m++]; vfrac[i] = buf[m++];
rmass[i] = buf[m++];
s0[i] = buf[m++]; s0[i] = buf[m++];
x0[i][0] = buf[m++]; x0[i][0] = buf[m++];
x0[i][1] = buf[m++]; x0[i][1] = buf[m++];

View File

@ -41,7 +41,7 @@ AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp)
comm_x_only = comm_f_only = 0; comm_x_only = comm_f_only = 0;
size_forward = 7; size_forward = 7;
size_reverse = 6; size_reverse = 6;
size_border = 14; size_border = 15;
size_velocity = 6; size_velocity = 6;
size_data_atom = 7; size_data_atom = 7;
size_data_vel = 7; size_data_vel = 7;
@ -544,6 +544,7 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -576,6 +577,7 @@ int AtomVecEllipsoid::pack_border(int n, int *list, double *buf,
buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -618,6 +620,7 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -657,6 +660,7 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -689,6 +693,7 @@ int AtomVecEllipsoid::pack_border_vel(int n, int *list, double *buf,
buf[m++] = ubuf(tag[j]).d; buf[m++] = ubuf(tag[j]).d;
buf[m++] = ubuf(type[j]).d; buf[m++] = ubuf(type[j]).d;
buf[m++] = ubuf(mask[j]).d; buf[m++] = ubuf(mask[j]).d;
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -735,6 +740,7 @@ int AtomVecEllipsoid::pack_border_hybrid(int n, int *list, double *buf)
m = 0; m = 0;
for (i = 0; i < n; i++) { for (i = 0; i < n; i++) {
j = list[i]; j = list[i];
buf[m++] = rmass[j];
if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d; if (ellipsoid[j] < 0) buf[m++] = ubuf(0).d;
else { else {
buf[m++] = ubuf(1).d; buf[m++] = ubuf(1).d;
@ -769,6 +775,7 @@ void AtomVecEllipsoid::unpack_border(int n, int first, double *buf)
tag[i] = (tagint) ubuf(buf[m++]).i; tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i;
rmass[i] = buf[m++];
ellipsoid[i] = (int) ubuf(buf[m++]).i; ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1; if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else { else {
@ -812,6 +819,7 @@ void AtomVecEllipsoid::unpack_border_vel(int n, int first, double *buf)
tag[i] = (tagint) ubuf(buf[m++]).i; tag[i] = (tagint) ubuf(buf[m++]).i;
type[i] = (int) ubuf(buf[m++]).i; type[i] = (int) ubuf(buf[m++]).i;
mask[i] = (int) ubuf(buf[m++]).i; mask[i] = (int) ubuf(buf[m++]).i;
rmass[i] = buf[m++];
ellipsoid[i] = (int) ubuf(buf[m++]).i; ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1; if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else { else {
@ -854,6 +862,7 @@ int AtomVecEllipsoid::unpack_border_hybrid(int n, int first, double *buf)
m = 0; m = 0;
last = first + n; last = first + n;
for (i = first; i < last; i++) { for (i = first; i < last; i++) {
rmass[i] = buf[m++];
ellipsoid[i] = (int) ubuf(buf[m++]).i; ellipsoid[i] = (int) ubuf(buf[m++]).i;
if (ellipsoid[i] == 0) ellipsoid[i] = -1; if (ellipsoid[i] == 0) ellipsoid[i] = -1;
else { else {

View File

@ -13,6 +13,7 @@
#include <mpi.h> #include <mpi.h>
#include <cstring> #include <cstring>
#include <cstdlib>
#include "utils.h" #include "utils.h"
#include "lammps.h" #include "lammps.h"
#include "error.h" #include "error.h"