Support more than 2 ranks in template generator

It should be possible to have code generated for more than two ranks. The SPMD branching code should be generated accordingly. I think this should be straightforward to accomplish by modifying the template_instruction_block such that it can generate arbitrarily many branches.

Some further suggestions:

  • I am not sure if any test case requires that, but for readability it could be interesting to also support generation of branches where two or more ranks execute the same code, i.e., if (rank == 1 || rank == 2).
  • The same might be true to generate something like if (rank != 0).