How to choose a group when setting affinity to a process for multi-processor system
Show older comments
I have a windows machine with 2 processors 64 cores each. Before with one processor I was able to use the code below. Now I have two processor groups and didn't find any info how to manipulate it.
For example, Process_1 - group 0 CPU 23-63 or Process_2 - group 1 CPU 1-63. Also, Is it possible to set both groups to one process?
Process_1 = System.Diagnostics.Process.GetProcessById(my_process_ID);
aff = Process_1.ProcessorAffinity.ToInt32; % get current affinity mask
fprintf('Current affinity mask: %s\n', dec2bin(aff, 36));
proc.ProcessorAffinity = System.IntPtr(int32(2)); % set affinity mask
fprintf('Adjusted affinity to: %s\n', dec2bin(proc.ProcessorAffinity.ToInt32, 36));
Accepted Answer
More Answers (0)
Categories
Find more on Deploy to .NET Applications Using MATLAB Data API for .NET in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!