[lammps-users] LAMMPS MKL

I’m trying to build LAMMPS with MKL. I changed the makefile because the MKL version on this system is different but still get some errors. These are the errors and the makefile. Any idea

Thanks

[[email protected]…12…1948… src]$ make mkl
make[1]: Entering directory /home/mgalanve/LAMMPS_May10/lammps-29May10/src/Obj_mkl' mpicc -O -L/packages/intel/mkl/[10.0.2.018/lib/em64t](http://10.0.2.018/lib/em64t) -L../../lib/reax -L/opt/intel/fce/10.0.023/lib angle_charmm.o angle_cosine.o angle_cosine_delta.o angle_cosine_squared.o angle.o angle_harmonic.o angle_hybrid.o angle_table.o atom.o atom_vec_angle.o atom_vec_atomic.o atom_vec_bond.o atom_vec_charge.o atom_vec.o atom_vec_full.o atom_vec_hybrid.o atom_vec_molecular.o bond.o bond_fene.o bond_fene_expand.o bond_harmonic.o bond_hybrid.o bond_morse.o bond_nonlinear.o bond_quartic.o bond_table.o change_box.o comm.o compute_angle_local.o compute_bond_local.o compute_centro_atom.o compute_cna_atom.o compute_com.o compute_com_molecule.o compute_coord_atom.o compute.o compute_dihedral_local.o compute_displace_atom.o compute_erotate_sphere.o compute_group_group.o compute_gyration.o compute_gyration_molecule.o compute_heat_flux.o compute_improper_local.o compute_ke_atom.o compute_ke.o compute_msd.o compute_msd_molecule.o compute_pair_local.o compute_pe_atom.o compute_pe.o compute_pressure.o compute_property_atom.o compute_property_local.o compute_property_molecule.o compute_rdf.o compute_reduce.o compute_reduce_region.o compute_stress_atom.o compute_temp_com.o compute_temp.o compute_temp_deform.o compute_temp_partial.o compute_temp_profile.o compute_temp_ramp.o compute_temp_region.o compute_temp_sphere.o create_atoms.o create_box.o delete_atoms.o delete_bonds.o dihedral_charmm.o dihedral.o dihedral_harmonic.o dihedral_helix.o dihedral_hybrid.o dihedral_multi_harmonic.o dihedral_opls.o displace_atoms.o displace_box.o domain.o dump_atom.o dump_cfg.o dump.o dump_custom.o dump_dcd.o dump_local.o dump_xyz.o error.o ewald.o fft3d.o fft3d_wrap.o finish.o fix_addforce.o fix_ave_atom.o fix_aveforce.o fix_ave_histo.o fix_ave_spatial.o fix_ave_time.o fix_bond_break.o fix_bond_create.o fix_bond_swap.o fix_box_relax.o fix.o fix_deform.o fix_deposit.o fix_drag.o fix_dt_reset.o fix_efield.o fix_enforce2d.o fix_evaporate.o fix_gravity.o fix_heat.o fix_indent.o fix_langevin.o fix_lineforce.o fix_minimize.o fix_momentum.o fix_move.o fix_nh_asphere.o fix_nh.o fix_nh_sphere.o fix_nph.o fix_nph_sphere.o fix_npt.o fix_npt_sphere.o fix_nve.o fix_nve_limit.o fix_nve_noforce.o fix_nve_sphere.o fix_nvt.o fix_nvt_sllod.o fix_nvt_sphere.o fix_orient_fcc.o fix_planeforce.o fix_press_berendsen.o fix_print.o fix_reax_bonds.o fix_recenter.o fix_respa.o fix_rigid.o fix_rigid_nve.o fix_rigid_nvt.o fix_setforce.o fix_shake.o fix_shear_history.o fix_spring.o fix_spring_rg.o fix_spring_self.o fix_store_coord.o fix_store_force.o fix_temp_berendsen.o fix_temp_rescale.o fix_thermal_conductivity.o fix_tmd.o fix_ttm.o fix_viscosity.o fix_viscous.o fix_wall.o fix_wall_harmonic.o fix_wall_lj126.o fix_wall_lj93.o fix_wall_reflect.o fix_wall_region.o force.o group.o improper.o improper_cvff.o improper_harmonic.o improper_hybrid.o input.o integrate.o kspace.o lammps.o lattice.o library.o main.o memory.o min_cg.o min.o min_hftn.o minimize.o min_linesearch.o min_sd.o modify.o neigh_bond.o neighbor.o neigh_derive.o neigh_full.o neigh_gran.o neigh_half_bin.o neigh_half_multi.o neigh_half_nsq.o neigh_list.o neigh_request.o neigh_respa.o neigh_stencil.o output.o pack.o pair_airebo.o pair_born_coul_long.o pair_buck_coul_cut.o pair_buck_coul_long.o pair_buck.o pair_coul_cut.o pair_coul_debye.o pair_coul_long.o pair.o pair_dpd.o pair_dpd_tstat.o pair_eam_alloy.o pair_eam.o pair_eam_fs.o pair_hybrid.o pair_hybrid_overlay.o pair_lj96_cut.o pair_lj_charmm_coul_charmm.o pair_lj_charmm_coul_charmm_implicit.o pair_lj_charmm_coul_long.o pair_lj_cut_coul_cut.o pair_lj_cut_coul_debye.o pair_lj_cut_coul_long.o pair_lj_cut_coul_long_tip4p.o pair_lj_cut.o pair_lj_expand.o pair_lj_gromacs_coul_gromacs.o pair_lj_gromacs.o pair_lj_smooth.o pair_morse.o pair_reax.o pair_soft.o pair_sw.o pair_table.o pair_tersoff.o pair_tersoff_zbl.o pair_yukawa.o pppm.o pppm_tip4p.o random_mars.o random_park.o read_data.o read_restart.o region_block.o region_cone.o region.o region_cylinder.o region_intersect.o region_plane.o region_prism.o region_sphere.o region_union.o remap.o remap_wrap.o replicate.o respa.o run.o set.o shell.o special.o temper.o thermo.o timer.o universe.o update.o variable.o velocity.o verlet.o write_restart.o -lreax -mt_mpi /packages/intel/mkl/[10.0.2.018/lib/em64t/libfftw3xc_intel.a](http://10.0.2.018/lib/em64t/libfftw3xc_intel.a) -lifcore -lsvml -lompstub -limf -lstdc++ -libmkl_intel_thread -libmkl_em64t -libguide -o ../lmp_mkl icc: command line error: invalid argument for option '-m' make[1]: *** [../lmp_mkl] Error 1 make[1]: Leaving directory /home/mgalanve/LAMMPS_May10/lammps-29May10/src/Obj_mkl’
make: *** [mkl] Error 2

mkl = Intel Cluster Tools, mpiicc, MKL MPI, MKL FFT

Intel recommends Intel Cluster Tools Compiler Edition

to build libfftw2xc_intel.a:

> cd /opt/intel/mkl/10.0.011/interfaces/fftw2xc

> become root via su

> gmake libem64t

SHELL = /bin/sh

---------------------------------------------------------------------

compiler/linker settings

specify flags and libraries needed for your compiler

CC = mpicc
CCFLAGS = -O3 -fno-alias -ip -unroll0
DEPFLAGS = -M
LINK = mpicc
LINKFLAGS = -O -L/packages/intel/mkl/10.0.2.018/lib/em64t
LIB = -lstdc++ -libmkl_intel_thread -libmkl_em64t -libguide
ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

---------------------------------------------------------------------

LAMMPS-specific settings

specify settings for LAMMPS features you will use

LAMMPS ifdef options, see doc/Section_start.html

LMP_INC = -DLAMMPS_GZIP

MPI library, can be src/STUBS dummy lib

INC = path for mpi.h, MPI compiler settings

PATH = path for MPI library

LIB = name of MPI library

MPI_INC = -DMPICH_IGNORE_CXX_SEEK
MPI_PATH =
MPI_LIB = -mt_mpi

FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package

INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler settings

PATH = path for FFT library

LIB = name of FFT library

FFT_INC = -DFFT_FFTW -I/packages/intel/mkl/10.0.2.018/include/fftw
FFT_PATH =
FFT_LIB = /packages/intel/mkl/10.0.2.018/lib/em64t/libfftw3xc_intel.a

additional system libraries needed by LAMMPS package libraries

these settings are IGNORED if the corresponding LAMMPS package

(e.g. gpu, meam) is NOT included in the LAMMPS build

SYSLIB = names of libraries

SYSPATH = paths of libraries

gpu_SYSLIB = -lcudart
meam_SYSLIB = -lifcore -lsvml -lompstub -limf
reax_SYSLIB = -lifcore -lsvml -lompstub -limf
user-atc_SYSLIB = -lblas -llapack

gpu_SYSPATH = -L/usr/local/cuda/lib64
meam_SYSPATH = -L/opt/intel/fce/10.0.023/lib
reax_SYSPATH = -L/opt/intel/fce/10.0.023/lib
user-atc_SYSPATH =

---------------------------------------------------------------------

build rules and dependencies

no need to edit this section

include Makefile.package

EXTRA_INC = (LMP_INC) (PKG_INC) (MPI_INC) (FFT_INC)
EXTRA_PATH = (PKG_PATH) (MPI_PATH) (FFT_PATH) (PKG_SYSPATH)
EXTRA_LIB = (PKG_LIB) (MPI_LIB) (FFT_LIB) (PKG_SYSLIB)

Link target

(EXE): (OBJ)
(LINK) (LINKFLAGS) (EXTRA_PATH) (OBJ) (EXTRA_LIB) (LIB) -o (EXE) (SIZE) $(EXE)

Library target

lib: (OBJ) (ARCHIVE) (ARFLAGS) (EXE) $(OBJ)

Compilation rules

.o:.cpp
(CC) (CCFLAGS) (EXTRA_INC) -c <

.d:.cpp
(CC) (CCFLAGS) (EXTRA_INC) (DEPFLAGS) < > @

Individual dependencies

DEPENDS = (OBJ:.o=.d) include (DEPENDS)

hi,

I'm trying to build LAMMPS with MKL. I changed the makefile because
the MKL version on this system is different but still get some errors.
These are the errors and the makefile. Any idea

Thanks

[...]

verlet.o write_restart.o -lreax
-mt_mpi /packages/intel/mkl/10.0.2.018/lib/em64t/libfftw3xc_intel.a
-lifcore -lsvml -lompstub -limf -lstdc++ -libmkl_intel_thread
-libmkl_em64t -libguide -o ../lmp_mkl
icc: command line error: invalid argument for option '-m'

ok, so you have a flag somewhere that starts
with -m that is wrong. lets see...

CC = mpicc
CCFLAGS = -O3 -fno-alias -ip -unroll0

this set of flags makes no sense. -ip doesn't help
for a code as complex as lammps but -unroll does.
-O3 with icc turns on some too aggressive optimizations.

my best flags so far have been:
-O2 -fno-exceptions -fno-rtti -ansi-alias \
-march=core2 -mtune=core2 -pc64 -no-prec-div -no-prec-sqrt -unroll

DEPFLAGS = -M
LINK = mpicc
LINKFLAGS = -O -L/packages/intel/mkl/10.0.2.018/lib/em64t
LIB = -lstdc++ -libmkl_intel_thread -libmkl_em64t -libguide

make sure that you define OMP_NUM_THREADS=1
linking with threaded MKL will slow you down if you
don't do that as it by default threads across all
available processor and doesn't pay attention to
MPI tasks. better to do:
       -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lstdc++

ARCHIVE = ar
ARFLAGS = -rc
SIZE = size

#
---------------------------------------------------------------------
# LAMMPS-specific settings
# specify settings for LAMMPS features you will use

# LAMMPS ifdef options, see doc/Section_start.html

LMP_INC = -DLAMMPS_GZIP

# MPI library, can be src/STUBS dummy lib
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library

MPI_INC = -DMPICH_IGNORE_CXX_SEEK
MPI_PATH =
MPI_LIB = -mt_mpi

...and here is your problem! -mt_mpi is putting the intel compiler off.
when you link with mpicc, you should not need to specify _any_ mpi
library. try setting this to empty.

# FFT library, can be -DFFT_NONE if not using PPPM from KSPACE package
# INC = -DFFT_FFTW, -DFFT_INTEL, -DFFT_NONE, etc, FFT compiler
settings
# PATH = path for FFT library
# LIB = name of FFT library

FFT_INC = -DFFT_FFTW
-I/packages/intel/mkl/10.0.2.018/include/fftw
FFT_PATH =
FFT_LIB
= /packages/intel/mkl/10.0.2.018/lib/em64t/libfftw3xc_intel.a

this _cannot_ work. with -DFFT_FFTW only the fftw2 interface
is supported. if you want to use the fftw3 interface you
have to use the LAMMPS-ICMS version with -DFFT_FFTW3,
or you can use the MKL fft directly with -DFFT_MKL
http://sites.google.com/site/akohlmey/software/lammps-icms

but there is not a significant speed different between
any of those three FFT libraries.

cheers,
   axel.