diff --git a/include/lsgrmGraphOperations.txx b/include/lsgrmGraphOperations.txx
index 1a64a72ab956f6f55710e88fd53fbfffab87967b..203063ce7ce2dc888e73f0b633b945ed4c92176f 100644
--- a/include/lsgrmGraphOperations.txx
+++ b/include/lsgrmGraphOperations.txx
@@ -175,7 +175,9 @@ long long unsigned int RunPartialSegmentation(const typename TSegmenter::ParamTy
     {
     for(unsigned int col = 0; col < nbTilesX; col++)
       {
+#ifdef OTB_USE_MPI
       if (MyTurn(row*nbTilesX + col))
+#endif
         {
         // Get the current tile
         std::cout << "Processing tile " << row << ", " << col << std::endl;
@@ -252,7 +254,9 @@ long long unsigned int RunPartialSegmentation(const typename TSegmenter::ParamTy
     {
     for(unsigned int col = 0; col < nbTilesX; col++)
       {
+#ifdef OTB_USE_MPI
       if (MyTurn(row*nbTilesX + col))
+#endif
         {
         // Get current tile
         ProcessingTile currentTile = tiles[row*nbTilesX + col];
@@ -653,7 +657,9 @@ long long unsigned int RunFirstPartialSegmentation(
     {
     for(unsigned int col = 0; col < nbTilesX; col++)
       {
+#ifdef OTB_USE_MPI
       if (MyTurn(row*nbTilesX + col))
+#endif
         {
         // Reading images
         ProcessingTile currentTile = tiles[row*nbTilesX + col];
diff --git a/include/lsgrmHeader.h b/include/lsgrmHeader.h
index 877da15577b4ded2d23ad3caa44a7fee271c6610..35bca3c9aa54d4e617e55030a480dad44a212584 100644
--- a/include/lsgrmHeader.h
+++ b/include/lsgrmHeader.h
@@ -21,27 +21,26 @@
 #include "otbImageFileWriter.h"
 #endif
 
+/* MPI related functions */
+
+#ifdef OTB_USE_MPI
 /*
  * This function returns TRUE if the process #myrank is assigned
  * to the task #div in a pool of #nprocs processes
  */
 bool MyTurn(int div = 0)
 {
-#ifdef OTB_USE_MPI
   otb::MPIConfig::Pointer mpiConfig = otb::MPIConfig::Instance();
   unsigned int proc = 0;
   if (mpiConfig->GetNbProcs() != 0)
     proc = div % mpiConfig->GetNbProcs();
   return (proc == mpiConfig->GetMyRank());
-#endif
-  return true;
 }
 
 /*
  * This function gather the given value in other process, and update it
  * TODO: MPI implementation using OTB MPI Wrapper
  */
-#ifdef OTB_USE_MPI
 template<typename T>
 void GatherMe(T& x, MPI_Datatype dataType)
 {
@@ -166,21 +165,17 @@ void BroadcastImage(typename TImageType::Pointer & inPtr)
         it1.Set(it2.Get());
         }
       } // recopy image
-
     } // while data to transmit
 
 }
 
 
-#endif
-
 /*
  * Gather accumulatedMemory and isFusion variables
  * TODO: MPI implementation using OTB MPI Wrapper
  */
 void GatherUsefulVariables(unsigned long long int& accumulatedMemory, bool& isFusion)
 {
-#ifdef OTB_USE_MPI
   otb::MPIConfig::Instance()->barrier();
   int isFusionInteger = 0;
   long long int accumulatedMemoryLLI = static_cast<long long int>(accumulatedMemory);
@@ -191,9 +186,11 @@ void GatherUsefulVariables(unsigned long long int& accumulatedMemory, bool& isFu
   accumulatedMemory = static_cast<long long unsigned int>(accumulatedMemoryLLI);
   if (isFusionInteger>0)
     isFusion = true;
-#endif
 }
 
+
+#endif
+
 /*
  * Print time elapsed
  */