====================
PBS Queue Management
====================

.. automodule:: oi_tools.pbs
   :members:
   :undoc-members:

Configuration
-------------

Default values for several job submission parameters can be overridden by
setting environment variables before running your script or the ``oi`` CLI.
All variables use the ``OI_TOOLS_`` prefix:

.. list-table::
   :header-rows: 1
   :widths: 35 15 50

   * - Environment variable
     - Default
     - Description
   * - ``OI_TOOLS_PBS_DEFAULT_MEM``
     - ``"8G"``
     - Default memory request for :func:`~oi_tools.pbs.submit_job`.
   * - ``OI_TOOLS_PBS_DEFAULT_CPUS``
     - ``4``
     - Default CPU count for :func:`~oi_tools.pbs.submit_job`.
   * - ``OI_TOOLS_PBS_LOG_FOLDER``
     - ``"logs"``
     - Default log directory for :func:`~oi_tools.pbs.submit_job`.
   * - ``OI_TOOLS_PBS_POLL_DELAY``
     - ``5.0``
     - Seconds between polling when waiting for a job to finish.
   * - ``OI_TOOLS_PBS_MAX_CONCURRENT_JOBS``
     - ``7``
     - Maximum simultaneous jobs for :func:`~oi_tools.pbs.submit_many_jobs`.

Example — set project-wide defaults in a ``.env`` file or shell profile:

.. code-block:: bash

   export OI_TOOLS_PBS_DEFAULT_MEM=16G
   export OI_TOOLS_PBS_DEFAULT_CPUS=8
   export OI_TOOLS_PBS_LOG_FOLDER=/scratch/logs
