Questions tagged [affinity]

Anything related to processor affinity, also known as CPU pinning. The processor affinity is a propriety of a process or a thread in an OS on multi-processor or multi-core systems that influences the OS' scheduling algorithm, binding the execution of that process (or thread) to a specific processor (or core). DO NOT use this tag as a synonym for [affinetransform] tag.

330 questions
0
votes
2 answers

[k8s]I try to assign one pod to the normal node, and the others onto a spot node by using podAntiAffinity

I have 6 nodes,all of them have labels "group:emp",4 of them have labels "iKind:spot",2 of them have labels "ikind:normal". I use the deployment yaml to assign one pod to the normal node and others on the spot node, but it didn't work. I start to…
scut_yk
  • 11
  • 3
0
votes
1 answer

kubernetes affinity & anti-affinity

I have some little confusion. Please clarify. In kubernetes we have concept called affinity and anti-affinity. affinity provided two types 1: node affinity 2: pod-affinity I want to know what are types are provided by anti-affinity? I am thinking…
kaka
  • 1
  • 1
  • 1
  • 4
0
votes
1 answer

Is it a good practice (feasible) to combine both nodeAfinity and podAffinity rules when assigning Pods to Nodes on kubernetes

Is it a good practice (feasible) to combine both nodeAfinity and podAffinity rules when assigning Pods to Nodes on kubernetes. Example : apiVersion: v1 kind: Pod metadata: name: node-and-pod-affinity-combined spec: affinity: nodeAffinity: …
DT.
  • 3,351
  • 2
  • 18
  • 32
0
votes
1 answer

Does a processor affinity set by SetThreadAffinityMask also apply to children threads?

I have an application that makes use of many threads, one of them being more time critical than the others. I have already tried using priority, but have found that Windows doesn't always honor the priority to the extent I would like and sometimes…
KyleL
  • 1,379
  • 2
  • 13
  • 35
0
votes
2 answers

Problems configuring Ingress with cookie affinity

I was looking for how to use cookie affinity in GKE, using Ingress for that. I've found the following link to do it: https://cloud.google.com/kubernetes-engine/docs/how-to/configure-backend-service I've created a yaml with the…
0
votes
0 answers

What is an example of violating class affinity?

The page on UICollectionClass (from the Microsoft WPF libraries) has the following note: A UIElementCollection has affinity to its own context (class). You must access the collection from the context of the owning Panel. What is an example of an…
Sabuncu
  • 5,095
  • 5
  • 55
  • 89
0
votes
0 answers

Why is Python's Laplacian method different from Research Paper?

I found a Python library for Laplacian Score Feature Selection. But the implementation is seemingly different from the research paper. I implemented the selection method according to the algorithm from the paper…
0
votes
1 answer

Set threads affinity on OpenCV

I have a CPU-intensive code (it uses Semi-Global Stereo Matching) that runs multicore, since I've enabled WITH_OPENMP flag when compiling OpenCV for Visual Studio 2013 x64. However, this code runs on all of my 8 logical cores (I have a 4-cores CPU…
TheUnexpected
  • 3,077
  • 6
  • 32
  • 62
0
votes
1 answer

sklearn python affinity propagation - is there a method to calculate error in clusters?

In looking at the docs for sklearn.cluster and Affinity Propagation I don't see anything that would calculate error in a cluster. Does this exist or is this something I have to write on my own? Update: Let me propose a possible idea: With Affinity…
DaveK
  • 544
  • 1
  • 6
  • 16
0
votes
2 answers

How to set the Linux init process affinity without using grub?

Our application may run on a variety of architectures all on a ramfs machine. It needs to set core isolation and affinity for extremely fast processing. Depending on the architecture, it may need to be pinned to a hyperthread on numa 0 or numa 1. We…
howling cat
  • 41
  • 1
  • 9
0
votes
1 answer

Android background process affinity can't be modified through native code

The following piece of Android code only produces native threads running on the same CPU core. FaceEngineWrapper.Run() is a JNI wrapper for a face detect inference engine and spawns quite a lot native threads (through both std::thread and openmp in…
0
votes
1 answer

how to interpret the smp_affinity output

My lscpu output is: I have only one entry in /proc/interrupts for my NIC: smp_affinity for my NIC eth0 is: Since I have only 8 CPUs, I expected the smp_affinity value to have 8 bits, each bit for one CPU core, but I have 32 bits. How do I…
user2761431
  • 925
  • 2
  • 11
  • 26
0
votes
1 answer

Changing the affinity of a Console C# program

In this page, the following code is an example for changing the affinity of the current process: using System; using System.Diagnostics; class Program { static void Main() { Process myProcess = Process.GetCurrentProcess(); …
user5540335
0
votes
1 answer

Pinning a large number of threads to a single CPU causes utilization spike on all cores

I've written a little test program that spawns a large number of threads (in my case 32 threads on a computer with 4 cores) and pins them all to one core with the pthread_setaffinity_np syscall. These threads run in a loop in which they report the…
Oliver
  • 353
  • 1
  • 2
  • 11
0
votes
2 answers

set two threads to the same cpu affinity pthread_getaffinity_np

cpu_set_t cpuset; CPU_ZERO(&cpuset); std::cout << "current cpu: " << sched_getcpu() << std::endl; CPU_SET(sched_getcpu(), &cpuset); if (pthread_setaffinity_np(std_thread.getNativeHandle(), sizeof(cpu_set_t), &cpuset) == 0) { …
user470739