JuliaLang/julia — pull request #3519 by amitmurthy (2013-06-24 12:50:35+00:00)
Title: Implemented Process Groups

This patch allows grouping workers into separate logical units. The available functions and their behavior are:

- ```DEFPG``` : A global constant. Is the name of the default process group. Process 1 belongs to this process group.

- ```addprocs``` takes in an additional keyword parameter, ```pg=DEFPG```. The processes are added to the specified process group.

- ```procs()``` returns ALL processes, ```procs(pgname)``` returns processes for the particular process group.

- ```nprocs()``` returns count of ALL processes, ```nprocs(pgname)``` returns count for the particular process group.

- ```workers()``` returns workers for ```DEFPG```, ```workers(pgname)``` returns workers for the particular process group.

- ```nworkers()``` returns count for ```DEFPG```, ```nworkers(pgname)``` returns count for the particular process group.

- ```pmap_pg``` is like ```pmap```, but only executes on workers belonging to the specified process group (first parameter)

- ```pmap(f, lsts...)``` is equivalent to ```pmap_pg(DEFPG, f, lsts...)```

- ```@parallel``` has a new version with 3 arguments. In this version, the first parameter specifies the process group.

- ```remotecall```, ```remotecall_fetch``` and ```remotecall_wait``` have versions where the first parameter is a process group name (instead of process id). The "next" process id from the group is selected for execution.

### NOTE:
- All processes connect to each other as before, even across process groups. Full visibility across process groups exist.