How do we take temperature into account in Ab-initio molecular dynamics simulation? In Ab-initio molecular dynamics simulations, we use Ab-initio methods for calculating the ground state electronic energies of the atomic configurations visited along the dynamics. The atomic forces are then derived by using Hellmann-Feynman theorem, thus they only depend on the calculated ground state electronic wavefunction. 
On the other hand, temperature is a macroscopic property that we measure, and it is a consequence of molecular motion rather than the cause of the molecular motion. 
Then how do we take temperature into account in an MD simulation? What does it mean of running an MD simulation under some temperature? 
 A: The temperature in ab initio molecular dynamics is controlled and/or measured in the same way as in classical molecular dynamics: via the dynamics and the kinetic energy of the nuclei (the "ions" if you like). 
There are several algorithms available: the Nosé-Hoover thermostat is a deterministic approach, the Langevin thermostat is a stochastic one. Assuming that the nuclei are being treated classically, equipartition of energy applies, so the average translational kinetic energy of each atom in 3D is typically $\frac{3}{2}k_BT$ where $k_B$ is Boltzmann's constant. (In the case where Car-Parrinello is combined with path-integral molecular dynamics, to treat the nuclei in a more quantum mechanical way, their dynamical evolution will be different, but it is still possible to derive a suitable algorithm for temperature control, along similar lines to Langevin or Nosé-Hoover).
In your chosen package, you may even specify the temperatures of the electrons and the ions in the same place in the data input. For instance in a copy that I found of the CPMD tutorial by Le Roux, look in sections 2.4 and 2.5. (At the time of writing, the main CPMD website was not responding). But any package should contain a description of the various options for controlling the (ionic) temperature.
All this means that the two subsystems (electrons and ions) are not at thermal equilibrium: they are being maintained at two different temperatures! This is a well known aspect of the approach, and it does not cause problems provided the electron dynamics are well decoupled from the ionic motion. This relies on making a sensible choice of the electron fictitious mass.
There are plenty of resources online to describe the available classical molecular dynamics thermostats: for example you could start with the list at SklogWiki. There are also several books covering molecular simulation, where this topic is described in more detail.
