  A multiclass queueing system is considered, with heterogeneous service
stations, each consisting of many servers with identical capabilities. An
optimal control problem is formulated, where the control corresponds to
scheduling and routing, and the cost is a cumulative discounted functional of
the system's state. We examine two versions of the problem: ``nonpreemptive,''
where service is uninterruptible, and ``preemptive,'' where service to a
customer can be interrupted and then resumed, possibly at a different station.
We study the problem in the asymptotic heavy traffic regime proposed by Halfin
and Whitt, in which the arrival rates and the number of servers at each station
grow without bound. The two versions of the problem are not, in general,
asymptotically equivalent in this regime, with the preemptive version showing
an asymptotic behavior that is, in a sense, much simpler. Under appropriate
assumptions on the structure of the system we show: (i) The value function for
the preemptive problem converges to $V$, the value of a related diffusion
control problem. (ii) The two versions of the problem are asymptotically
equivalent, and in particular nonpreemptive policies can be constructed that
asymptotically achieve the value $V$. The construction of these policies is
based on a Hamilton--Jacobi--Bellman equation associated with $V$.
