4

I am unable to run Open MPI under Slurm through a Slurm-script.

In general, I am able to obtain the hostname and run Open MPI on my machine.

$ mpirun hostname
myHost
$ cd NPB3.3-SER/ && make ua CLASS=B && mpirun -n 1 bin/ua.B.x inputua.data # Works

But if I do the same operation through the slurm-script mpirun hostname returns empty string and consequently I am unable to run mpirun -n 1 bin/ua.B.x inputua.data.

slurm-script.sh:

#!/bin/bash
#SBATCH -o slurm.out        # STDOUT
#SBATCH -e slurm.err        # STDERR
#SBATCH --mail-type=ALL

export LD_LIBRARY_PATH="/usr/lib/openmpi/lib"
mpirun hostname > output.txt # Returns empty
cd NPB3.3-SER/ 
make ua CLASS=B 
mpirun --host myHost -n 1 bin/ua.B.x inputua.data
$ sbatch -N1 slurm-script.sh
Submitted batch job 1

The error I am receiving:

There are no allocated resources for the application
  bin/ua.B.x
that match the requested mapping:    
------------------------------------------------------------------
Verify that you have mapped the allocated resources properly using the
--host or --hostfile specification.

A daemon (pid unknown) died unexpectedly with status 1 while attempting
to launch so we are aborting.

There may be more information reported by the environment (see above).

This may be because the daemon was unable to find all the needed shared
libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
location of the shared libraries on the remote nodes and this will
automatically be forwarded to the remote nodes.
------------------------------------------------------------------
mpirun noticed that the job aborted, but has no info as to the process
that caused that situation.
------------------------------------------------------------------
An ORTE daemon has unexpectedly failed after launch and before
communicating back to mpirun. This could be caused by a number
of factors, including an inability to create a connection back
to mpirun due to a lack of common network interfaces and/or no
route found between them. Please check network connectivity
(including firewalls and network routing requirements).
------------------------------------------------------------------
alper
  • 2,919
  • 9
  • 53
  • 102
  • just remove the `--host myHost` option altogether. If SLURM was compiled with OpenMPI integration, it would be able to pass the list of allocated nodes to mpirun implicitly. – Dima Chubarov Mar 21 '19 at 01:54
  • I have removed `--host myHost` but still I am having the same error. I have compiled SLURM as follows `./configure --enable-debug --enable-front-end && make && make install`. How could I compile SLURM with OpenMPI integration? @DmitriChubarov – alper Mar 21 '19 at 06:34
  • Could you give slurm and openmpi versions? – sancho.s ReinstateMonicaCellio Apr 01 '19 at 07:19
  • What do you get if you run `hostname` (not `mpirun hostname`) via `slurm`? This could discriminate whether `openmpi` is involved in the issue. My guess is most likely openmpi has nothing to do with `output.txt` being empty (I wouldn't know if that is the *only* problem you have, or simply the first to show up). – sancho.s ReinstateMonicaCellio Apr 01 '19 at 07:31
  • If I run `hostname` via `slurm` it returns `ebloc` that is actually the `NodeHostName` on `slurm.conf` as well. @sancho.s – alper Apr 01 '19 at 10:32
  • Please compare the results of executing exactly the same `mpirun` command via command line and slurm. You are not using `--host` in the command line. – sancho.s ReinstateMonicaCellio Apr 01 '19 at 12:27
  • Via command line `mpirun -n 1 bin/ua.B.x inputua.data` works without an error. But interestingly using `--host` on command line:`mpirun --host myHost -n 1 bin/ua.B.x inputua.data` generated following error: `This may be because the daemon was unable to find all the needed shared libraries on the remote node. You may set your LD_LIBRARY_PATH to have the location of the shared libraries on the remote nodes and this will automatically be forwarded to the remote nodes.` – alper Apr 01 '19 at 12:39
  • Conversely, what happens if you execute `mpirun` without `--host` via slurm? That seems to be (part of?) the problem. Perhaps `/usr/lib/openmpi/lib` is not the correct path. In my system, for example, it is `/usr/lib64/openmpi/lib` – sancho.s ReinstateMonicaCellio Apr 01 '19 at 16:16
  • In addition, what OS do you have? Why do you compile slurm instead of using an available package? – sancho.s ReinstateMonicaCellio Apr 01 '19 at 16:20
  • While waiting for your confirmation on `LD_LIBRARY_PATH` and `mpirun` without `--host` in a slurm script, please see updated answer. – sancho.s ReinstateMonicaCellio Apr 02 '19 at 05:46

2 Answers2

2

If Slurm and OpenMPI are recent versions, make sure that OpenMPI is compiled with Slurm support (run ompi_info | grep slurm to find out) and just run srun bin/ua.B.x inputua.data in your submission script.

Alternatively, mpirun bin/ua.B.x inputua.data should work too.

If OpenMPI is compiled without Slurm support the following should work:

srun hostname > output.txt
cd NPB3.3-SER/ 
make ua CLASS=B 
mpirun --hostfile output.txt -n 1 bin/ua.B.x inputua.data

Make sure also that by running export LD_LIBRARY_PATH="/usr/lib/openmpi/lib" you do not overwrite other library paths that are necessary. Better would probably be export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/usr/lib/openmpi/lib" (or a more complex version if you want to avoid a leading : if it were initially empty.)

damienfrancois
  • 52,978
  • 9
  • 96
  • 110
  • 1
    I am still having the same errors that I have represented on my question for `mpirun bin/ua.B.x inputua.data` .I have updated `LD_LIBRARY_PATH`, Unfortunately `srun` doesn't work. I can run `bin/sp.B.x inputsp.data` without any problem. // `$ srun hostname > output.txt` => `srun: error: srun task launch not supported on this system` // `$ ompi_info | grep slurm` => `MCA ras: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA plm: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA ess: slurm (MCA v2.0, API v2.0, Component v1.6.5) MCA ess: slurmd (MCA v2.0, API v2.0, Component v1.6.5)` – alper Mar 29 '19 at 16:27
  • If you have `FrontEnd` defined in your `slurm.conf`, remove it. – damienfrancois Mar 29 '19 at 19:43
  • I guest `FrontEnd` is not defined, //`cat /usr/local/etc/slurm.conf | grep "FrontEnd"` returns empty line. @damienfrancois – alper Mar 30 '19 at 08:30
  • Then check that the names in the `slurm.conf` file match those of the servers (`hostname -s`). Also make sure `slurm.conf` is identical on all machines? – damienfrancois Mar 30 '19 at 11:24
  • Currently I am using Slurm on a single machine and able to submit jobs via `sbatch` but not with `srun`. `hostname -s` matches with `ControlMachine` and `NodeHostName` in the `slurm.conf`. Please note that I wasn't not able to manage to make Slurm work on multiple machines due to the problem I have faced that asked before (https://stackoverflow.com/questions/44719897/slurm-how-to-connect-front-end-with-compute-nodes). – alper Mar 30 '19 at 11:35
  • Is `slurmd` running as `root`? – damienfrancois Mar 30 '19 at 19:22
  • Yes `slurmd` is running as root; please see how I start running `slurm`: https://gist.github.com/avatar-lavventura/29ff065c98c63a99cf2d647ec5dc1d3d @damienfrancois – alper Mar 31 '19 at 10:14
  • did you compile slurm by yourself? – damienfrancois Mar 31 '19 at 19:29
  • Yes I have compiled `slurm` from its source code => The way I compile and build is as follows: `$ git clone https://github.com/SchedMD/slurm $ cd slurm $ ./configure --enable-debug --enable-front-end $ sudo make install` – alper Apr 01 '19 at 10:06
  • Try removing that part: `--enable-front-end`. It is meant for specific architectures and sometimes abused to simulate a larger cluster on a single server. This is not what you want. You want a regular Slurm install with only one server that runs both controller and `slurmd`. – damienfrancois Apr 01 '19 at 11:42
0

What you need is: 1) run mpirun, 2) from slurm, 3) with --host. To determine who is responsible for this not to work (Problem 1), you could test a few things. Whatever you test, you should test exactly the same via command line (CLI) and via slurm (S). It is understood that some of these tests will produce different results in cases CLI and S.

A few notes are: 1) You are not testing exactly the same things in CLI and S. 2) You say that you are "unable to run mpirun -n 1 bin/ua.B.x inputua.data", while the problem is actually with mpirun --host myHost -n 1 bin/ua.B.x inputua.data. 3) The fact that mpirun hostname > output.txt returns an empty file (Problem 2) does not necessarily have the same origin as your main problem, see paragraph above. You can overcome this problem by using scontrol show hostnames or with the environment variable SLURM_NODELIST (on which scontrol show hostnames is based), but this will not solve Problem 1.


To work around Problem 2, which is not the most important, try a few things via both CLI and S. The slurm script below may be helpful.
#SBATCH -o slurm_hostname.out        # STDOUT
#SBATCH -e slurm_hostname.err        # STDERR
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:+${LD_LIBRARY_PATH}:}/usr/lib64/openmpi/lib"

mpirun hostname > hostname_mpirun.txt               # 1. Returns values ok for me
hostname > hostname.txt                             # 2. Returns values ok for me
hostname -s > hostname_slurmcontrol.txt             # 3. Returns values ok for me
scontrol show hostnames > hostname_scontrol.txt     # 4. Returns values ok for me
echo ${SLURM_NODELIST} > hostname_slurmcontrol.txt  # 5. Returns values ok for me

(for an explanation of the export command see this). From what you say, I understand 2, 3, 4 and 5 work ok for you, and 1 does not. So you could now use mpirun with suitable options --host or --hostfile.

Note the different format of the output of scontrol show hostnames (e.g., for me cnode17<newline>cnode18) and echo ${SLURM_NODELIST} (cnode[17-18]).

The host names could perhaps also be obtained in file names set dynamically with %h and %n in slurm.conf, look for e.g. SlurmdLogFile, SlurmdPidFile.


To diagnose/work around/solve Problem 1, try mpirun with/without --host, in CLI and S. From what you say, assuming you used the correct syntax in each case, this is the outcome:
  1. mpirun, CLI (original post). "Works".

  2. mpirun, S (comment?). Same error as item 4 below? Note that mpirun hostname in S should have produced similar output in your slurm.err.

  3. mpirun --host, CLI (comment). Error

    There are no allocated resources for the application bin/ua.B.x that match the requested mapping:
    ...
    This may be because the daemon was unable to find all the needed shared
    libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
    location of the shared libraries on the remote nodes and this will
    automatically be forwarded to the remote nodes.
    
  4. mpirun --host, S (original post). Error (same as item 3 above?)

    There are no allocated resources for the application
      bin/ua.B.x
    that match the requested mapping:    
    ------------------------------------------------------------------
    Verify that you have mapped the allocated resources properly using the
    --host or --hostfile specification.
    ...
    This may be because the daemon was unable to find all the needed shared
    libraries on the remote node. You may set your LD_LIBRARY_PATH to have the
    location of the shared libraries on the remote nodes and this will
    automatically be forwarded to the remote nodes.
    

As per comments, you may have a wrong LD_LIBRARY_PATH path set. You may also need to use mpi --prefix ...

Related? https://github.com/easybuilders/easybuild-easyconfigs/issues/204

  • `$ scontrol show hostnames` => `scontrol: error: host list is empty` `$ echo ${SLURM_NODELIST} # Returns empty` In addition to that I have run `slurm_test.slurm`. `hostname_mpirun.txt` is not created. `$ cat hostname_slurmcontrol.txt` => `ebloc` `$ cat hostname.txt` => `ebloc` – alper Apr 01 '19 at 10:27
  • @alper - I mean to get the output of `scontrol` in slurm, not the command line. Please post the contents of `slurm_hostname.out`. I expect to find there the host name. In addition, it seems `hostname` outputs the host name correctly. – sancho.s ReinstateMonicaCellio Apr 01 '19 at 12:05
  • `$ cat slurm.out` => `ebloc1 ebloc1` – alper Apr 01 '19 at 12:08
  • @alper - Is that not enough for using it as the host name where to `mpirun`? What is your expected output? – sancho.s ReinstateMonicaCellio Apr 01 '19 at 12:10
  • I have updated `myHost` as `ebloc1` but still I am having the same error. Please see the error in depth: https://gist.github.com/avatar-lavventura/b61f29a60643dc104c4c1a4945374208. I think as @damienfrancois suggested I need to re-compile `slurm` without `--enable-front-end` flag and try again. – alper Apr 01 '19 at 12:18
  • @alper - So the problem seems to be with `mpirun`, regardless of slurm. Please post the results of `mpirun -n 1 --host ... bin/ua.B.x inputua.data` (that piece of information was missing). What do you mean by "the same error". What are you exactly executing? – sancho.s ReinstateMonicaCellio Apr 01 '19 at 12:43
  • Please see the result of `mpirun -n 1 --host ... bin/ua.B.x inputua.data` from this link: https://gist.github.com/avatar-lavventura/b61f29a60643dc104c4c1a4945374208 // `There are no allocated resources for the application bin/ua.B.x that match the requested mapping:` – alper Apr 01 '19 at 19:55