8 gatk2_install_path = None
11 global gatk2_install_path
12 if gatk2_install_path:
13 return gatk2_install_path
14 gatk2_install_path = arvados.util.tarball_extract(
15 tarball = arvados.current_job()['script_parameters']['gatk_tbz'],
17 return gatk2_install_path
20 taskspernode = int(os.environ.get('CRUNCH_NODE_SLOTS', '1'))
21 with open('/proc/meminfo', 'r') as f:
22 ram = int(re.search(r'MemTotal:\s*(\d+)', f.read()).group(1)) / 1024
24 ram = ram / taskspernode
25 return max(ram-700, 500)
27 def cpus_on_this_node():
28 with open('/proc/cpuinfo', 'r') as cpuinfo:
29 return max(int(os.environ.get('SLURM_CPUS_ON_NODE', 1)),
30 len(re.findall(r'^processor\s*:\s*\d',
35 return max(1, (cpus_on_this_node()
36 / int(os.environ.get('CRUNCH_NODE_SLOTS', 1))))
39 kwargs.setdefault('cwd', arvados.current_task().tmpdir)
40 kwargs.setdefault('stdout', sys.stderr)
42 '-Xmx%dm' % memory_limit(),
43 '-Djava.io.tmpdir=' + arvados.current_task().tmpdir,
44 '-jar', os.path.join(install_path(), 'GenomeAnalysisTK.jar')]
45 execargs += [str(arg) for arg in kwargs.pop('args', [])]
46 sys.stderr.write("%s.run: exec %s\n" % (__name__, str(execargs)))
47 return arvados.util.run_command(execargs, **kwargs)