Skip to content
Snippets Groups Projects
Commit 6b115c15 authored by Moe Jette's avatar Moe Jette
Browse files

Add logic to get node's real memory size on AIX.

Add LDFLAGS required on AIX to use dlopen().
parent e3fae00f
No related branches found
No related tags found
No related merge requests found
...@@ -3,6 +3,7 @@ documents those changes that are of interest to users and admins. ...@@ -3,6 +3,7 @@ documents those changes that are of interest to users and admins.
* Changes in SLURM 0.3.0.0-pre7 (not tagged yet) * Changes in SLURM 0.3.0.0-pre7 (not tagged yet)
=============================== ===============================
-- Add support for getting node's real memory size on AIX
* Changes in SLURM 0.3.0.0-pre6 * Changes in SLURM 0.3.0.0-pre6
=============================== ===============================
......
...@@ -41,13 +41,21 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \ ...@@ -41,13 +41,21 @@ AC_CHECK_HEADERS(mcheck.h values.h socket.h sys/socket.h \
stdbool.h sys/ipc.h sys/shm.h sys/sem.h errno.h \ stdbool.h sys/ipc.h sys/shm.h sys/sem.h errno.h \
stdlib.h dirent.h pthread.h sys/prctl.h \ stdlib.h dirent.h pthread.h sys/prctl.h \
sysint.h inttypes.h termcap.h netdb.h sys/socket.h \ sysint.h inttypes.h termcap.h netdb.h sys/socket.h \
sys/systemcfg.h \
) )
AC_HEADER_SYS_WAIT AC_HEADER_SYS_WAIT
AC_HEADER_TIME AC_HEADER_TIME
AC_HEADER_STDC AC_HEADER_STDC
dnl Checks for structures. dnl Checks for structures.
dnl dnl
AC_TRY_COMPILE([#include <sys/systemcfg.h>],
[double x = _system_configuration.physmem;],
[AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
[Define to 1 if you have the external variable,
_system_configuration with a member named physmem.])])
dnl check to see if glibc's program_invocation_short_name is available: dnl check to see if glibc's program_invocation_short_name is available:
dnl dnl
...@@ -92,6 +100,10 @@ LDFLAGS="$LDFLAGS " ...@@ -92,6 +100,10 @@ LDFLAGS="$LDFLAGS "
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
case "$host" in
*-*-aix*) LDFLAGS="$LDFLAGS -Wl,-brtl -Wl,-bexpall " ;;
esac
AC_SLURM_SEMAPHORE AC_SLURM_SEMAPHORE
dnl checks for system services. dnl checks for system services.
......
...@@ -33,6 +33,10 @@ ...@@ -33,6 +33,10 @@
# include "config.h" # include "config.h"
#endif #endif
#ifdef HAVE_SYS_SYSTEMCFG_H
# include <sys/systemcfg.h>
#endif
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <stdio.h> #include <stdio.h>
...@@ -168,12 +172,16 @@ get_memory(uint32_t *real_memory) ...@@ -168,12 +172,16 @@ get_memory(uint32_t *real_memory)
*real_memory = 1; *real_memory = 1;
pages = sysconf(_SC_PHYS_PAGES); pages = sysconf(_SC_PHYS_PAGES);
#ifdef HAVE__SYSTEM_CONFIGURATION
/* Works for AIX */
if (pages < 1) {
*real_memory = _system_configuration.physmem / (1024 * 1024);
return 0;
}
#endif
if (pages < 1) { if (pages < 1) {
/* This error is expected on AIX and the real memory size is
* available only from /dev/kmem at this time, which involves
* a fair bit of code to use. If anyone is interested in
* adding this support, take a look at the program "monitor":
* http://www.mesa.nl/monitor */
error ("get_memory: error running sysconf(_SC_PHYS_PAGES)\n"); error ("get_memory: error running sysconf(_SC_PHYS_PAGES)\n");
return EINVAL; return EINVAL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment