Re: [AMBER-Developers] AmberTools17, intel, -mkl vs setting MKL_HOME

From: Scott Brozell <sbrozell.rci.rutgers.edu>
Date: Tue, 4 Apr 2017 02:28:14 -0400

Hi,

On Fri, Mar 31, 2017 at 04:35:14PM -0400, Hai Nguyen wrote:
> On Fri, Mar 31, 2017 at 4:18 PM, Scott Brozell <sbrozell.rci.rutgers.edu>
> > 1. This is a relatively recent change since i frequently configure with
> > -mkl and various forms of python without this problem. So probably the
> > best to investigate are those that have made recent python building
> > changes.
>
> Can you "ldd lib/libsander.so" to see if it is linked to lib_mkl_core.so?
> Likely the libsander.so issue rather python binding.

It is there:
libmkl_core.so => /opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64_lin/libmkl_core.so (0x00007fdf9b6f8000)

That file exists and has mkl_serv_getenv:
/opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64_lin/libmkl_core.so:000000000010ba10 T mkl_serv_getenv

All this makes sense since the non python tests using libsander worked.

On the same machine but with the system python instead of amber's
there are no test errors; so it still seems that something is
wrong or different with Amber's python:
===
./configure -mkl --with-python /usr/local/anaconda2/bin/python intel
...
Testing the Python LES API
/usr/local/anaconda2/bin/python test.py
Testing GB sander interface (diffcoords w/ RDT)
PASSED
...
0 tests experienced errors
===

Compare with
===
./configure -mkl intel
...
Testing the Python LES API
/tmp/amber/bin/amber.python test.py
/tmp/amber/bin/amber.python: symbol lookup error: /opt/intel/compilers_and_libraries_2016.3.210/linux/mkl/lib/intel64_lin/libmkl_vml_avx2.so: undefined symbol: mkl_serv_getenv
Program error
...
2 tests experienced errors
===

> > 2. For this build ./configure -mkl intel
> > I get a lot of hits grepping for getenv and then only 1 for grepping that
> > for mkl:
> > Binary file ./miniconda/pkgs/scipy-0.19.0-np112py27_nomkl_0/lib/python2.
> > 7/site-packages/scipy/sparse/_
> > sparsetools.so matches
> >
> Just FYI: If install python via Miniconda, numpy and scipy will be
> installed without mkl (I added "nomkl" option
> since MKL package added about 100 MB for miniconda build (got complain
> about size before).

Maybe i don't understand what you wrote, but it reads like that is the
problem, ie, adding "nomkl" is what broke it.

> > 3.
> > IMO we should be encouraging use the -mkl compiler flag.
> > The -mkl approach is far superior to MKL_HOME because the former follows
> > the principle of information hiding and the latter typically forces at
> > least
> > someone to decrypt the mess of details of mkl .a's and .so's.
>
> I agree.

Wow, we agree on a principle. I feel satisfied.

:)
scott


> >
> > Worth more than $0.02
> > :)
> > scott
> >
> >
> >
> >
> > On Fri, Mar 31, 2017 at 11:24:43AM -0400, David Case wrote:
> > > Hoping someone might recognize this symptom, and know what to do:
> > >
> > > Using Intel compilers (any recent version) there is a difference in
> > > AmberTools between passing the "-mkl" flag to configure, and setting
> > > the MKL_HOME environment variable. The former option is relatively new,
> > > whereas the latter is what we have used for some time.
> > >
> > > As Scott and others have found, using "-mkl" breaks the sanderapi:
> > > python cannot find mkl_serv_getenv, which is in lib_mkl_core.so
> > > libraries, which are apparently not getting properly linked in to
> > > libsander.so.
> > >
> > > If one instead sets MKL_HOME, things work fine, presumably because
> > > configure2 creates a config.h file that explicitly links to
> > libmkl_core.a.
> > > I've tried adding -lmkl_core to the config.h file created by configure2,
> > > but without success.
> > >
> > > Minor point: using -mkl rather than setting MKL_HOME leads to roundoff
> > > differences in many of the sqm tests. But users of the intel compilers
> > > can probably recognize these for what they are.
> > >
> > > If anyone can figure out how to get the pysander API to find
> > mkl_serv_getenv
> > > when the -mkl flag is set, that would be a big help.

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Mon Apr 03 2017 - 23:30:02 PDT
Custom Search