Question: Task 3: Read in all emails using multiprocessing (4 points) Now that you've made the function to read in a single malt, you will use
Task 3: Read in all emails using multiprocessing (4 points) Now that you've made the function to read in a single malt, you will use the multiprocessing module in two different ways to process all the mailu. There are two ways to implement multiprocessing on a list of data: 1. The vanillo approach to parallelization involves getting a list of the items to process, then using the multiple worker processes to complete all the toms in partielle queue wystom. The list gets process by workers until there are no items left 2. The uplifting approach to paralelization involves getting a lot of tomato process, spitting that it into a number of sublists, then spit each subit to a worker. Each worker thon processes the sublistin serial For more background on these two los, check out this unetul medium.post. In order to execute your parallel processing for this task, you wil save two scripts malfunctions_vanillo.py and mall_functions..split.py with the functions needed for each approach. Import the module that you will execute in parallel by calling import malfunctions_vanilla and then calling a function within that modulo, just like you would any other module in python. Note that Windows machines have to set up parallel processing you will be unable to save your function in a cell and then run with multiprocesing. Use the time module to track the time taken for each approach In the following colo), implement the varita approach to parallelation to process all emais using pool.nap()Save the output list to an object called out vanilla In [lt import as import time import sys import sst import imaplib import multiprocessing import numpy as np import vanilla def mp_processi Sublist) A wrapper function within which a particular worker establishes a connection with the inap server and calls the function to download emails corresponding the list of MacBook Pro Task 3: Read in all emails using multiprocessing (4 points) Now that you've made the function to read in a single malt, you will use the multiprocessing module in two different ways to process all the mailu. There are two ways to implement multiprocessing on a list of data: 1. The vanillo approach to parallelization involves getting a list of the items to process, then using the multiple worker processes to complete all the toms in partielle queue wystom. The list gets process by workers until there are no items left 2. The uplifting approach to paralelization involves getting a lot of tomato process, spitting that it into a number of sublists, then spit each subit to a worker. Each worker thon processes the sublistin serial For more background on these two los, check out this unetul medium.post. In order to execute your parallel processing for this task, you wil save two scripts malfunctions_vanillo.py and mall_functions..split.py with the functions needed for each approach. Import the module that you will execute in parallel by calling import malfunctions_vanilla and then calling a function within that modulo, just like you would any other module in python. Note that Windows machines have to set up parallel processing you will be unable to save your function in a cell and then run with multiprocesing. Use the time module to track the time taken for each approach In the following colo), implement the varita approach to parallelation to process all emais using pool.nap()Save the output list to an object called out vanilla In [lt import as import time import sys import sst import imaplib import multiprocessing import numpy as np import vanilla def mp_processi Sublist) A wrapper function within which a particular worker establishes a connection with the inap server and calls the function to download emails corresponding the list of MacBook Pro
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
