From 1ea92aa2d5c779925e54580e2d1d7be702bbb08a Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 22 Feb 2017 16:39:51 -0500 Subject: [PATCH] Prevent OpenBLAS from spawning worker threads. TNL-6456 The RLIMIT_NPROC limit is per-user so simultaneous student submissions pile up and overflow the limit. Setting this environment variable will prevent spawning any threads (the 1 means only have one threads, the already existing main thread). --- common/lib/capa/capa/safe_exec/safe_exec.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/lib/capa/capa/safe_exec/safe_exec.py b/common/lib/capa/capa/safe_exec/safe_exec.py index b57afbcd0d..cf7863b058 100644 --- a/common/lib/capa/capa/safe_exec/safe_exec.py +++ b/common/lib/capa/capa/safe_exec/safe_exec.py @@ -14,6 +14,9 @@ import hashlib CODE_PROLOG = """\ from __future__ import division +import os +os.environ["OPENBLAS_NUM_THREADS"] = "1" # See TNL-6456 + import random as random_module import sys random = random_module.Random(%r)