Performance analysis and middleware assisted adaptation for quantum chemistry computations