71
Rendering in the Cloud / GCP Preemptible VMs now up to 33% cheaper
« Last post by Render Guru on August 10, 2016, 04:33:46 AM »We
This is an excellent tip.
For what it's worth, there also exists +host.processor_speed and +host.processors.avail. You can combine them in a host_order like so:
+host.processors.avail,+host.processor_speed
... which would mean, "Choose the machines with the fastest processors AND the most number of currently available processors (e.g. those processors not reserved by other jobs)".
Having said that, Alexander's suggestion is also perfectly valid and some may prefer it, as it is somewhat more concrete than the multi-key host order I've suggested, which is a bit too "black-box" for some.
Thanks for the tip, Alexander!
import multiprocessing, cpuinfo, decimal, socket
host = socket.gethostname()
info = cpuinfo.get_cpu_info()
speed = info['hz_actual']
speed = speed[:-4]
speed = float(speed)
amount = multiprocessing.cpu_count()
rank = amount * speed
rank = decimal.Decimal(str(rank))
rank = int(round(rank,0))
line = host + ' ' + str(rank)
f = open('\\\\SERVER\\\\qube\\ranking\\ranking.log','a')
f.write(line + '\n')
f.close()