firstprivate should guarantee that tmax is set to its previous value, which is zero... (as far as I understand the openMP standard...)