This should be prettyThere is a straightforward solution with only two passes through the data:
First compute $$K := \max_i\; a_i,$$
which tells you that, if there are $n$ terms, then $$\sum_i e^{a_i} \le n e^K.$$
Since you presumably don't have $n$ anywhere near as large as even $10^{20}$, you should have no worry about overflowing in the computation of $$\tau := \sum_i e^{a_i-K} \le n$$ in double precision.
Thus, compute $\tau$ and then your solution is $e^K \tau$.