Question
I JUST WANT THE CODE PLEASE Write a Python program search.py in which four processes search an array in parallel (each process should get a
I JUST WANT THE CODE PLEASE
Write a Python program search.py in which four processes search an array in parallel (each process should get a fourth of the elements to search). All the processes are searching the integer array for the element whose value is 11. There is only one 11 in the entire array of 40,000 integers. Before the searching begins ONLY the master process should read in the array elements from a data file and distribute one fourth of the data to each of the other three processes and keep one fourth for its own search. When one of the processes has found the element 11, it should notify all the other processes, then print the index at which 11 was found (also include process rank in the output) and stop. On receiving the notification the other processes should print out the index they are at that time (include process rank in the output) and stop searching.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started