I assume the pump is a centrifugal pump? If so, each pump comes with a pump curve which shows gpm vs pump head. Head is a hydraulic term but is universal when talking about pumps.
To calculate pump gpm, it depends on a number of factors.... pipe pressure, pipe friction, control valve pressure drop, pipe height etc.
You start by picking 2 points on the pipe where you are interested in the initial & final flow. Then you use Bernouli’s Equation from point 1 to point 2. The pump head is a pressure rise and you use the pump curve to represent this head energy into gpm. You get this by getting an equation head(gpm) from the curve & substitute into the head balance. From this equation, you solve for gpm at the conditions from point 1 to point 2.
i hope this helps. If the pump in question is a positive displacement pump, a piston pump etc, you would a different approach etc!