Skip to main content

Benchmark functions that returns total space, mem, cpu given input size and parameters for the CWL workflows

Project description

The repo contains a benchmarking script for some of the CWL workflows used by 4DN-DCIC (https://github.com/4dn-dcic/pipelines-cwl), that returns total space, mem and CPUs required per given input size and a recommended AWS EC2 instance type.

Example usage of benchmarking script

  • importing the module
from Benchmark import run as B
  • md5
app_name = 'md5'
input_json = {'input_size_in_bytes': {'input_file': 20000}}
B.benchmark(app_name, input_json)
{'aws': {'recommended_instance_type': 't2.xlarge', 'EBS_optimized': False, 'cost_in_usd': 0.188, 'EBS_optimization_surcharge': None, 'mem_in_gb': 16.0, 'cpu': 4}, 'total_size_in_GB': 14.855186462402344, 'total_mem_in_MB': 13142.84375, 'min_CPU': 4}
  • fastqc-0-11-4-1
app_name = 'fastqc-0-11-4-1'
input_json = {'input_size_in_bytes': {'input_fastq':20000},
              'parameters': {'threads': 2}}
B.benchmark(app_name, input_json)
{'recommended_instance_type': 't2.nano', 'EBS_optimized': False, 'cost_in_usd': 0.006, 'EBS_optimization_surcharge': None, 'mem_in_gb': 0.5, 'cpu': 1}
  • bwa-mem
app_name = 'bwa-mem'
input_json = {'input_size_in_bytes': {'fastq1':93520000,
                                      'fastq2':97604000,
                                      'bwa_index':3364568000},
              'parameters': {'nThreads': 4}}
B.benchmark(app_name, input_json)
{'aws': {'cost_in_usd': 0.188, 'EBS_optimization_surcharge': None, 'EBS_optimized': False, 'cpu': 4, 'mem_in_gb': 16.0, 'recommended_instance_type': 't2.xlarge'}, 'total_mem_in_MB': 12834.808349609375, 'total_size_in_GB': 15.502477258443832, 'min_CPU': 4}

To use Benchmark in from other places, install it as below.

pip install Benchmark-4dn

or

pip install git+git://github.com/SooLee/Benchmark.git

Note: From 0.5.3 we have a new function that takes in cpu and memory and returns a sorted list of instance dictionaries.

get_instance_types(cpu=1, mem_in_gb=0.5, instances=instance_list(), top=10, rank='cost_in_usd')

Keys in each instance dictionary:

'cost_in_usd', 'mem_in_gb', 'cpu', 'instance_type', 'EBS_optimized', 'EBS_optimization_surcharge'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benchmark_4dn-0.5.26.tar.gz (31.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benchmark_4dn-0.5.26-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file benchmark_4dn-0.5.26.tar.gz.

File metadata

  • Download URL: benchmark_4dn-0.5.26.tar.gz
  • Upload date:
  • Size: 31.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.2 Darwin/23.6.0

File hashes

Hashes for benchmark_4dn-0.5.26.tar.gz
Algorithm Hash digest
SHA256 15d47d988fd6fe1a5c6487272d5c4fade052d8357a5d63b46434f1fdda28f6bb
MD5 0db0f26356daf9a90accc3b3e4c3c662
BLAKE2b-256 0c9e26a2259a156d9122f648ab8dee08e009028ffa4d35ff294dbc4d9546caaa

See more details on using hashes here.

File details

Details for the file benchmark_4dn-0.5.26-py3-none-any.whl.

File metadata

  • Download URL: benchmark_4dn-0.5.26-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.7.2 Darwin/23.6.0

File hashes

Hashes for benchmark_4dn-0.5.26-py3-none-any.whl
Algorithm Hash digest
SHA256 69c42b877d438f5c2fc7df072f19efd540e751f32f884a14a2221f44198367bd
MD5 53bd13420ef7e6ff255db7457b1cb6c0
BLAKE2b-256 4d9ef6fa3e135daec07071dc24fe8b5e0454aa00c7216c888cbc2af751397385

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page