#endif
#endif
+
+
static inline int my_mbind(void *addr, unsigned long len, int mode,
unsigned long *nodemask, unsigned long maxnode,
unsigned flags) {
+#if defined (__LSB_VERSION__)
+// So far, LSB (Linux Standard Base) don't support syscall().
+// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
+ return 0;
+#else
#if defined (LOONGSON3B)
#if defined (__64BIT__)
return syscall(SYS_mbind, addr, len, mode, nodemask, maxnode, flags);
// unsigned long null_nodemask=0;
return syscall(SYS_mbind, addr, len, mode, nodemask, maxnode, flags);
#endif
+#endif
}
static inline int my_set_mempolicy(int mode, const unsigned long *addr, unsigned long flag) {
-
+#if defined (__LSB_VERSION__)
+// So far, LSB (Linux Standard Base) don't support syscall().
+// https://lsbbugs.linuxfoundation.org/show_bug.cgi?id=3482
+ return 0;
+#else
return syscall(SYS_set_mempolicy, mode, addr, flag);
+#endif
}
static inline int my_gettid(void) {
#include <sched.h>
#include <dirent.h>
#include <dlfcn.h>
+#include <unistd.h>
#define MAX_NODES 16
#define MAX_CPUS 256
fprintf(stderr, "Shared Memory Initialization.\n");
#endif
- common -> num_procs = get_nprocs();
+ //returns the number of processors which are currently online
+ common -> num_procs = sysconf(_SC_NPROCESSORS_ONLN);;
if(common -> num_procs > MAX_CPUS) {
fprintf(stderr, "\nOpenBLAS Warining : The number of CPU/Cores(%d) is beyond the limit(%d). Terminated.\n", common->num_procs, MAX_CPUS);