首页 >
> 详细

Assignment 2, Deadline 15 November 2019

General Remarks

• The complete assignment must be written as a single Jupyter notebook

that contains the code, relevant output, graphcis and all explanations.

• The Notebook must be executable without errors. To make sure that this

is the case, before submitting reload the notebook and run it from scratch

to make sure it runs fine. Any submitted notebook that does not run

correctly will receive an automatic 0 mark.

• While you can (and should) include in your notebooks results from longer

runtime, make sure that the parameter choices in your notebook on submission

are chosen such that the notebook does not take longer than 2

minutes to run on your computer. We are most likely using much faster

machines for marking. But notebooks that have a substantially longer

running time will be rejected.

• You must follow in your code PEP8 coding guidelines with the only exception

that lines can be longer than 80 characters. But please do not make

them much longer than 100 characters so that they are still readable (consider

at a soft limit). Failure to adhere to PEP8 coding guidelines can

result in substantial point reductions in severe cases.

• Correctness of the codes will count 40% of the mark. You will receive

30% for presentation, which includes sensible graphs and thorough documentation.

The remaining 30% will be for efficient coding. However,

a submission without documentation will still count as a fail as this is a

mandatory component.

• You will be able to submit your Jupyter notebooks from a few days before

the deadline onwards to the Moodle course page. A corresponding

announcement will be made in time.

The following two questions are computational exercises that require you to

develop code implementations with PyOpenCL. It is expected that you develop

efficient implementations that make use of advanced CPU parallelisation features.

If you have problems with OpenCL CPU drivers on your own computers

you can use the Microsoft Azure Notebook platform.

Question 1: OpenCL CSR matrix-vector product

Given a sparse matrix in CSR format. Develop a class that derives from Scipy

LinearOperator and which is initialised with data, indices, and indptr array

that describe the sparse matrix. The class shall provide an efficient OpenCL

accelerated matrix-vector product. Make use of efficient parallelisation and

SIMD features provided by Intel’s AVX2 technology. Make sure that your data

movements are efficient. In particular, the sparse matrix data should only be

transferred to the device once and not during each matrix/vector product.

Question 2: Potentials generated by random particles.

We consider the Laplace equation−∇2u = f

on the unit square with zero conditions on the boundary. Based on the finite

difference 5 point stencil discretization discussed in the lecture develop a LinearOperator

that takes a vector u of values on an M ×M grid (xi, yj ) for xi =iM+1 ,j = 1, . . . , M and yi described in the same way, and returns the approximate

evaluation of −∇2u for this vector. The evaluation of the 5 point stencil should

be parallelized using PyOpenCL without storing the matrix explicitly.

The CG iterative solver in Scipy only requires a LinearOperator that implements

matvecs. As right-hand side you can use the simple function f = 1.

For different values of M plot the convergence curve of the residual r = kb −

Axjk2/kbk2 (for these it is best to use a semilogy plot). Also, investigate how

the number of iterations grows as M increases. Finally, produce nice plots of

the solution u on the unit square.

联系我们

- QQ：99515681
- 邮箱：99515681@qq.com
- 工作时间：8:00-23:00
- 微信：codinghelp

- Csci 340作业代做、代写java程序语言作业、代做java实验作业代写 2019-12-12
- Data课程作业代做、代写nbershade作业、代做r课程设计作业、代写r 2019-12-12
- 代写csci 1100作业、Program课程作业代做、Python语言作业 2019-12-12
- Data留学生作业代做、代写sql实验作业、Sql编程有作业调试、Pseud 2019-12-12
- 代做g6077留学生作业、System课程作业代写、代做web编程语言作业、 2019-12-12
- 代写comp529作业、代做analysis留学生作业、代写java语言作业 2019-12-12
- Ce235留学生作业代写、Program课程作业代写、C/C++程序语言作业 2019-12-12
- 代写system留学生作业、代做python语言作业、代写java，C/C+ 2019-12-12
- 代写ma705留学生作业、代写python程序语言作业、代写python实验 2019-12-11
- Stat 3312作业代做、R语言作业代写、代做r编程设计作业、代写sas 2019-12-11
- Comp201作业代做、代写software Engineering作业、J 2019-12-11
- Statistics 3022作业代做、代写data留学生作业、R编程设计作 2019-12-11
- 代写canvas留学生作业、Python, R，Matlab编程作业代做、代 2019-12-11
- Cs 112留学生作业代做、Program编程语言作业、Python程序语言 2019-12-11
- 代写fre6831留学生作业、代做python程序语言作业、Python实验 2019-12-11
- Mathjax课程作业代写、代做html，Css作业、代写r编程设计作业、代 2019-12-11
- Stsci 5060作业代做、Sql编程语言作业调试、代写sql课程设计作业 2019-12-11
- 代做parser留学生作业、Programs课程作业代写、代写c++实验作业 2019-12-10
- 代写econ215留学生作业、代写python课程设计作业、Python编程 2019-12-10
- 代写databases作业、代做java，Python编程设计作业、代写c/ 2019-12-10