[SOLVED] 程序代写代做代考 algorithm The Red/Blue computation simulates two interactive flows: an n by n board is initialized so cells have one of three colors: red, white, and blue, where white is empty, red moves right, and blue moves down. (The board may be initialized with roughly 1/3 cells in read, 1/3 in white and 1/3 in blue and colors should be interleaved and spread across the board. You need to write a separate function board_init to initialize the board.) In the first half step of an iteration, any red color can move right one cell if the cell to the right is unoccupied (white); on the second half step, any blue color can move down one cell if the cell below it is unoccupied (white); the case where red vacates a cell (first half) and blue moves into it (second half) is okay.  Colors wraparound to the opposite side when reaching the edge. Viewing the board as overlaid with a t by t grid of tiles (for simplicity t divides n, i.e., every tile contains n/t by n/t cells), the computation terminates if any tile’s colored cells are more than c% one color (blue or red).

30 $

File Name: 程序代写代做代考_algorithm_The_Red/Blue_computation simulates_two_interactive_flows:_an n by n board_is_initialized_so_cells_have_one_of_three colors:_red,_white,_and_blue,_where_white_is_empty,_red_moves_right,_and_blue_moves_down._(The_board_may_be_initialized_with_roughly_1/3_cells_in_read,_1/3_in_white_and_1/3_in_blue_and colors should_be_interleaved_and_spread_across_the_board._You_need_to_write_a_separate_function board_init to_initialize_the_board.)_In_the_first_half_step_of_an_iteration,_any_red color can_move_right_one_cell_if_the_cell_to_the_right_is_unoccupied_(white);_on_the_second_half_step,_any_blue color can_move_down_one_cell_if_the_cell_below_it_is_unoccupied_(white);_the_case_where_red_vacates_a_cell_(first_half)_and_blue_moves_into_it_(second_half)_is_okay.  Colors wraparound_to_the_opposite_side_when_reaching_the_edge._Viewing_the_board_as_overlaid_with_a t by t grid_of_tiles_(for_simplicity t divides n, i.e.,_every_tile_contains n/t by n/t cells),_the_computation_terminates_if_any_tile’s colored cells_are_more_than c% one color (blue_or_red)..zip
File Size: 10588.08 KB

SKU: 6716413584 Category: Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Or Upload Your Assignment Here:


The Red/Blue computation simulates two interactive flows: an n by n board is initialized so cells have one of three colors: red, white, and blue, where white is empty, red moves right, and blue moves down. (The board may be initialized with roughly 1/3 cells in read, 1/3 in white and 1/3 in blue and colors should be interleaved and spread across the board. You need to write a separate function board_init to initialize the board.) In the first half step of an iteration, any red color can move right one cell if the cell to the right is unoccupied (white); on the second half step, any blue color can move down one cell if the cell below it is unoccupied (white); the case where red vacates a cell (first half) and blue moves into it (second half) is okay.  Colors wraparound to the opposite side when reaching the edge. Viewing the board as overlaid with a t by t grid of tiles (for simplicity t divides n, i.e., every tile contains n/t by n/t cells), the computation terminates if any tile’s colored cells are more than c% one color (blue or red).
  Use MPI to write a solution to the Red/Blue computation.
  Assume the processes are organized as a one-dimensional linear array.
  It is fine to use a square grid, i.e. n by n grid for n being grid size.
  For simplicity assume n is divisible by t.
  Each process will hold a number of k×n/t rows for k ≥ 0.
  For the purpose of load balancing, processes should have roughly the same number of rows and the difference not greater than n/t rows.
  Your program must produce correct results for nprocs being greater than or equal to one.
  Your program needs to ask for 4 user defined parameters (integers) as inputs: cell grid size n, tile grid size t, terminating threshold c, and maximum number of iterations max_iters.
  Your program needs to print out which tile (or tiles if more than one) has the colored squares more than c% one color (blue or red).
  After the parallel computation, you main program must conduct a self-checking, i.e., first perform a sequential computation using the same data set and then compare the two results.

Your submissions will be marked on accuracy of results, suitability of the parallelism applied, and quality of your reports.
The report should be concise and clear (2-3 A4 pages) and should contain the following sections:
a.       Problem definition and Requirements
b.      Parallel algorithm design
c.       Implementation and Testing
d.      Manual (e.g. how to run the program, input and output)
You MUST attempt this assignment individually.
Submission Requirements
Your submission must be made by 11:59pm on Thursday, 13 April, 2017.
1.      Create a tar file which contains your reports, makefiles and any source files (e.g., .c and .h files). DO NOT INCLUD ANY OBJECT OR BINARY FILES.
2.      Submit only the .tar file.

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[SOLVED] 程序代写代做代考 algorithm The Red/Blue computation simulates two interactive flows: an n by n board is initialized so cells have one of three colors: red, white, and blue, where white is empty, red moves right, and blue moves down. (The board may be initialized with roughly 1/3 cells in read, 1/3 in white and 1/3 in blue and colors should be interleaved and spread across the board. You need to write a separate function board_init to initialize the board.) In the first half step of an iteration, any red color can move right one cell if the cell to the right is unoccupied (white); on the second half step, any blue color can move down one cell if the cell below it is unoccupied (white); the case where red vacates a cell (first half) and blue moves into it (second half) is okay.  Colors wraparound to the opposite side when reaching the edge. Viewing the board as overlaid with a t by t grid of tiles (for simplicity t divides n, i.e., every tile contains n/t by n/t cells), the computation terminates if any tile’s colored cells are more than c% one color (blue or red).
30 $