AMBER Archive (2002)

Subject: Re: Intel ifc Compiler

From: Robert Duke (rduke_at_email.unc.edu)
Date: Thu May 30 2002 - 08:13:59 CDT


Joachim -
I routinely use the 5.0 version of ifc with great success for fortran 90
code. I have not tried using version 6 but presume they are similar. I
have been porting sander to f90 and doing various performance optimizations,
and get 70+% speedup for big problems running on a single athlon and Linux.
I use ifc for production work, and Lahey f90 (fujitsu) if I am having
debugging problems. I have tried using the absoft and portland group
compilers, and have had problems with either floating point control, f90
language conformance, or compiler bugs (as of about 5 months ago). I do not
routinely compile sander with ifc, as g77 does a pretty good job, but I have
done it using the machine file below. This will produce a sander that is
about 10-20% slower than g77. If you replace the -mp option with a -mp1
option, you will run about 10-20% faster, but if you use nmropt=2, you will
run into problems with a hack in either lapack or blas (I forget which) that
hangs. The problem is caused by code that is attempting to determine
machine fp precision, and if the compiler is giving you 80 bit fp register
precision, the routine loops forever on a compare, as I recollect. I am
primarily interested in fast MD and have thus not ported the nmropt=2 stuff
and can drop blas and lapack (and thus run faster using the -mp1 option).
There is a great compiler comparison study for Linux available at
www.polyhedron.co.uk The machine file I use is:

BEGIN Machine.ifc

#! /bin/csh -f
########################################################################
# #
# Copyright (c) 1986, 1991, 1995 #
# Regents of the University of California #
# #
# All Rights Reserved #
# #
# Machine Dependency Handling System #
# #
# Bill Ross ross_at_cgl.ucsf.edu #
# An extension of work of George Seibel #
# #
# Dependencies written by various authors. #
# #
# Permission to use, copy, modify, and distribute this software and #
# its documentation for any purpose and without fee is hereby #
# granted, provided that the above copyright notice appear in all #
# copies and that both that copyright notice and this permission #
# notice appear in supporting documentation, and that the name of #
# the University of California not be used in advertising or #
# publicity pertaining to distribution of the software without #
# specific, written prior permission. #
# #
# THE REGENTS OF THE UNIVERSITY OF CALIFORNIA DISCLAIM ALL #
# WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED #
# WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE #
# UNIVERSITY OF CALIFORNIA BE LIABLE FOR ANY SPECIAL, INDIRECT OR #
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM #
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, #
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN #
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #
# #
########################################################################

#
#
setenv MACHINE LINUX_INTEL
setenv MACH Linux
setenv MACHINEFLAGS "-DREGNML "
setenv FFLAGS "-DSHORT=INTEGER(2) -DLOGICAL_BYTE=LOGICAL(1)"
setenv MACHINEFLAGS "$MACHINEFLAGS $FFLAGS"

# CPP is the cpp for this machine
setenv CPP "/lib/cpp -traditional "
setenv CC "gcc"

# SYSDIR is the name of the system-specific source directory relative to
src/*/
setenv SYSDIR Machines/ifc

# COMPILER ALIASES:

# LOADER/LINKER:
setenv LOAD "ifc "
setenv LOADLIB " -lPEPCF90"

# little or no optimization:
setenv L0 "ifc -c -auto -tpp6 -mp -O0"

# modest optimization (local scalar):
setenv L1 "ifc -c -auto -tpp6 -mp -O2"

# high scalar optimization (but not vectorization):
setenv L2 "ifc -c -auto -tpp6 -mp -ip -O3"

# high optimization (may be vectorization, not parallelization):
setenv L3 "ifc -c -auto -tpp6 -mp -ip -O3"

# ranlib, if it exists
setenv RANLIB ranlib

END Machine.ifc

You also need to create a directory and sys files in Machines as follows:

cp -a absoft ifc

You then need to edit erfcfun.c in this subdir, changing all instances of
DERFCFUN to derfcfun_.

It would probably also be a good idea to add the following line to
$AMBERHOME/src/Makefile:

cd Machines/ifc; make clean

Getting this stuff to run under mpich or mpich-gm requires additional effort
also. I have done it for my f90 code but not sander itself. Basically, you
have to hack the mpich stuff to get it to use -lPEPCF90, which is where the
command line functions come from (and incidentally, where you ran into
trouble). When/if you need it, I will be glad to give you the details.

Good luck.
Bob Duke
UNC Chapel Hill Chemistry Dept.

----- Original Message -----
From: "Joachim Reichelt" <Reichelt_at_gbf.de>
To: <amber_at_heimdal.compchem.ucsf.edu>
Sent: Thursday, May 30, 2002 5:23 AM
Subject: Intel ifc Compiler

> Dear all,
>
> I just want to setup AMBER6 on Linux using the
> new INTEL Fortran 6.0 compiler.
> Are the any known problems?
> Which is the best Machine file to use?
> I failed with a modified g77 and pg77.
>
> mdfil.o: In function `mdfil':
> /home/jr/amber6/src/sander/_mdfil_.f:102: undefined reference to `iargc'
> /home/jr/amber6/src/sander/_mdfil_.f:107: undefined reference to `getarg'
> /home/jr/amber6/src/sander/_mdfil_.f:113: undefined reference to `getarg'
> /home/jr/amber6/src/sander/_mdfil_.f:116: undefined reference to `getarg'
> /home/jr/amber6/src/sander/_mdfil_.f:119: undefined reference to `getarg'
> /home/jr/amber6/src/sander/_mdfil_.f:122: undefined reference to `getarg'
> mdfil.o:/home/jr/amber6/src/sander/_mdfil_.f:125: more undefined
> references to `getarg' follow
> ew_setup.o: In function `find_ewaldcof':
> ew_setup.o(.text+0x218a): undefined reference to `derfcfun'
> ew_setup.o(.text+0x21f2): undefined reference to `derfcfun'
> ew_setup.o: In function `read_ewald':
> ew_setup.o(.text+0x4ce3): undefined reference to `derfcfun'
> ew_direct.o: In function `get_ee_func':
> ew_direct.o(.text+0xb23): undefined reference to `derfcfun'
> ew_recip_reg.o: In function `find_maxexp':
> ew_recip_reg.o(.text+0x2442): undefined reference to `derfcfun'
> ew_recip_reg.o(.text+0x24b9): more undefined references to `derfcfun'
follow
> /home/jr/amber6/src/Machines/g77/sys.a(sys.o): In function `amdate':
> sys.o(.text+0x21): undefined reference to `fdate'
> /home/jr/amber6/src/Machines/g77/sys.a(sys.o): In function `amflsh':
> sys.o(.text+0x55): undefined reference to `flush'
> /home/jr/amber6/src/Machines/g77/sys.a(sys.o): In function `second':
> sys.o(.text+0xcb): undefined reference to `etime'
> make[1]: *** [sander] Error 1
> make[1]: Leaving directory `/home/jr/amber6/src/sander'
>
> --
> Mit freundlichen Gruessen Best Regards
>
> Joachim Reichelt
>
> SB - Strukturbiologie
> GBF - Gesellschaft fuer Biotechnologische Forschung
> German Research Centre for Biotechnology
>
> WWW: http://www.gbf.de _/_/_/ _/_/_/ _/_/_/_/
> EMAIL: REICHELT_at_gbf.de _/ _/ _/ _/ _/
> _/ _/ _/ _/
> Mascheroder Weg 1 _/ _/ _/_/_/ _/_/_/
> D-38124 Braunschweig _/ _/ _/ _/ _/
> Tel: +(49) 531 6181 352 _/ _/ _/ _/ _/
> FAX: +(49) 531 2612 388 _/_/_/ _/_/_/ _/
>
> http://struktur.gbf.de/
>
> -- Disclaimer --
> Standard > Keyword : Opinions, my own, nobody else's, whatsoever ...
>
> Man muss sich notfalls jemand mieten,
> hat man an Geist selbst nichts zu bieten! (Heinz Erhardt)
>
>
>