168
edits
</nowiki>
create a folder and save this file as
You can compile this program with
mpicc -g
You now have an executable called
You can run the command with
mpirun ./
With no other arguments, mpirun will run all of the tasks on the local machine, usually one for each CPU core. You should see a hello world from each process, on each cpu core.
Put that line in a file called 'localhost'.
Now run your program with that hostfile, using
mpirun --hostfile localhost ./
<nowiki>
Hello, world, I am
Hello, world, I am
Hello, world, I am 1 of 4
Hello, world, I am 3 of 4
</nowiki>
|