Using Sun WorkShop

Running a Distributed Build

Distributed Make (dmake) allows you to concurrently distribute the process of building large projects, consisting of many programs, over a number of workstations and, in the case of multiprocessor systems, over multiple CPUs. For a full description of Distributed Make, see Appendix C, Using the dmake Utility."

The default Sun WorkShop build command (dmake) provides three different build modes:

In distributed mode, you can concurrently distribute over several servers the process of building large projects that consist of many programs. dmake parses your makefiles, determines which targets can be built concurrently, and distributes the build for those targets over a number of build servers designated by you.

By default, dmake runs in serial mode. You can set it to run in parallel or distributed mode in the Options dialog box (see "Specifying Make Options").

Preparing for a Distributed Build

Before running a distributed build for the first time, you must create a configuration file that specifies which machines are to participate as dmake build servers. In addition, before a machine can be used as a build server, it must be configured to allows jobs to be distributed to it.

A build server should be of the same architecture and running the same operating system version as the dmake host. Be default, it is assumed that the path to the dmake executables is the same for the dmake host as it is for the build server. If it is not, you must customize the path attribute for that server (for further details see the dmake(1) man page).

.dmakerc File

The .dmakerc file is a runtime configuration file. You must set up a runtime configuration file to run a distributed build. The file contains groups (lists) of build servers and the number of jobs distributed to each build server. The dmake utility searches for this file on the dmake host to know where to distribute jobs. Generally, this file is in your home directory.

You may enclose the names of groups and hosts in the .dmakerc file in double quotes. Doing so allows more flexibility with respect to the character sequences that may be part of the group and host names. For example, if the name of a group starts with a digit it should be double-quoted:

 group "123_sparc"

The dmake utility searches for a runtime configuration file in the following locations and in the following order:

If dmake does not find a runtime configuration file, it distributes two jobs to the local host.

For information on setting up a runtime configuration file, see the dmake man page.

The following is a sample of a simple runtime configuration file where jupiter, venus, saturn, mercury, and pluto are listed as build servers:


# My machine. This entry causes dmake to distribute to it.
jupiter { jobs = 1 }
venus
# Manager's machine. She's usually at meetings.
mercury { jobs = 4 }
pluto

The following runtime configuration file contains groups:


earth                   { jobs = 2 }
mars                    { jobs = 3 }
group sunos4.x {
               host parasol
                host summer
}
group lab1 {
               host falcon    { jobs = 3 }
                host hawk
                host eagle      { jobs = 3 }
}
group lab2 {
               host heron
               host avocet    { jobs = 3 }
               host stilt     { jobs = 2 }
}
group labs {
               group lab1
                group lab2
}
group sunos5.x
                             group labs
                host jupiter
                host venus      [ jobs = 2 }
                host pluto      { jobs = 3 }
}

dmake.conf File

To set up a machine to be used as a build server, you must create a configuration file called /etc/opt/SPROdmake/dmake.conf file on the server's file system.. Without this file, dmake refuses to distribute jobs to that machine.

In the dmake.conf file, you specify the maximum number of jobs (from all users) that can run concurrently on that build server. In addition, you may specify the "nice" priority under which all dmake jobs should run. The following is an example of a dmake.conf file:


max_jobs: 8
nice_prio: 5

Examining Multiple Build Jobs

If you are running Distributed Make (dmake in any mode), you can use the Jobs Graph window to monitor the progress of the dmake run and to view the state of each build job.

The graph identifies each build server. Build jobs are graphed in clusters per server. The graph shows the length of time each build takes. Each job is indicated in the graph by a line. The appearance of the line indicates whether the build is in progress (series of dots), or whether it completed (solid green), or failed (solid red).

To open the Jobs Graph window from the Building window, click the Jobs Graph button (see Figure 4-1) or choose View > Dmake Jobs Graph.

You can select a segment of one of the jobs in the graph to see its build output in the Selected Job Output display at the bottom of the window.