Add in rlimits_maximize_nofiles() to workaround setrlimit() restrictions on macOS.
Rather than repeat the #ifdef block through five locations, use a common function to handle this and print a consistent error message if there is an issue. From getrlimit(2): setrlimit() now returns with errno set to EINVAL in places that historically succeeded. It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE. Use "rlim_cur = min(OPEN_MAX, rlim_max)". (This was causing spurious error messages to appear for sbatch/srun.)
Please register or sign in to comment