A preliminary vote to choose candidates for an election that doesn't require voters to be registered as Democrats or Republicans is an open primary.
Primaries determine who will represent each party in an election. A Democratic primary, for example, pits two or more Democrats against each other; the primary winner will ultimately face a Republican challenger (and possibly candidates from other parties). In an open primary, any eligible voter can cast a ballot. Some states instead opt for closed primaries, in which only registered party members can vote.