Bohrium is a runtimesystem for mapping vector operations
onto a number of different hardware platforms, from simple multicore systems
to clusters and GPU enabled systems. A typical example is acceleration of Python/NumPy code using
the Bohrium runtime system. The first line in the following heat diffusion
solver imports “ For more information please see www.bh107.org import bohrium as np import matplotlib.pyplot as plt def solve(height, width, epsilon=0.005): grid = np.zeros((height+2,width+2),dtype=np.float64) grid[:,0] = 273.15 grid[:,1] = 273.15 grid[1,:] = 273.15 grid[0,:] = 40.0 center = grid[1:1,1:1] north = grid[:2,1:1] south = grid[2:,1:1] east = grid[1:1,:2] west = grid[1:1,2:] delta = epsilon+1 while delta > epsilon: tmp = 0.2*(center+north+south+east+west) delta = np.sum(np.abs(tmpcenter)) center[:] = tmp plt.matshow(center, cmap='hot') plt.show() >>solve(100,100)
