代写SCIF30005: Assessed Exercise代做留学生Matlab编程
- 首页 >> Matlab编程SCIF30005: Assessed Exercise
1 Overview
The aim of this exercise is to calculate the number of nearest neighbours within a given cut-off radius, rc, for each atom in a list of atoms, in three dimensions. You do not need to determine which atoms are neighbours of a given atom, only how many neighbours each atom has, i.e. how many other atoms are at a distance d < rc of a given atom. You should parallelise the code with MPI. Only 1 MPI task (the root task) needs to know and report the final simulation outcome. Higher marks will be awarded for more efficient implementations, e.g. using an MPI data distribution scheme with good load balancing, or for comparing different (serial or MPI) optimisation strategies.
You may find the week 14 video on finding neighbours helpful. However, the cell list approach described in the video is complicated. You are welcome to give it a go, but for the purposes of the mark scheme this will be counted as an extra element which goes beyond the brief, and therefore you should only try it if you have implemented the brute force approach correctly first.
2 Inputs
You will be given a set of inputs containing three-dimensional atomic coordinates in free boundary conditions (i.e. no periodic interactions) for different sizes:
• 120 atoms, L = 18 A˚
• 10549 atoms, L = 100 A˚
• 147023 atoms, L = 200 A˚
Each set of coordinates is given in an .xyz file, named for the number of atoms it contains, and with the side length L of the cubic box in which they are contained also given in the file.
You will be given a function for reading in the atomic coordinates which you may use in your code – the atomic species (Ar) is not relevant to this task, and is therefore ignored. This function returns the number of atoms, the side of the cube, L, and a vector of vectors, positions, where positions[i][0] contains the x-coordinate of atom i, positions[i][1] contains the y-coordinate of atom i, and positions[i][2] contains the z-coordinate of atom i.
3 Submission Instructions
You should submit two documents:
• a single file containing your code – if you have tested multiple approaches, these should be implemented in different functions which can be called from the same main function
• a short report (around 2 pages) containing:
– a brief description of your code, which includes the MPI strategy and any optimisations you have made
– the average, maximum and minimum number of neighbours for each system, for rc = 9 A(˚)
– the time taken to run the code for each of the given inputs and implemented strategies on
1 MPI task, 4 MPI tasks, and 8 MPI tasks respectively – if the time for a given calculation exceeds 10 minutes, you may write “> 10 minutes”
Note that while your report need only state the average, maximum and minimum number of neighbours for each system, the code itself should output the number of neighbours for each atom in a given system.