Homework 4 due: Tuesday, Feb 22 This homework follow our in-class prototype of Week 5. The goal is to write a parallel code that models the flow of particles in a simple square geometry. The geometry is decomposed spatially into nprocs distinct sub-domains. Each sub-domain begins with np particles (user input). Each particle then moves independently of the others until it is absorbed or reaches a processor boundary. You do not have to simulate the physics of this process but rather calculate using random numbers whether 1. absorption takes place and 2. if not, what boundary the particle leaves. You can reuse my routines from the class prototype to make these calculations. The absorbed particles can be discarded for the purpose of the exercise. Those that reach processor boundaries will then need to be sent to the neighboring processor (only nearest neighbor crossings are possible). Any sort of communication can be used to implement the data exchanges so long as it is safe and relatively efficient. This process then continues until there are no remaining particles. The goal is to verify that this scales with nprocs for fixed particle counts, with nparticles for fixed processor counts, and then roughly estimate how many seconds per particle per processor is required for the data exchanges. I will compare your estimate to mine and explore any discrepancies. There are some constraints also. Memory is at a premium, so you MAY NOT simply allocate as much extra memory as you need for the data exchanges. Instead, you must first fully reuse the memory of the data that is leaving a given processor. I showed one simple way to do this in class. You are welcome to follow that strategy or design another. However you must not simple create the extra memory to do the exchanges. The goal is to be able to fit roughly 50M particles on a Full Disclosure node and this won't be possible without some carefuly programming. Other details can be obtained from the class prototype code in this directory. The prototype is not complete or debugged. In fact, I found a few shortcomings in carrying out the solution, so use it as a template for your development and do not copy verbatim. In particular, the main data structure and strategy for data movement are probably worth mimicking. We will discuss this problem more in class on the 15th and with Justin in the study sessions.