  Complete evolution of the strongly interacting matter formed in
ultrarelativistic heavy-ion collisions is studied within a coupled Boltzmann
and relativistic viscous hydrodynamics approach. For the initial nonequilibrium
evolution phase, we employ the AMPT model that explicitly includes
event-by-event fluctuations in the number and positions of the participating
nucleons as well as of the produced partons with subsequent parton transport.
The ensuing near-equilibrium evolution of quark-gluon and hadronic matter is
modeled within the (2+1)-dimensional viscous hydrodynamics. We probe the role
of parton dynamics in generating and maintaining the spatial anisotropy in the
preequilibrium phase. Substantial eccentricities epsilon_n are found to be
generated in the event-by-event fluctuations in parton production from initial
nucleon-nucleon collisions. For ultracentral heavy-ion collisions, the model is
able to explain qualitatively the unexpected hierarchy of the harmonic flow
coefficients v_n(p_T)(n=2-6) observed at LHC. We find that the results for
v_n(p_T) are rather insensitive to the variation (within a range) of the time
of switchover from AMPT parton transport to hydrodynamic evolution. The usual
Grad and the recently proposed Chapman-Enskog-like (nonequilibrium)
single-particle distribution functions are found to give very similar results
for v_n(n=2-4). The model describes well both the RHIC and LHC data for
v_n(p_T) at various centralities, with a constant shear viscosity to entropy
density ratio of 0.08 and 0.12, respectively. The event-by-event distributions
of v_{2,3} are in good agreement with the LHC data for midcentral collisions.
The linear response relation v_n = k_n epsilon_n is found to be true for n=2,3,
except at large values of epsilon_n, where a larger value of k_n is required,
suggesting a small admixture of positive nonlinear response even for n=2,3.
