octave-bug-tracker
[Top][All Lists]
Advanced

[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/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]