public static void main(final String[] args) throws IOException
	{
		// Initialize the cluster.
		Comm.init (args);

		// check arguments
		if (args.length != 3 && args.length != 4)
			usage();

		// Get the common variable.
		world = Comm.world();

		/**
		 * @param	args[0] = section file Name
		 * @param	args[1] = student file Name
		 * @param	args[2]	= relation file Name
		 */
		Resources.loadFromFile(args[0], args[1], args[2]);

		if(world.rank() == 0){
			try{
				// Here I will create two threads, one is running master.
				// the other is running worker.
				new ParallelTeam(2).execute(new ParallelRegion(){
					public void run() throws Exception{
						execute (new ParallelSection(){
							public void run() throws Exception{
								master();
							}
						},
						new ParallelSection() {
							public void run() throws Exception{
								Worker();
							}
						});
					}
				});
			}catch(final Exception e){}
		}
		else{
			Worker();
		}

		final ObjectItemBuf<Schedule> buf = ObjectItemBuf.buffer();
		// reduce
		buf.item = popularSchedule;
		world.allReduce(0, buf, Schedule.REDUCE_OP);

		if(world.rank() == 0)
		{
			// save file
			if(args.length == 4) {
				final File outputfile = new File(args[3]);
				outputfile.createNewFile();
				final PrintStream ps = new PrintStream(outputfile);
				ps.println(popularSchedule);
				ps.flush();
				ps.close();
			}

			// print out number of iterated schedules and stats
			final int[] counters = popularSchedule.getCounters();
			System.out.println("" + totalSchedules + "\t" + popularSchedule.getRank() + "\t"
					+ counters[Schedule.SE_COUNTER] + "\t"
					+ counters[Schedule.CE_COUNTER] + "\t"
					+ counters[Schedule.ME_COUNTER] + "\t"
					+ counters[Schedule.FE_COUNTER]);
		}
	}