Spaces:
Running
Running
MilesCranmer
commited on
Commit
•
4a5693e
1
Parent(s):
4803d41
Check if user already set JULIA_NUM_THREADS
Browse files- pysr/julia_helpers.py +10 -1
pysr/julia_helpers.py
CHANGED
@@ -15,7 +15,16 @@ if os.environ.get("PYTHON_JULIACALL_HANDLE_SIGNALS", "yes") != "yes":
|
|
15 |
+ "You will experience segfaults if running with multithreading."
|
16 |
)
|
17 |
|
18 |
-
os.environ
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
os.environ["JULIA_NUM_THREADS"] = os.environ.get("JULIA_NUM_THREADS", "auto")
|
20 |
|
21 |
import juliapkg
|
|
|
15 |
+ "You will experience segfaults if running with multithreading."
|
16 |
)
|
17 |
|
18 |
+
if os.environ.get("JULIA_NUM_THREADS", "auto") != "auto":
|
19 |
+
warnings.warn(
|
20 |
+
"JULIA_NUM_THREADS environment variable is set to something other than 'auto', "
|
21 |
+
"so PySR was not able to set it. You may wish to set it to `'auto'` for full use "
|
22 |
+
"of your CPU."
|
23 |
+
)
|
24 |
+
|
25 |
+
os.environ["PYTHON_JULIACALL_HANDLE_SIGNALS"] = os.environ.get(
|
26 |
+
"PYTHON_JULIACALL_HANDLE_SIGNALS", "yes"
|
27 |
+
)
|
28 |
os.environ["JULIA_NUM_THREADS"] = os.environ.get("JULIA_NUM_THREADS", "auto")
|
29 |
|
30 |
import juliapkg
|