Following the tutorial on this link, I try to run a MPI code under MacOS 10.9.5 (Mavericks) with a number of process equal to 256 : the MPI code allocates for each process a 512x512
2D array, so it requires 256*256kB = 64MB of total used memory.
My MacOS has 16GB RAM and 8 cores, so it seems to be weird.
For a number of process lower than 256 (I tried : np=2,4,8,16,32,64,128), there is no problem, execution is good and I get expected results.
But for np = 256
, I get the following message which repeats itself:
$ mpirun -np 256 ./a.out
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
...
I tried also to use -mca
option by doing:
$ mpirun -mca opal_set_max_sys_limits 1 -np 256 ./a.out
But I get the same warning message.
From this link cited above, I did:
$ launchctl limit maxfiles
maxfiles 65536 200000
Then, in root user, I created /etc/launchd.conf
file and put into:
limit maxfiles 65536 200000
I restarted the system for the new limits to take effect and type as normal user:
$ launchctl limit maxfiles
maxfiles 65536 200000
But unfortunately, these modifications have no effects on the MPI function "mpirun" with 256 processes and don't make disappear the warning above.
On Linux platform, I can launch my MPI code with np = 256
, without problem, the issue is only happening on MacOS 10.9.5.
Update 1
I have also tried to use "--oversubscribe
" option like:
mpirun -np 256 --oversubscribe ./a.out
but get still the same message : [warn] select: Invalid argument
Update 2
I have upgraded to OS X 10.13.3 High Sierra but still have no luck with my issue.
To increase the limit of open files, from this link I did:
sudo vim /Library/LaunchDaemons/limit.maxfiles.plist
put into this file:
Label limit.maxfiles ProgramArguments launchctl limit maxfiles 64000 524288 RunAtLoad ServiceIPCsudo launchctl load -w /Library/LaunchDaemons/limit.maxfiles.plist
Checking by:
$ sysctl kern.maxfiles
kern.maxfiles: 524288
and:
$ launchctl limit maxfiles
maxfiles 64000 524288
When I launch ring_c.c (example from Open-MPI) executable with:
mpirun --oversubscribe -np $NB_PROCESS ./a.out
For a number of processes lower or equal to 142
, it's running fine.
For a number of processes greater than 142
, I get the original warning message:
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
[warn] select: Invalid argument
...
Why the limit is reached at NB_PROCESS > 142
? what does it correspond to? I didn't see this limit anywhere.