Topic #0 Module: Limitations

SMPI is robust, but it still has some limitations, as listed (and further explained) below:

Do not use global variables that should be distinct across MPI processes

SMPI runs your MPI processes as threads within a single process. So when you declare a global variable in your program (which is rarely a good idea anyway), all the threads will share it, as threads do. That's likely not what you want in terms of your MPI processes. Use local variables instead.

Do not use multithreading in your program

Because SMPI already uses multithreading to simulate your MPI program's execution, if your MPI program uses threads as well, mayhem can occur. In practice, i.e., with real MPI, you typically want to use threads to exploit multi-core machines. In these pedagogic modules, simply pretend that each host is single-core and that you don't need to use threads. This has no impact on your learning MPI, and if/when you transition to real (as opposed to simulated) MPI executions, you can then simply multi-thread computational sections of your code.

Don't make your C code weird

Yes, this is vague. smpicc compiles your code, and is fairly robust. But if you go crazy with tons of macros and C oddness, smpicc may get confused. It should happen only in rather extreme cases, but you are now warned.