Prior to the ship sinking, Pi's life had been about religion and science. Pi embraced many religions. He used lessons from both disciplines to give him meaning in his life. Once he is stranded on the lifeboat, his life centers more on basic survival than religion or science. His life becomes about surviving. Thus, the meaning of life while he's on the lifeboat is survival. When Pi returns returns to the social world of human beings, he must try to reconcile his pre-lifeboat values with things he had to do to survive. These things included eating meat (he was a vegetarian) and eating human flesh.
I think the author is trying to show how it takes effort to adhere to values especially when basic needs take priority. However, Pi does this in a much larger way by transforming his ordeal into a Biblical type of story. While he must go against some of his values, he does so with the idea that prioritizing his basic needs is part of a larger, more meaningful story: as if it is God working in mysterious ways. So, Pi does use religion in this sense of creating a mythology of the ways he goes about surviving, which are scientific in practice.
thanks that really helped:)