Skip to content

ensure $TMPDIR is set to a short path for OpenMPI v2.x#2311

Merged
wpoely86 merged 7 commits intoeasybuilders:developfrom
boegel:openmpi_tmpdir
Sep 24, 2017
Merged

ensure $TMPDIR is set to a short path for OpenMPI v2.x#2311
wpoely86 merged 7 commits intoeasybuilders:developfrom
boegel:openmpi_tmpdir

Conversation

@boegel
Copy link
Copy Markdown
Member

@boegel boegel commented Sep 19, 2017

If $TMPDIR is set to a long path, OpenMPI 2.x fails with an error like:

PMIx has detected a temporary directory name that results
in a path that is too long for the Unix domain socket:

    Temp dir: /local/305822X5092X.master21.swalot.gent.vsc/eb-riPl9d/openmpi-sessions-2540023@node2643_0/64817

Try setting your TMPDIR environmental variable to point to
something shorter in length

See also https://www.open-mpi.org/faq/?category=osx#startup-errors-with-open-mpi-2.0.x.

This can occur on macOS, where the default temporary directory is something weird like /var/folders/mg/q0_5yv791yz65cdnbglcqjvc0000gp/T rather than the more usual /tmp, but also in a job environment where $TMPDIR is set to a pre-created temporary directory that is specific to the job, e.g. /local/305822[5092].master21.swalot.gent.vsc for an array job in Torque (which EasyBuild garbles into local/305822X5092X.master21.swalot.gent.vsc to avoid using square brackets in the path name.

To ensure that OpenMPI 2.x doesn't go down on its knees because of this when installing software with EasyBuild (usually because some tests are run using mpirun), we can ensure that the $TMPDIR value is something short.

@easybuilders easybuilders deleted a comment from boegelbot Sep 20, 2017
@boegel boegel requested a review from a team September 20, 2017 12:51
Comment thread easybuild/toolchains/mpi/openmpi.py Outdated
ompi_ver = self.get_software_version(self.MPI_MODULE_NAME)[0]
if LooseVersion(ompi_ver) >= LooseVersion('2.0') and LooseVersion(ompi_ver) < LooseVersion('3.0'):
if len(self.orig_tmpdir) > 50:
env.setvar('TMPDIR', tempfile.mkdtemp(prefix='/tmp/'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you really sure that's a good idea? I would alert the user and let them handle it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why this wouldn't be a good idea, since this is exactly the recommendation OpenMPI makes (set $TMPDIR to /tmp).
At least we're setting it to a unique subdirectory in /tmp...

Are you worried about the hardcoding of /tmp?

wpoely86
wpoely86 previously approved these changes Sep 22, 2017
@easybuilders easybuilders deleted a comment from boegelbot Sep 22, 2017
@wpoely86 wpoely86 merged commit a87c77d into easybuilders:develop Sep 24, 2017
@boegel boegel deleted the openmpi_tmpdir branch September 25, 2017 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants