What are the rotating cylinders in monastries, and why are they there? Sorry, as I don't know the right term for them. 

But, I have noticed these huge copper cylinders(when I went to visit a temple in Dharmashala), which are kept like 5-6 in a row.

They have engravings (probably in some script) on them, and they are rotated by the people who are walking past them.

So, what are they?  And what are the engravings on them?  And why people are rotating them?
These are Tibetan Buddhist prayer wheels and they often have 'Om mani padme hum' engraved on them:


  According to Tibetan Buddhist belief, spinning a prayer wheel is just as effective as reciting the sacred texts aloud. This belief derives from the Buddhist belief in the power of sound and the formulas to which deities are subject. For many Buddhists, the prayer wheel also represents the Wheel of the Law (or Dharma) set in motion by the Buddha.
  
  The prayer wheel is also useful for illiterate members of the lay Buddhist community, since they can "read" the prayers by turning the wheel. Prayer wheels come in many sizes: they may be small and attached to a stick, and spun around by hand; medium-sized and set up at monasteries or temples; or very large and continuously spun by a water mill. Prayer wheels at monasteries and temples are located at the gates of the property, and devotees spin the wheels before passing through the gates.
  Prayer Wheels