public static void master()
	{
		try{
			final int size = world.size();

			// Send the range to all the workers.
			int UpperBound = 0;
			for(int i = 0; i < size; ++i)
			{
				final int lower 	= i * INCREMENT_STEP;
				final int upper	= lower + INCREMENT_STEP;
				final Range range = new Range(lower,upper);
				world.send(i,ObjectBuf.buffer(range));
				UpperBound = upper;
			}



			int  quitSize = 0;
			while(true)
			{
				// Once it get the message from worker that it has finished 
				// its current work, then it send a new range to the worker
				final ObjectItemBuf<Long> buf = ObjectBuf.buffer();
				final CommStatus status = world.receive(null,WORK_DONE,buf);
				// if the message get from worker show that it is finish work message,
				// then send a new message, if the message show that is because exceeding the 
				// time limit, then master record how many workers have exit the program.
				if(buf.item == FINISH_PIECE){
					final int worker = status.fromRank;
					final Range range = new Range(UpperBound,UpperBound+INCREMENT_STEP);
					world.send(worker,ObjectBuf.buffer(range));
					UpperBound += INCREMENT_STEP ;
				}
				else{
					totalSchedules += buf.item;
					// Number of workers who have exceeded the time limit.
					++quitSize;
					if(quitSize == world.size()){
						break;
					}
				}
			}
		}
		catch(final IOException e){
		}

	}