Skip to content

Commit

Permalink
wreck/lua.d: add openmpi.lua
Browse files Browse the repository at this point in the history
Add an "MPI personality" for OpenMPI that sets LD_LIBRARY_PATH
to find Flux libpmi2.so.
  • Loading branch information
garlick committed Aug 10, 2016
1 parent 50d99ae commit 7257647
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/wreck/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ dist_wreckscripts_SCRIPTS = \
lua.d/input.lua \
lua.d/mvapich.lua \
lua.d/pmi-mapping.lua \
lua.d/intel_mpi.lua
lua.d/intel_mpi.lua \
lua.d/open_mpi.lua

# XXX: Hack below to force rebuild of unbuilt wrexecd dependencies
#
Expand Down
31 changes: 31 additions & 0 deletions src/modules/wreck/lua.d/openmpi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- Set environment specific to openmpi
--
-- If configured for SLURM, OpenMPI links with libpmi.so or libpmi2.so
-- (depending on options used). Flux provides alternate versions of these
-- libraries in a non-default location, and we must set LD_LIBRARY_PATH to
-- point there.
--
-- Some versions of OpenMPI, 1.10.2 for example, set an rpath for their
-- PMI plugins that includes /usr/lib64. That is bug and those versions
-- need to be patched patched to work with Flux.
--
-- If Flux supports the PMI-2 wire protocol, the SLURM libpmi.so might
-- work with Flux. It currently doesn't, and in fact ignores the protocol
-- version handshake entirely. (See flux-framework/flux-core#746)


local dirname = require 'flux.posix'.dirname

function rexecd_init ()
local env = wreck.environ
local f = wreck.flux
local libpmi = f:getattr ('conf.pmi_library_path')
local ldpath = dirname (libpmi)

if (env['LD_LIBRARY_PATH'] ~= nil) then
ldpath = ldpath..':'..env['LD_LIBRARY_PATH']
end
env['LD_LIBRARY_PATH'] = ldpath
end

-- vi: ts=4 sw=4 expandtab

0 comments on commit 7257647

Please sign in to comment.