A program to recognize and reward our most engaged community members
Hi,
Is there a way to find using Compose in Linux-
1. How many CPUs are available on the current machine, and
2. How many CPUs are currently free?
Thanks, Deb
Hi Debdatta Sen,
By using python in Compose, you can use the following lines of code for finding the number of CPUs
import multiprocessing x = multiprocessing.cpu_count()
Hi Debdatta,
you can use 'System' or 'Unix' command in OML which executes Shell command string....
I haven't used Linux for a while now, you can use shell commands like 'Top', '/proc/cpuinfo', to get CPU utilization.
I didn't tried these commands in Linux now as i don't have Linux machine: you can give it a try
system('top -b -n 1 |grep ^Cpu')
system('/proc/cpuinfo')
You can find many other useful linux shell commands online which can be used along with 'system' or 'unix' commands of COMPOSE OML.
Hope this helps.
Thanks,
Manoj Kandukuri