/********************************************************** File: slave.h Description: A program that inputes an integer number and determines if it is a prime number or not in parallel. Author: Dana Vrajitoru Organization: IUSB Date: August 23, 2002 ***********************************************************/ #ifndef SLAVE_H #define SLAVE_H const int MASTER_ID = 0; // The slave function that checks if n is prime. While in the loop for // testing the potential divisors, it also checks if the master has // any information about the loop having to end, which means that some // other process has found a non-trivial divisor in the meantime. void Check_prime_slave(int start, int end, int n); // The slave function. It waits for the master to communicate the // number to be checked, sets the limits of search for itself, then // calls the function that checks if the number is prime. void Slave(int proc_id, int nr_proc); #endif