     | x < 0             = error "Negative Rank value"
     | otherwise         = MkRank (fromIntegral x)
 
-foreign import ccall "&mpi_any_source" anySource_ :: Ptr Int
-foreign import ccall "&mpi_root" theRoot_ :: Ptr Int
-foreign import ccall "&mpi_proc_null" procNull_ :: Ptr Int
+foreign import ccall "&mpi_any_source" anySource_ :: Ptr CInt
+foreign import ccall "&mpi_root" theRoot_ :: Ptr CInt
+foreign import ccall "&mpi_proc_null" procNull_ :: Ptr CInt
 foreign import ccall "&mpi_request_null" requestNull_ :: Ptr MPIRequest
 foreign import ccall "&mpi_comm_null" commNull_ :: Ptr MPIComm
 

Attempt to supply a value that does not fit into 32 bits will cause a
run-time 'error'.
-}
newtype Rank = MkRank { rankId :: Int -- ^ Extract numeric value of the 'Rank'
                      }
   deriving (Eq, Ord, Enum, Integral, Real)



-- | Map arbitrary 'Enum' value to 'Rank'
toRank :: Enum a => a -> Rank
toRank x = MkRank { rankId = cIntConv (fromEnum x) }

-- | Map 'Rank' to arbitrary 'Enum'
fromRank :: Enum a => Rank -> a
fromRank = toEnum . cIntConv . rankId

type MPIRequest = {# type MPI_Request #}
{-| Haskell representation of the @MPI_Request@ type. Returned by
