DL-FIND is a geometry optimisation library [5,6] that is included in the ChemShell distribution as the standard optimisation driver. ChemShell and DL-FIND communicate via a well-defined interface which is used for passing options, geometries, energies and gradients between the two codes.

DL-FIND has its own implementation of task-farming parallelism [6]. The parallel facilities consist of a collection of wrapper functions around MPI library calls to share data between processors and a parallel interface to pass details of the task farm to or from the calling program. Two parallel strategies have been implemented: in the first, the calling program sets up the task farm and passes the setup information and MPI communicators to DL-FIND, while in the second DL-FIND sets up the task farm and passes the setup information in the opposite direction.

Figure 2: A DL-FIND calculation running under the task-farm parallel framework in ChemShell. The DL-FIND command is executed on the master node of each workgroup while energy and gradient evaluations may be run across all workgroup nodes. The multiple DL-FIND instances share gradient data with each other directly using MPI calls, usually at the end of each optimisation cycle.
When linked to ChemShell the first strategy is the most appropriate as ChemShell sets up a task-farmed environment when it is initialised and DL-FIND must operate within this. This setup is illustrated in Figure 2. Note that DL-FIND communicates directly between workgroups using MPI calls. This usually occurs at the end of each optimisation cycle to share gradient data. A communicator provided by ChemShell called MPI_COMM_COUNTERPARTS is used for this purpose, which groups together the master nodes.

To make the ChemShell environment accessible to DL-FIND, interface subroutines were added to ChemShell to provide the required information about the task farm setup:

Two other interface routines (dlf_put_procinfo and dlf_put_taskfarm) are only used when DL-FIND sets up the taskfarm and are therefore not required for the ChemShell interface. A number of ChemShell routines were written to expose the above information to the interface.

There is a subtle difference between the ChemShell and DL-FIND task-farming environments which has to be reconciled by the interface. On the ChemShell side only the master nodes (one per workgroup) execute ChemShell commands such as DL-FIND calls. However, the DL-FIND parallel routines assume that they are running on all processors. To work around this ChemShell only provides information on the master nodes to DL-FIND so that DL-FIND sees only one node per workgroup. DL-FIND's parallel algorithms can then run unchanged in the ChemShell environment. In practice this means that the `world' communicator passed to DL-FIND is actually MPI_COMM_COUNTERPARTS, the total number of processors is set equal to the number of workgroups and the number of processors per workgroup is set equal to 1. A dummy value can then be sent for MPI_COMM_WORKGROUP.

Tom Keal 2010-06-29