We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 16648de commit 8e094fbCopy full SHA for 8e094fb
+stdlib/+sys/cpu_count.m
@@ -0,0 +1,10 @@
1
+function N = cpu_count
2
+%CPU_COUNT how many CPUs
3
+N = maxNumCompThreads;
4
+if N < 2 % happens on some HPC
5
+ N = feature('NumCores');
6
+end
7
+
8
+% logical CPUs
9
+% N=java.lang.Runtime.getRuntime().availableProcessors();
10
test/TestSys.m
@@ -53,7 +53,13 @@ function test_ram(tc)
53
54
end
55
56
-function test_cpu(tc)
+function test_cpu_count(tc)
57
58
+tc.verifyGreaterThan(stdlib.sys.cpu_count(), 0)
59
60
61
62
+function test_cpu_load(tc)
63
64
tc.verifyGreaterThanOrEqual(stdlib.sys.cpu_load(), 0)
65
0 commit comments