Reputation: 11
I'm using matplotlib in scripts on two different RHEL linux workstations (both RHEL 7.9). On one workstation it takes less than a second (0.18s) to call plt.subplots, while the other can take more than 45s!! Below is a simple timing script I used to check the timing. I've tried different versions of matplotlib (via miniconda), but it doesn't seem to make a difference. The workstation that loads plt.subplots slowly should be faster based on specs (see below). Any ideas of other things to check?
Thanks in advance for any help! Andy
import matplotlib.pyplot as plt
import time
fig_time_s = time.time()
fig, ax = plt.subplots(figsize=(9.0, 4.0), dpi=200)
fig_time_e = time.time()
fig_time = fig_time_e - fig_time_s
print('FIG TIME: {:7.2f}s'.format(fig_time))
version of matplotlib: |# Name |Version |Build |Channel |---|---|---|---| |matplotlib |3.2.2 | 1 |conda-forge |matplotlib-base |3.2.2 |py37h30547a4_0 |conda-forge
These are the specs of the workstations:
Property | faster | slower |
---|---|---|
Architecture: | x86_64 | x86_64 |
CPU op-mode(s): | 32-bit, 64-bit | 32-bit, 64-bit |
Byte Order: | Little Endian | Little Endian |
CPU(s): | 6 | 48 |
On-line CPU(s) list: | 0-5 | 0-47 |
Thread(s) per core: | 1 | 2 |
Core(s) per socket: | 6 | 24 |
Socket(s): | 1 | 1 |
NUMA node(s): | 1 | 1 |
Vendor ID: | GenuineIntel | GenuineIntel |
CPU family: | 6 | 6 |
Model: | 63 | 85 |
Model name: | Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz | Intel(R) Xeon(R) Platinum 8168 CPU @ 2.70GHz |
Stepping: | 2 | 4 |
CPU MHz: | 1899.884 | 1199.871 |
CPU max MHz: | 1900.0000 | 3700.0000 |
CPU min MHz: | 1200.0000 | 1200.0000 |
BogoMIPS: | 3791.33 | 5400.00 |
Virtualization: | VT-x | VT-x |
L1d cache: | 32K | 32K |
L1i cache: | 32K | 32K |
L2 cache: | 256K | 1024K |
L3 cache: | 15360K | 33792K |
NUMA node0 CPU(s): | 0-5 | 0-47 |
NUMA node0 CPU(s): | 0-47 |
Upvotes: 0
Views: 246
Reputation: 11
Update: our Sys Admin found the issue. There was some sort of timeout happening when using X11 forwarding (ssh -Y). Removing the -Y flag, or changing to -x solved the issue. We found that adding
import matplotlib
matplotlib.use('Agg')
to the script will also solve the slowdown issue.
Upvotes: 1