  We show that modularity and the gap condition make the holomorphic anomaly
equation completely integrable for non-compact Calabi-Yau manifolds. This leads
to a very efficient formalism to solve the topological string on these
geometries in terms of almost holomorphic modular forms. The formalism provides
in particular holomorphic expansions everywhere in moduli space including large
radius points, the conifold loci, Seiberg-Witten points and the orbifold
points. It can be also viewed as a very efficient method to solve higher genus
closed string amplitudes in the $\frac{1}{N^2}$ expansion of matrix models with
more then one cut.
