game_of_life Module

The key logic specific to the game of life


Uses

  • module~~game_of_life~~UsesGraph module~game_of_life game_of_life module~comms comms module~game_of_life->module~comms mpi mpi module~game_of_life->mpi module~comms->mpi

Used by

  • module~~game_of_life~~UsedByGraph module~game_of_life game_of_life program~main main program~main->module~game_of_life

Subroutines

public subroutine find_steady_state(steady_state, generation_number, global_input_board, global_nrows, global_ncols, base_mpi_communicator, nprocs)

Subroutine to find the steady state of the game of life

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: steady_state

Logical flag indicating whether the global board has reached a steady state

integer, intent(out) :: generation_number

The number of generations required to reach the steady state

integer, intent(in), dimension(:,:), allocatable :: global_input_board

The global board representing the current state of the game

integer, intent(in) :: global_nrows

The number of columns in the global board

integer, intent(in) :: global_ncols

The number of rows in the global board

integer, intent(in) :: base_mpi_communicator

The base MPI communicator for parallel processing

integer, intent(in) :: nprocs

The total number of processes in the MPI communicator

Read more…

public subroutine evolve_board(current_board, new_board)

Evolve the board into the state of the next iteration

Arguments

Type IntentOptional Attributes Name
integer, intent(in), dimension(:,:), allocatable :: current_board

The current state of the board

integer, intent(inout), dimension(:,:), allocatable :: new_board

The new state of the board

public subroutine check_for_steady_state(steady_state, current_board, new_board)

Check if we have reached steady state, i.e. current and new board match

Arguments

Type IntentOptional Attributes Name
logical, intent(out) :: steady_state

Logical to indicate whether current and new board match

integer, intent(in), dimension(:,:) :: current_board

The board as it currently is before this iteration

integer, intent(in), dimension(:,:) :: new_board

The board into which the new state has been stored after this iteration