# | Line 171 | Line 171 | void DumpWriter::writeFrame( vector<ofstream*>& outFil | |
---|---|---|
171 | ||
172 | #ifdef IS_MPI | |
173 | ||
174 | + | /********************************************************************* |
175 | + | * Documentation? You want DOCUMENTATION? |
176 | + | * |
177 | + | * Why all the potatoes below? |
178 | + | * |
179 | + | * To make a long story short, the original version of DumpWriter |
180 | + | * worked in the most inefficient way possible. Node 0 would |
181 | + | * poke each of the node for an individual atom's formatted data |
182 | + | * as node 0 worked its way down the global index. This was particularly |
183 | + | * inefficient since the method blocked all processors at every atom |
184 | + | * (and did it twice!). |
185 | + | * |
186 | + | * An intermediate version of DumpWriter could be described from Node |
187 | + | * zero's perspective as follows: |
188 | + | * |
189 | + | * 1) Have 100 of your friends stand in a circle. |
190 | + | * 2) When you say go, have all of them start tossing potatoes at |
191 | + | * you (one at a time). |
192 | + | * 3) Catch the potatoes. |
193 | + | * |
194 | + | * It was an improvement, but MPI has buffers and caches that could |
195 | + | * best be described in this analogy as "potato nets", so there's no |
196 | + | * need to block the processors atom-by-atom. |
197 | + | * |
198 | + | * This new and improved DumpWriter works in an even more efficient |
199 | + | * way: |
200 | + | * |
201 | + | * 1) Have 100 of your friend stand in a circle. |
202 | + | * 2) When you say go, have them start tossing 5-pound bags of |
203 | + | * potatoes at you. |
204 | + | * 3) Once you've caught a friend's bag of potatoes, |
205 | + | * toss them a spud to let them know they can toss another bag. |
206 | + | * |
207 | + | * How's THAT for documentation? |
208 | + | * |
209 | + | *********************************************************************/ |
210 | + | |
211 | int *potatoes; | |
212 | int myPotato; | |
213 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |