Skip to content

Questions and Answers

Jacob Fields edited this page Jun 22, 2020 · 4 revisions

Troubleshooting

  1. I keep getting Python errors when trying to compile OOPS-2D or run the genParams.py script!
    • OOPS-2D requires Python 3.0 or later to compile because of the genParams.py script. Python 2.7 will not work. If you're getting errors with a more recent version of Python, please let me know.
  2. My code runs slower with MPI than without! What am I doing wrong?
    • Because of the extra overhead involved with running in parallel, your code will not run N times as fast just because you've got N cores. After each stage of the Solver object, the ODE object must synchronize boundary data between every processor. Additionally, parallel output also has overhead. This is quite small for VTK output, but the same is not true for CSV dumps. While overhead cannot be eliminated, it can be reduced. Consider the following tips for running your problem in parallel:
      • Increase your problem size. This doesn't decrease the overhead, but it does decrease the overhead relative to the problem size. Doubling the grid resolution in x and y, for example, will quadruple the number of points, but it will only double the amount of communication needed.
      • Don't use more ghost points than your problem needs.
      • Reduce the number of fields that are exchanged. Under most circumstances, a field which can be calculated from another field should not be exchanged.
      • Use VTK output, not CSV dumps.

Other Questions

  1. Why do you use smart pointers like std::shared_ptr in some places? Don't they slow down the code?
    • Not really. Allocation and destruction are marginally slower with std::make_shared than a complex pointer, but it's not enough to make much of a difference. Memory in OOPS-2D is already structured to minimize the number of times it gets allocated or deallocated because it's painfully slow, even with raw pointers. If it makes you feel any better, raw pointers are still used in complex data structures like SolverData and ODEData, and MPI communication (which has the most frequent allocations and deallocations) is done with raw pointers out of necessity. In my opinion, the better safety for a marginally slower allocation is worth the trade-off.
  2. Can you add (random feature)?
    • Possibly. My goal is to keep OOPS-2D simple and easy-to-use. If it enhances ease-of-use, sure. If it doesn't, you're better off forking the project and adding it yourself.

Clone this wiki locally