Skip to content

Files

Latest commit

2c3d395 · Apr 21, 2020

History

History
This branch is 16 commits ahead of, 19 commits behind csc-training/hpc-python:master.

message-exchange

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 11, 2018
Apr 21, 2020

Simple message exchange

Communicating general Python objects

Write a simple program where two processes send and receive a message to/from each other using send and recv. The message content is a dictionary {‘rank’ : myrank} where myrank is the rank of the sending process. After receiving a message, each process should print out the rank of the process and the value in the received dictionary.

Communicating NumPy arrays

In each process, construct a 100 000 element NumPy array which is initialized to the rank of process. Send and receive the array using Send and Recv and after receiving print out the rank of process together with the first element of the received array. Investigate what happens when reordering the send and receive calls in one of the processes.