First of all apologies if I am making any mistake or asking a very basic question as I am totally new to python let alone MPI.
Problem
I am trying to run a MPI program in Python, I have researched while surfing the internet and found out that I had to install Python and Anaconda first. I installed it and after that I installed Microsoft MPI and then I opened Anaconda Command Prompt and installed mpi4py library using following command,
conda install mpi4py
It worked well till now. But now I have to run a small HelloWorld example in my Python environment using mpi4py library. Below is my program,
from mpi4py import MPI
import sys
size = MPI.COMM_WORLD.Get_size()
rank = MPI.COMM_WORLD.Get_rank()
name = MPI.Get_processor_name()
sys.stdout.write(
"Hello, World! I am process %d of %d on %s.\n"
% (rank, size, name))
Now i am totally clueless where to write this program? Should I write it on Anaconda Command Prompt? Should I open Jupyter Notebook and write it down there or should i use some IDE like PyCharm to run this program? Then, I want to execute this program using following command,
$mpirun -np 4 ./helloworld
I am running this on my local machine but just for testing purpose i want to assign it to 4 different threads.
I know i may have asked silly things but I apologize. I am just a beginner at this and I hope you all can help me as always.
mpirun -np 4before that. - Zulan