# Tag Info

1

MPI is designed so that the same executable is started on a number of machines, none of which may be the one on which the mpirun program is called. Furthermore, MPI jobs are typically put into a queue, and the actual job may run hours or days later. As a consequence, MPI jobs are not meant to be used in an interactive mode, but all input should be provided ...

1

Input from the console may work on process zero, if that runs locally, but will certainly not work on other ranks. However, I wouldn't even do interactive input on process zero. #!/bin/bash if [ $PMI_RANK -eq 0 ] ; then ( echo 5 ; echo 1 ; echo foo ) |$* else exec \$* fi Put that in a script and start that with mpirun: mpirun myscript.sh myprogram ...

1

I think the main use of it is abstraction and the advantages that come with it: Applying a function to each element of an array comes up in many situations. Wrapping this pattern into a function raises the level of abstraction: you do not need to think in loops, your intent is probably clearer. If you are familiar with Python, comprehensions do this, as ...

1

Ed Bueler just wrote the perfect book for you: "PETSc for Partial Differential Equations: Numerical Solutions in C and Python" https://epubs.siam.org/isbn/978-1-61197-630-4

Top 50 recent answers are included