Mpirun does not work and asks to change the TMPDIR variable in / tmp
I have compiled the following code:
#include <mpi.h>
#include <stdio.h>
int main(int argc, char* argv[]) {
int rank, size, len;
char host[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Finalize();
return 0;
}
I did it this way:
mpic++ -o test test.cpp
and then i tried to run the file:
mpirun -np 2 test
but an error occured:
PMIx encountered a temporary directory name that results in a path that is too long for a Unix domain socket:
Temp dir: / var / folders / 12 / k2b2579s1yz2cfl8ppb1c6m80000gn / T / openmpi-sessions-501 @ MacBook-Air-Alexander-2_0 / 22793
Try setting the TMPDIR environment variable to point to something shorter in length
So, I did this:
export TMPDIR=/tmp
Tried running again: mpirun -np 2 test
But another error occurred:
Primary job completed normally, but 1 process returns
non-zero exit code. In the custom direction, the job was interrupted
----------------------------------------------- --- -----
mpirun detected that one or more processes exited with a non-zero status, which caused the work to be terminated. The first way to do it:
Process name: [[22798,1], 0]
Exit code: 1
Please tell me what should I do to run this code?
source to share
an initial error has already been reported and this is treated as a feature. using shorted the TMPDIR
way you did it is correct.
you can try adding
orte_tmpdir_base = /tmp
in yours openmpi-mca-params.conf
and see if it fixes your problem (so you don't need to install TMPDIR
in every terminal)
about the second problem, you are most likely using /usr/bin/test
instead of your test program, so you can simply
mpirun -np 2 ./test
or rename your test program to something that is not inPATH
source to share