LAMMPS WWW Site - LAMMPS Documentation - LAMMPS Mailing List Archives
Re: [lammps-users] LAMMPS MKL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lammps-users] LAMMPS MKL


From: Axel Kohlmeyer <akohlmey@gmail.com>
Date: Fri, 11 Jun 2010 21:05:40 -0400

On Fri, 2010-06-11 at 18:34 -0600, Magdian Galan Vera wrote:

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.

> 
> -- 
> M. Ulises Galan Vera, M.S. Student
> Mechanical and Aerospace Engineering
> Arizona State University
> mgalanve@asu.edu
> http://masslab.asu.edu/
> 
> Cell: (480) 452-9077 
> ------------------------------------------------------------------------------
> ThinkGeek and WIRED's GeekDad team up for the Ultimate 
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
> lucky parental unit.  See the prize list and enter to win: 
> http://p.sf.net/sfu/thinkgeek-promo
> _______________________________________________ lammps-users mailing list lammps-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lammps-users

-- 
Dr. Axel Kohlmeyer  akohlmey@gmail.com
http://sites.google.com/site/akohlmey/

Institute for Computational Molecular Science
Temple University, Philadelphia PA, USA.