Taking into account the relay’s location, we analyze the maximum likelihood (ML) decoding performance ofdualhop relay network, in which two amplify-and-forward (AF) relays employ the Alamouti code in a distributed fashion. In particular, using the well-known moment generating function (MGF) approach we derive the closed-form expressions of the average symbol error probability (SEP) for M-ary phase-shift keying (M-PSK) when the relays are located nearby either the source or destination. The analytical result is obtained as a single integral with finite limits and the integrand composed solely of trigonometric functions. Assessing the asymptotic characteristic of SEP formulas in the high signal-to-noise ratio regime, we show that the distributed-Alamouti protocol achieves a full diversity order. We also perform the Monte-Carlo simulations to validate our analysis. In addition, based on the upper bound of SEP we propose an optimal power allocation between the first-hop (the source-to-relay link) and second-hop (the relay-to-destination link) transmission. We further show that as the two relays are located nearby the destination most of the total power should be allocated to the broadcasting phase (the first-hop transmission). When the two relays are placed close to the source, we propose an optimal transmission scheme which is a non-realtime processing, hence, can be applied for practical applications. It is shown that the optimal power allocation scheme outperforms the equal power scheme with a SEP performance improvement by 2-3 dB.