
252 | Big Data Simplied
comm.Send([data, MPI.INT], dest=1, tag=77)
elif rank == 1:
data = numpy.empty(1000, dtype=’i’)
comm.Recv([data, MPI.INT], source=0, tag=77)
Did You Know?
The pickle library in Python is used to serialize and deserialize Python object (for example,
list, dict, etc.) structure so that it can be saved on disk. So, in essence, pickling converts an
object to a character stream containing all information needed to reconstruct the object.
Below is a brief code snippet on how to work with Python pickle library.
import pickle
def savedata():
# Having data ready to be pickled ...
data = np.arange(15, ...