Barry was “dead” at the time, lost within the Speed Force, so the Flash that Savitar fought was Barry’s nephew Wally West.
Because of his connection to the Speed Force, Savitar is able to travel at nearly the speed of light.
Emerging from the Speed Force, he found himself facing the original Flash, Barry Allen, for the first time.
Unlike The Flash, who found himself compelled to do good when he gained his powers, Savitar became obsessed with speed and likened his newfound powers to that of a god.