qmap

A tool to run a collection of similar jobs quickly and easily in parallel. It can run standalone or using different HPC schedulers (Slurm, Sun Grid Engine...)

https://github.com/bbglab/qmap

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.2%) to scientific vocabulary
Last synced: 11 months ago · JSON representation

Repository

A tool to run a collection of similar jobs quickly and easily in parallel. It can run standalone or using different HPC schedulers (Slurm, Sun Grid Engine...)

Basic Info
  • Host: GitHub
  • Owner: bbglab
  • License: other
  • Language: Python
  • Default Branch: master
  • Size: 92.8 KB
Statistics
  • Stars: 0
  • Watchers: 13
  • Forks: 0
  • Open Issues: 1
  • Releases: 0
Created over 7 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.rst

QMap
====

**QMap** is a tool aimed to run a collection of similar jobs quickly and
easily in parallel.
It can run standalone or using different HPC schedulers (Slurm, Sun Grid
Engine and LFS).

**QMap** contains 5 different tools:

- *run*: execute commands with extended resources
- *template*: create a jobs map file
- *submit*: submit jobs from a map file
- *reattach*: reattach to a previous QMap execution
- *info*: explore the metadata of your jobs


.. warning:: **QMap** makes use of the shell using the *subprocess* module
   of the Python standard library. The shell is invoked making use of
   ``shell=True`` which can lead to shell injections vulnerabilities.
   More details in https://docs.python.org/3/library/subprocess.html#security-considerations


Documentation in: https://qmap.readthedocs.io/en/latest/

Tools
-----

**qmap run**
   Execute a command with more resources maintaining your working environment

   .. code:: bash

      qmap run -m  -c   ""

**qmap template**
   Create a `jobs map file`_ that works with **qmap submit**.

   .. code:: bash

      qmap template "" -f 

   The file created uses the current loaded Easy Build modules
   and the current conda environment as jobs pre-commands [#precmd]_
   if not explicitly provided.

   The job commands are all the combinations that result of the expansion of:

   :{{list,of,items}}: comma separated list of items
   :{{file}}: all lines in file
   :`*`, ?, [x-y]: wildcards in Python's glob module

   Wildcards of the format ``{{...}}`` are expanded in a first phase
   and glob wildcards are expanded later on.

   As additional feature, any of the above mentioned groups can be named
   ``{{?:...}}`` and replaced anywhere using ``{{?=}}``.

   .. note::

      To name glob wildcards they should be solely in the group.
      E.g. ``{{?myfiles:*}}``


**qmap submit**
   Execute all jobs from a `jobs map file`_

   .. code:: bash

      qmap submit -m  -c    --logs  --max-running <#>

   ``qmap submit`` has been implemented to submit a set of jobs to a cluster for execution
   and control them.
   It acts as a layer between the workload manager and the user preventing she/he
   from submitting a huge number of jobs at once (potentially blocking future users).
   The number of jobs that can be submitted to the workload manager is controlled by the
   *--max-running* flag.

   .. warning::

      If ``qmap submit`` is closed, jobs that have not been submitted to the
      workload manager will never be.
      Thus, it is recommended to run it inside a **screen**.

   In addition, in the folder indicated to store the logs with the *--logs* flag
   the user can find important information about each job execution as well as
   the logs from STDOUT and STDERR.

   Another feature of this tool is the possibility to group your jobs with the *--grouping*
   option. This option uses the value passed as the number of commands that fit in each job.
   Thus, several commands can be executed as part of the same job, one after another.
   This option can be interesting for "small" jobs as they use the same allocation.
   If any of the commands fail, the associated job will fail.

   Finally, any job command can include several values that
   are substituted before execution. Those values represent the job parameters
   and additionally, a unique identifier for each job.

   :${QMAP_LINE}: identifier of the line the job command has in the input file
   :${QMAP_CORES}: cores for the execution




**qmap reattach**
   Once a ``qmap submit`` execution is closed, you can
   reconnect from its logs directory

   .. code:: bash

      qmap reattach --logs 

   .. note::

      If in the previous execution there were jobs that have not been submitted to the workload manager
      ``qmap reattach`` can submit them, but the execution is halted except for the ``no-console`` interface.


**qmap info**
   ``qmap submit`` generates a file for each job with metadata information.
   ``qmap info`` is designed to explore them and retrieve the
   requested data. Information is stored in json format and
   the user can request any fields:

   .. code:: bash

      qmap info --logs   . ...

   In addition, the *--status* option can be used to filter the jobs
   by their status (completed|failed|other|pending|running|unsubmitted|all).

   If you do not pass any field, then the return value
   is the input commands of the jobs.
   This feature can be used to generate a new jobs file a subset of the original one.



.. _jobs map file:

Jobs map file
-------------

This file contains a list of the commands to be executed as well as
commands to be executed before and after each job (e.g. loading Easy Build modules or conda environments).
The format of the file is::

  [pre]
  # command to be executed before any job

  [post]
  # command to be executed after any job

  [params]
  # parameters for all the jobs
  cores = 7
  memory = 16G

  [jobs]
  job command
  job command


Installation
------------

**QMap** depends on Python >3.5 and some external libraries.

You can install it directly from our github repository::

    pip install git+https://github.com/bbglab/qmap.git


License
-------

`Apache Software License 2.0 `_.


.. [#precmd] Commands executed before any actual job

Owner

  • Name: BBGLab - Barcelona Biomedical Genomics Lab
  • Login: bbglab
  • Kind: organization
  • Email: bbglab@irbbarcelona.org
  • Location: Barcelona

GitHub Events

Total
  • Release event: 1
  • Delete event: 1
  • Issue comment event: 3
  • Member event: 1
  • Push event: 5
  • Pull request event: 1
  • Pull request review comment event: 1
  • Pull request review event: 2
  • Create event: 1
Last Year
  • Release event: 1
  • Delete event: 1
  • Issue comment event: 3
  • Member event: 1
  • Push event: 5
  • Pull request event: 1
  • Pull request review comment event: 1
  • Pull request review event: 2
  • Create event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 26
  • Total Committers: 2
  • Avg Commits per committer: 13.0
  • Development Distribution Score (DDS): 0.038
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
I. Reyes i****s 25
Carlos López Elorduy 1****y 1

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 3
  • Total pull requests: 3
  • Average time to close issues: 4 days
  • Average time to close pull requests: 6 days
  • Total issue authors: 3
  • Total pull request authors: 2
  • Average comments per issue: 1.33
  • Average comments per pull request: 0.33
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: 7 days
  • Average time to close pull requests: 7 days
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • dmartmillan (1)
  • FedericaBrando (1)
  • migrau (1)
Pull Request Authors
  • FedericaBrando (2)
  • CarlosLopezElorduy (2)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
enhancement (2)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 48 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 5
  • Total maintainers: 1
pypi.org: qmap

Manage job executions in a cluster

  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 48 Last month
Rankings
Dependent packages count: 10.0%
Dependent repos count: 21.7%
Average: 28.2%
Forks count: 29.8%
Stargazers count: 38.8%
Downloads: 40.8%
Maintainers (1)
Last synced: 11 months ago

Dependencies

optional-requirements.txt pypi
  • pytest *
  • sphinx *
requirements.txt pypi
  • bgconfig >=0.8
  • click >=6.7
  • configobj >=5.0.6
  • psutil >=5.4.7
  • urwid >=1.3.1
.github/workflows/GHA_qmap_tester.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
setup.py pypi