[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #55643] Missing some of my processor cores (np
From: |
Oliver Mössinger |
Subject: |
[Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc) |
Date: |
Tue, 5 Feb 2019 03:41:06 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.81 Safari/537.36 |
Follow-up Comment #7, bug #55643 (project octave):
Workaround:
local address@hidden:~> cat /tmp/testoctave.sh
#!/bin/sh
TEMPDIR=$(mktemp -d)
[ -z "$TEMPDIR" ] && exit 1
trap "rm -fr $TEMPDIR" EXIT
cat > "$TEMPDIR/disable_sched_setaffinity.c" <<'EOF' || exit 1
#include <stdio.h>
#include <sched.h>
int sched_setaffinity(pid_t pid, size_t cpusetsize,
cpu_set_t *mask)
{
printf("(ignore: sched_setaffinity(pid=%d, cpusetsize=%zu, mask=%p) ->
return success(0))\n", pid, cpusetsize, mask);
return 0;
}
EOF
gcc -fPIC -O0 -ldl -shared "$TEMPDIR/disable_sched_setaffinity.c" -o
"$TEMPDIR/disable_sched_setaffinity.so" || exit 1
LD_PRELOAD="$TEMPDIR/disable_sched_setaffinity.so:$LD_PRELOAD" "$@"
rm -rf "$TEMPDIR"
local address@hidden:~> /tmp/testoctave.sh octave --eval 'nproc'
(ignore: sched_setaffinity(pid=0, cpusetsize=128, mask=0x7ffd0a2807d0) ->
return success(0))
(ignore: sched_setaffinity(pid=0, cpusetsize=128, mask=0x7fd2d7f5dae0) ->
return success(0))
(ignore: sched_setaffinity(pid=0, cpusetsize=128, mask=0x7fd2d775cae0) ->
return success(0))
(ignore: sched_setaffinity(pid=0, cpusetsize=128, mask=0x7fd2d6f5bae0) ->
return success(0))
ans = 8
This code deactivates the syscall sched_setaffinity() and this fixes the
processor count.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?55643>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Oliver Mössinger, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Kai Torben Ohlhus, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Markus Mützel, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Guillaume, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), John W. Eaton, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Mike Miller, 2019/02/04
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc), Oliver Mössinger, 2019/02/05
- [Octave-bug-tracker] [bug #55643] Missing some of my processor cores (nproc),
Oliver Mössinger <=
- [Octave-bug-tracker] [bug #55643] Function "nproc" just reports the environment variable OMP_NUM_THREADS not the "current number of available processors"., Kai Torben Ohlhus, 2019/02/05
- [Octave-bug-tracker] [bug #55643] Function "nproc" just reports the environment variable OMP_NUM_THREADS not the "current number of available processors"., Kai Torben Ohlhus, 2019/02/05
- [Octave-bug-tracker] [bug #55643] Function "nproc" just reports the environment variable OMP_NUM_THREADS not the "current number of available processors"., Mike Miller, 2019/02/05
- [Octave-bug-tracker] [bug #55643] nproc reports fewer available cores on OpenSUSE (via sched_setaffinity), Mike Miller, 2019/02/05
- [Octave-bug-tracker] [bug #55643] nproc reports fewer available cores on OpenSUSE (via sched_setaffinity), Mike Miller, 2019/02/25