We study the structural properties of the indium phosphide nanorods of different thickness in zinc blende and wurtzite phases by performing classical molecular dynamics simulations using an inter-atomic potential. In addition to different temperatures, the nanorods are also investigated under strain and compression. When the stretch is applied, simulations reveal that the sequence of the irreversible structural transformation for the zinc blende nanorods is zinc blende -> rock salt -> wurtzite and the wurtzite nanorods follow the sequence of wurtzite -> rock salt. After the wurtzite nanorods are compressed and stretched back, the thinner nanorods recover their initial non-deformed structure. Upon heating without stretching, the zinc blende nanorods undergo a transition from the zinc blende phase to the rock salt formation and the wurtzite phase is not observed, whereas the wurtzite nanorods transform from the wurtzite to the rock salt phases. For the wurtzite nanorods, a heating procedure is also carried out at a constant temperature to observe the annealing effect. The wurtzite nanorods are subjected to two approaches processes to observe if the transition processes are reversible: in the first process, the heated wurtzite nanorods are cooled down; in the second process, the cooled nanorods are put under strain. It has been observed that the transition is always irreversible for the nanorods once they are completely transformed into the rock salt phase whereas it is usually reversible for the nanorods before the complete transition into the rock salt phase has occurred. The reversible transition is also observed as the cooled nanorod is stretched back.