elixir/utils/common.sh
Michael Opdenacker c156433520 utils: set ELIXIR_THREADS to number of CPUs
This way, you have a correct behaviour even without setting
ELIXIR_THREADS

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
2023-05-05 15:17:27 +02:00

24 lines
958 B
Bash
Executable file

#!/bin/bash
# This file is part of Elixir, a source code cross-referencer.
#
# Copyright (C) 2019--2023 Michael Opdenacker and contributors
#
# Elixir is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Elixir is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Elixir. If not, see <http://www.gnu.org/licenses/>.
if [ "$ELIXIR_THREADS" = "" ]
then
# Set number of threads to the number of CPU cores
# available to the current process
export ELIXIR_THREADS=`nproc`
fi