Check for all the RLIMIT_foo constants that we use, and update the limit checks to use the new #define values. Fix a bug where failure of some might lead to incorrect bracketing.
Refs trac:4010 This commit was SVN r30009. The following Trac tickets were found above: Ticket 4010 --> https://svn.open-mpi.org/trac/ompi/ticket/4010
Этот коммит содержится в:
родитель
4739850931
Коммит
6e6351959d
40
configure.ac
40
configure.ac
@ -1053,6 +1053,46 @@ AC_INCLUDES_DEFAULT
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#endif])
|
#endif])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do we have RLIMIT_NOFILE in <sys/resources.h>? (e.g., Solaris does not)
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([RLIMIT_NOFILE], [], [], [
|
||||||
|
AC_INCLUDES_DEFAULT
|
||||||
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do we have RLIMIT_MEMLOCK in <sys/resources.h>? (e.g., Solaris does not)
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([RLIMIT_FSIZE], [], [], [
|
||||||
|
AC_INCLUDES_DEFAULT
|
||||||
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do we have RLIMIT_CORE in <sys/resources.h>? (e.g., Solaris does not)
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([RLIMIT_CORE], [], [], [
|
||||||
|
AC_INCLUDES_DEFAULT
|
||||||
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Do we have RLIMIT_STACK in <sys/resources.h>? (e.g., Solaris does not)
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_CHECK_DECLS([RLIMIT_STACK], [], [], [
|
||||||
|
AC_INCLUDES_DEFAULT
|
||||||
|
#if HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif])
|
||||||
|
|
||||||
# checkpoint results
|
# checkpoint results
|
||||||
AC_CACHE_SAVE
|
AC_CACHE_SAVE
|
||||||
|
|
||||||
|
@ -130,8 +130,8 @@ int opal_util_init_sys_limits(char **errmsg)
|
|||||||
* that we set the limits on #files, #children,
|
* that we set the limits on #files, #children,
|
||||||
* and max file size
|
* and max file size
|
||||||
*/
|
*/
|
||||||
#ifdef RLIMIT_NOFILE
|
|
||||||
if (0 == strcmp(lim[0], "1")) {
|
if (0 == strcmp(lim[0], "1")) {
|
||||||
|
#ifdef HAVE_DECL_RLIMIT_NOFILE
|
||||||
if (OPAL_SUCCESS !=
|
if (OPAL_SUCCESS !=
|
||||||
opal_setlimit(RLIMIT_NOFILE, "max", &value)) {
|
opal_setlimit(RLIMIT_NOFILE, "max", &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", "max");
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", "max");
|
||||||
@ -146,30 +146,30 @@ int opal_util_init_sys_limits(char **errmsg)
|
|||||||
}
|
}
|
||||||
opal_sys_limits.num_procs = value;
|
opal_sys_limits.num_procs = value;
|
||||||
#endif
|
#endif
|
||||||
#ifdef RLIMIT_FSIZE
|
#ifdef HAVE_DECL_RLIMIT_FSIZE
|
||||||
if (OPAL_SUCCESS !=
|
if (OPAL_SUCCESS !=
|
||||||
opal_setlimit(RLIMIT_FSIZE, "max", &value)) {
|
opal_setlimit(RLIMIT_FSIZE, "max", &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "filesize", "max");
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "filesize", "max");
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
}
|
}
|
||||||
opal_sys_limits.file_size = value;
|
opal_sys_limits.file_size = value;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
} else if (0 == strcmp(lim[0], "0")) {
|
} else if (0 == strcmp(lim[0], "0")) {
|
||||||
/* user didn't want anything set */
|
/* user didn't want anything set */
|
||||||
goto cleanup;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* process them separately */
|
/* process them separately */
|
||||||
if (0 == strcmp(lim[0], "core")) {
|
if (0 == strcmp(lim[0], "core")) {
|
||||||
#ifdef RLIMIT_CORE
|
#ifdef HAVE_DECL_RLIMIT_CORE
|
||||||
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_CORE, setlim, &value)) {
|
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_CORE, setlim, &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", setlim);
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", setlim);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if (0 == strcmp(lim[0], "filesize")) {
|
} else if (0 == strcmp(lim[0], "filesize")) {
|
||||||
#ifdef RLIMIT_FSIZE
|
#ifdef HAVE_DECL_RLIMIT_FSIZE
|
||||||
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_FSIZE, setlim, &value)) {
|
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_FSIZE, setlim, &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "filesize", setlim);
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "filesize", setlim);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
@ -177,14 +177,14 @@ int opal_util_init_sys_limits(char **errmsg)
|
|||||||
opal_sys_limits.file_size = value;
|
opal_sys_limits.file_size = value;
|
||||||
#endif
|
#endif
|
||||||
} else if (0 == strcmp(lim[0], "maxmem")) {
|
} else if (0 == strcmp(lim[0], "maxmem")) {
|
||||||
#ifdef RLIMIT_AS
|
#ifdef HAVE_DECL_RLIMIT_AS
|
||||||
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_AS, setlim, &value)) {
|
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_AS, setlim, &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "maxmem", setlim);
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "maxmem", setlim);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
} else if (0 == strcmp(lim[0], "openfiles")) {
|
} else if (0 == strcmp(lim[0], "openfiles")) {
|
||||||
#ifdef RLIMIT_NOFILE
|
#ifdef HAVE_DECL_RLIMIT_NOFILE
|
||||||
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_NOFILE, setlim, &value)) {
|
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_NOFILE, setlim, &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", setlim);
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "openfiles", setlim);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
@ -192,7 +192,7 @@ int opal_util_init_sys_limits(char **errmsg)
|
|||||||
opal_sys_limits.num_files = value;
|
opal_sys_limits.num_files = value;
|
||||||
#endif
|
#endif
|
||||||
} else if (0 == strcmp(lim[0], "stacksize")) {
|
} else if (0 == strcmp(lim[0], "stacksize")) {
|
||||||
#ifdef RLIMIT_STACK
|
#ifdef HAVE_DECL_RLIMIT_STACK
|
||||||
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_STACK, setlim, &value)) {
|
if (OPAL_SUCCESS != opal_setlimit(RLIMIT_STACK, setlim, &value)) {
|
||||||
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "stacksize", setlim);
|
*errmsg = opal_show_help_string("help-opal-util.txt", "sys-limit-failed", true, "stacksize", setlim);
|
||||||
return OPAL_ERROR;
|
return OPAL_ERROR;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user