Skip to content

Commit 4a57020

Browse files
committed
reset apple veclib to use 1 thread
1 parent f3970d5 commit 4a57020

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

scripts/nlsam_denoising

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
from __future__ import division, print_function
44

55
import os
6+
67
# Fix openblas threading bug with openmp before loading numpy
78
# Spams has openmp support already, and openblas conflicts with python multiprocessing.
89
os.environ['OPENBLAS_NUM_THREADS'] = '1'
910

11+
# Mac OSX has it's own blas/lapack, but like openblas it causes conflict for
12+
# python 2.7 and before python 3.4 in multiprocessing, so disable it.
13+
os.environ['VECLIB_MAXIMUM_THREADS'] = '1'
14+
1015
import argparse
1116
import logging
1217
from multiprocessing import cpu_count, freeze_support

0 commit comments

Comments
 (0)