Skip to content

Commit 5d2efa0

Browse files
jussienkoguest075
authored and
guest075
committed
Use Agg backend when not showing figures on screen
1 parent ff2121f commit 5d2efa0

File tree

8 files changed

+8
-1
lines changed

8 files changed

+8
-1
lines changed

cython/heat-equation/heat_simple.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
from evolve import evolve

interface/c/solution/heat-cffi.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
from cffi import FFI

interface/c/solution/heat-cython.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
from evolve_cyt import evolve_py

interface/fortran/solution/heat_simple.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
from evolve_mod import evolve

mpi/heat-equation/solution/heat-p2p.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def main():
102102
raise ValueError('Number of rows in the temperature field (' \
103103
+ str(shape[0]) + ') needs to be divisible by the number ' \
104104
+ 'of MPI tasks (' + str(size) + ').')
105-
n = shape[0] / size # number of rows for each MPI task
105+
n = int(shape[0] / size) # number of rows for each MPI task
106106
m = shape[1] # number of columns in the field
107107
buff = np.zeros((n, m), dtype)
108108
comm.Scatter(field, buff, 0) # scatter the data

numpy/heat-equation/skeleton.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import time
33

44
import matplotlib
5+
matplotlib.use('Agg')
56
import matplotlib.pyplot as plt
67

78
# Set the colormap

numpy/heat-equation/solution/heat-serial.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
# Set the colormap

performance/cprofile/heat_simple.py

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import time
44

55
import matplotlib
6+
matplotlib.use('Agg')
67
import matplotlib.pyplot as plt
78

89
from evolve import evolve

0 commit comments

Comments
 (0)