#!/bin/bash

# Copyright (C) 2021 elphmod Developers
# This program is free software under the terms of the GNU GPLv3 or later.

# From MehmedB @ Stack Overflow: "How to limit number of CPU's used by a python
# script w/o terminal or multiprocessing library?"

export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
export OMP_NUM_THREADS=1
export OPENBLAS_NUM_THREADS=1
export VECLIB_MAXIMUM_THREADS=1

# Running `source elphmodenv` before running your Python scripts should prevent
# NumPy from using multiple processors for linear algebra. This is advantageous
# when parallelizing with MPI already (`mpirun python3 script.py`) or on shared
# servers, where CPU resources must be used with restraint.
