Energy repartition for a harmonic chain with local reservoirs