HfS multiprocessor procedures
Back to the main HfS page
HfS multiprocessor procedures are versions that use Open MPI
and run in parallel using a number of processors available in the machines, or
in more than one host. The multiprocessor procedures
hfs_cube_mp and hfs_nh3_cube_mp
are naked versions of the single-processor versions,
hfs_cube_sp and hfs_nh3_cube_sp,
without any graphic output.
$ mpifort -fno-range-check -mcmodel=medium -ohfs_cube_mp hfs_cube_mp.f90
$ mpifort -fno-range-check -mcmodel=medium -ohfs_nh3_cube_mp hfs_cube_mp.f90
No need of linking with PGplot and X11 libraries.
The compilation is performed by the shell script hfs_compile
$ mpirun -np <N> hfs_cube_mp <parfile>.par
$ mpirun -np <N> hfs_nh3_cube_mp <parfile>.par
where <N> is the number of processors to use.
To know the number (and characteristics) of processors in a Linux system, use
$ cat /proc/cpuinfo
Running in more than one host
For example, running in localhost and another host
$ mpirun -np <N> -host localhost,<otherhost> hfs_cube_mp <parfile>.par
$ mpirun -np <N> -host localhost,<otherhost> hfs_nh3_cube_mp <parfile>.par
Here <N> is the total number of processors to use, distributed
among the hosts listed after -host.
If you want to know which are the processes run in each host, use the option
Requisites for running in a remote host <otherhost>
ssh access to <otherhost>, without having to enter the passwd.
To achieve this, in localhost, make:
$ cd $HOME/.ssh
> enter passphrase: <RET>
A file id_rsa_pub is created, and has to be copied to
in a file called authorized_keys2:
$ scp ~/.ssh/id_rsa.pub <user>@<otherhost>:.ssh/authorized_keys2
or, if the file .ssh/authorized_keys2 already exists in
$ scp ~/.ssh/id_rsa.pub <user>@<otherhost>:.ssh/id.tmp
$ ssh <otherhost> 'cat .ssh/id.tmp >> .ssh/authorized_keys2; rm .ssh/id.tmp'
Sometimes it is necessary to run in <otherhost>:
$ restorecon -v '.ssh/authorized_keys2'
Open MPI installed in <otherhost>.
Your PATH and LD_LIBRARY_PATH in
<otherhost> have to point to the openmpi
bin and lib folders in the
installation directory. For example, if openmpi is installed in
/usr/local/openmpi, you can include in the file
- The same data file structure in <otherhost> and in
localhost, i.e. the same
directory from where you run hfs_cube_mp, with the same
paramater file <parfile> and data
files. The log files of the different processors,
log/<parfile>_##.log, will be
written in the host where each processor runs.