Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simulation
#1
Hello My Friends,

I have some questions. hope so someone can help me because i will write my last exam and graudate from my school. Thats why, please do not withhold your helps.

I'm sending that document. Please Help me (It is not programming mostly they are explanation about 2 sentences.)

I'm posting my drive. You can find the questions there. I cant post hier.


https://drive.google.com/open?id=18_Cwx2...KzV2yhSa0a
Reply
#2
I'm also coping the questions here :

Unfortunately, you have to find the calculation of a simulation step for N> 30 longer than 1/25s takes so that a smooth visualization is not possible.

(a) How does the computing time for a simulation step change if instead of N Bodies (N + 1) Bodies are considered? (Runtime complexity)

(b) Briefly explain how cython works. (about two sentences)

© You want the computing time per simulation step by using cython shorten.
i. Which (as small as possible) part of the calculation you implement in cython to achieve a maximum reduction in computing time? (Working foundation, max. two sentences)
ii. In this case, could you do the calculation by using accelerate prange further? (Justification, max. Two sentences)

(d) In the next step you want a distributed application for the simulation Design and develop thousands of interacting bodies according to formula.
Create a well-documented sketch (no code) of an executable System that shows
• which components are required for a functioning solution,
• what tasks these components have (approx. Two sentences each) and
• Which data at which times of the simulation between the components elements can be exchanged (represented by arrows, for example).

(e) When testing your distributed application, you find that the outbound The performance of the individual computers in the cluster is not uniform, but is time-consuming fluctuates.
i. Give a possible reason for this observation. (max. Two Sentences)
ii. By what change can you see the strong temporal fluctuations reduce occupancy significantly? (max. two sentences)
............................................................................................................................................
(a) Give a function move_body in pseudo-code with suitable arguments with which the position of a body at time t + ∆t is calculated can be if the masses, positions and speeds of all N bodies are known at time t. The given formulas can be used please use meaningful names.

(b) How can you practically check whether your implementation of the computation
formulations (??) and (??) provides correct results? (about two sentences)

© The following is possible with Python:

1. import multiprocessing, math
2. l1 = list (range (1, 1000))
3. p = multiprocessing.Pool (multiprocessing.cpu_count ())
4. l2 = p.map (math.log10, l1)
5. p.close ()
Describe in detail what happens in lines 3 and 4 of this program.
(about four sentences)

(d) Enter the pseudo code for the calculation of a simulation step multiprocessing.Pool.map (see above). The function move body should be used for this.

(e) The simulation of 20,000 bodies should be done with Python and the master worker Pattern can be distributed to 20 computers with 4 CPU cores each (cluster).
i. How big choose the size of a subtask (job) that each worker processed per call? (Justification, about two sentences)
ii. What maximum acceleration compared to running on a Core is theoretically possible by using the cluster? (annotated invoice)
iii. Give two important reasons why the theoretically possible acceleration is not achieved in practice. (about two sentences)
.................................................................................................................................................................
(a) The simulation written in Python is too slow and should be accelerated.
i. Provide an important reason for using a profiler speaks in this context.
ii. For which sub-step of the calculation with the given formulas are you waiting for the greatest computing effort? (Justification, approx. 1 sentence)
iii. State two important advantages that numba has over cython for has the reduction in computing time.

(b) To further increase the performance of your application, distribute the Calculations on ten computers available in the laboratory.
i. Outline software components that you want for the distributed application use. Both the function and the structure of the Components emerge, in particular which data is stored where.
ii. To exploit the limited bandwidth of the network, only so many le data is exchanged between the individual computers, as is absolutely necessary. Specify which data at what times of the simulation between computers must at least be replaced. (each time, Type of data, source, destination)

..................................................................................................................................................................

(a)Show how to do the new using the formulas shown above Position and speed of a body taking into account the changing can calculate the effect with the other bodies (pseudocode or python).
Note: There is a Python function f G (m1, r1, m2, r2), the equation (Explanation Pic 2) implemented. You can use this function in your solution.

(b) You find that the calculation of a simulation step using pure Python takes too long for a smooth visualization, so that a systematic optimization seems necessary.
i. Explain how a profiler can be used for optimization. (about two sentences).
ii.For which calculations within the step-by-step motion simulation is the most computing time required? (Justification, about two sentences)
iii. Justify why the calculations by using numba.jit can be accelerated. (about two sentences)

© The simulation is further accelerated by parallelization and distribution.
i. Use a commented sketch to explain how to distribute Using the master worker pattern works.
ii.Which data must be used for each simulation step (calculation of the new positions and speeds of all bodies) at least between the involved computers are exchanged? (about three sentences)
iii. They are supposed to simulate 100,000 bodies distributed over 100 CPU cores
carry out. How do you choose the size of a subtask (job)? (Reason, about two sentences)
Reply
#3
You may not intend it this way, but this looks like a "please do it for me" post. You've posted your assignment, but you haven't explained your question. If you need to end up with code, you should share what you have to so far, as we tend to be reluctant to share code with those who haven't shown coding effort yet.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020