The geometry of P-manifolds (odd symplectic manifolds) and SP-manifolds (P-manifolds provided with a volume element) is studied. A complete classification of these manifolds is given. This classification is used to prove some results about Batalin-Vilkovisky procedure of quantization, in particular to obtain a very general result about gauge independence of this procedure.