[CPMD-list] Re: OpenMP Parallelization of CPMD
Axel Kohlmeyer
axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Tue Aug 19 07:51:04 CEST 2003
>>> "JK" == Jim Kress <jimkress at kressworks.com> writes:
JK> I have managed to get CPMD 3.7.2 running in parallel using MPI (MPICH) and the
JK> Portland Group Compilers (Thanks Axel!). I'd like to try to get it to run in
JK> parallel with OpenMP to compare performance with MPI (MPICH).
JK> The CPMD documentation alludes to OpenMP but gives no directions on how to do
JK> the necessary compiles. Also, Configure has no (obvious) information on how
JK> to create an OpenMP parallel version of CPMD.
JK> Anybody know how to do this and is willing to share with the list?
hi jim.
to compile for OpenMP you only need to signal the compiler to
look for OpenMP directives. with the portland compilers this is
done by adding the flag '-mp' to the FC and LD makefile variables,
e.g.:
CC = gcc -O2 -Wall -D_REENTRANT
FC = pgf77 -c -fast -mp -tp athlon -D_REENTRANT
LD = pgf77 -fast -mp -tp athlon -D_REENTRANT
then recompile everything (make clean ; make)
if you want to enable OpenMP during a parallel run, you have
to set the environment variable OMP_NUM_THREADS to the number
of cpus, you want to use for OpenMP (usually 2 on SMP PCs).
so you have to type:
OMP_NUM_THREADS=2
export OMP_NUM_THREADS
if you have a bourne shell and
setenv OMP_NUM_THREADS 2
if you have a c-shell.
you then start the cpmd job and should see
multiple cpmd threads/processes instead of
a single one.
the tricky part is to make that work on a
parallel run. please refer to your MPICH
documentation on how to export environment
variables to 'remote' nodes.
be prepared for depressing results. although
a combination of MPI and OpenMP seems to be
a smart choice, if you want to run a cpmd job
on a large number of cpus (particularly if you
do not have a high-speed interconnect) , i
have not found any improvement on PC hardware.
in fact, i was usually better off using either
only MPI or not using the second CPU at all
(the latter especially on dual pentium-4 machines).
good luck,
axel.
p.s.: if you find the time, please let me know
of your findings. TIA, a.
JK> Thanks.
JK> Jim
--
=======================================================================
Axel Kohlmeyer e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53 Fax: ++49 (0)234/32-14045
D-44780 Bochum http://www.theochem.ruhr-uni-bochum.de
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
More information about the CPMD-list
mailing list