comparison vsnp_get_snps.py @ 2:6fdfdee72f8a draft

"planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/vsnp commit 10077c740e7cbe6a6563a1c632d711691753e46d"
author iuc
date Mon, 06 Dec 2021 18:28:42 +0000
parents 9ac0b1d5560d
children 4535ad8b74f3
comparison
equal deleted inserted replaced
1:9ac0b1d5560d 2:6fdfdee72f8a
20 def get_time_stamp(): 20 def get_time_stamp():
21 return datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H-%M-%S') 21 return datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H-%M-%S')
22 22
23 23
24 def set_num_cpus(num_files, processes): 24 def set_num_cpus(num_files, processes):
25 num_cpus = int(multiprocessing.cpu_count()) 25 num_cpus = len(os.sched_getaffinity(0))
26 if num_files < num_cpus and num_files < processes: 26 if num_files < num_cpus and num_files < processes:
27 return num_files 27 return num_files
28 if num_cpus < processes: 28 if num_cpus < processes:
29 half_cpus = int(num_cpus / 2) 29 half_cpus = int(num_cpus / 2)
30 if num_files < half_cpus: 30 if num_files < half_cpus: