That poem is called The Sun Wields Mercy and can be found in numerous collections (Longshot Pomes for Broke Players, It Catches My Heart in Its Hands, Penguin Modern Poets 13, The Rooming House Madrigals); the last mentioned is the most available.
Watch Ben Gazzara playing Chinaski/Bukowski and reciting this piece (the final scene of the movie) here.
Here's how Bukowski described that final scene of the film:
The movie rolled on and Garabaldi never did get drunk. At the end he’s down at the beach and he’s holding on to the legs of this teeny-bopper in a bathing suit. The waves break behind them and the wind blows through Garabaldi’s hair. He begins to recite a poem about the atom bomb which I wrote a couple of decades ago. He goes on about how pitiless and dumb we were to create the atom monster. He infers that we’ve done this to ourselves before in the long forgotten past, that more than once we’ve blown our chances to shit, and won’t we ever learn? Then he looks up the girl’s legs as the waves break and the gulls whirl.