File: plot_mpi.py

package info (click to toggle)
amgcl 1.4.4-1
  • links: PTS, VCS
  • area: contrib
  • in suites: sid
  • size: 5,676 kB
  • sloc: cpp: 34,043; python: 747; pascal: 258; f90: 196; makefile: 20
file content (19 lines) | stat: -rwxr-xr-x 447 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env python
from pylab import *
from scipy.io import mmread

A = mmread('poisson3Db.mtx')

M = 4
n = A.shape[0]
chunk = n // M
domain = [min(n, i*chunk) for i in range(M+1)]

figure(figsize=(8,8))
spy(A, marker='.', markersize=0.25, alpha=0.2)
for i,c in enumerate(('tab:blue', 'tab:orange', 'tab:green', 'tab:red')):
    axhspan(domain[i], domain[i+1], color=c, lw=0, alpha=0.25, zorder=0)

tight_layout()

savefig('Poisson3D_mpi.png')