CTextureBoo: Make use of std::array where applicable

Allows dehardcoding some array sizes.

--- Runtime/Graphics/CTextureBoo.cpp
+++ Runtime/Graphics/CTextureBoo.cpp
@@ -1,4 +1,6 @@
 #include "Runtime/Graphics/CTexture.hpp"
+
+#include <array>

 #include "Runtime/CSimplePool.hpp"
 #include "Runtime/CToken.hpp"
@@ -20,7 +22,7 @@
 struct DXT1Block {
   u16 color1;
   u16 color2;
-  u8 lines[4];
+  std::array<u8, 4> lines;
 };

 /* GX uses this upsampling technique to extract full 8-bit range */
@@ -74,24 +76,24 @@
 }

 void CTexture::BuildI4FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 7) / 8;
-    int bheight = (h + 7) / 8;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 8;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 8;
+    const int bwidth = (w + 7) / 8;
+    const int bheight = (h + 7) / 8;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 8;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 8;
         for (int y = 0; y < 8; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u8 source[4];
-          in.readBytesToBuf(source, 4);
-          for (int x = 0; x < 8; ++x) {
+          std::array<u8, 4> source;
+          in.readBytesToBuf(source.data(), source.size());
+          for (size_t x = 0; x < 8; ++x) {
             target[x].r = Convert4To8(source[x / 2] >> ((x & 1) ? 0 : 4) & 0xf);
             target[x].g = target[x].r;
             target[x].b = target[x].r;
@@ -101,10 +103,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -116,24 +120,24 @@
 }

 void CTexture::BuildI8FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 7) / 8;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 8;
+    const int bwidth = (w + 7) / 8;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 8;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u8 source[8];
-          in.readBytesToBuf(source, 8);
-          for (int x = 0; x < 8; ++x) {
+          std::array<u8, 8> source;
+          in.readBytesToBuf(source.data(), source.size());
+          for (size_t x = 0; x < source.size(); ++x) {
             target[x].r = source[x];
             target[x].g = source[x];
             target[x].b = source[x];
@@ -143,10 +147,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -158,25 +164,25 @@
 }

 void CTexture::BuildIA4FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 7) / 8;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 8;
+    const int bwidth = (w + 7) / 8;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 8;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u8 source[8];
-          in.readBytesToBuf(source, 8);
-          for (int x = 0; x < 8; ++x) {
-            u8 intensity = Convert4To8(source[x] >> 4 & 0xf);
+          std::array<u8, 8> source;
+          in.readBytesToBuf(source.data(), source.size());
+          for (size_t x = 0; x < source.size(); ++x) {
+            const u8 intensity = Convert4To8(source[x] >> 4 & 0xf);
             target[x].r = intensity;
             target[x].g = intensity;
             target[x].b = intensity;
@@ -186,10 +192,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -201,25 +209,25 @@
 }

 void CTexture::BuildIA8FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 3) / 4;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 4;
+    const int bwidth = (w + 3) / 4;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 4;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u16 source[4];
-          in.readBytesToBuf(source, 8);
-          for (int x = 0; x < 4; ++x) {
-            u8 intensity = source[x] >> 8;
+          std::array<u16, 4> source;
+          in.readBytesToBuf(source.data(), sizeof(source));
+          for (size_t x = 0; x < source.size(); ++x) {
+            const u8 intensity = source[x] >> 8;
             target[x].r = intensity;
             target[x].g = intensity;
             target[x].b = intensity;
@@ -229,10 +237,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -285,7 +295,7 @@
 }

 void CTexture::BuildC4FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);
   std::vector<RGBA8> palette = DecodePalette(16, in);

@@ -293,26 +303,29 @@
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 7) / 8;
-    int bheight = (h + 7) / 8;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 8;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 8;
+    const int bwidth = (w + 7) / 8;
+    const int bheight = (h + 7) / 8;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 8;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 8;
         for (int y = 0; y < 8; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u8 source[4];
-          in.readBytesToBuf(source, 4);
-          for (int x = 0; x < 8; ++x)
+          std::array<u8, 4> source;
+          in.readBytesToBuf(source.data(), source.size());
+          for (size_t x = 0; x < 8; ++x) {
             target[x] = palette[source[x / 2] >> ((x & 1) ? 0 : 4) & 0xf];
+          }
         }
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -324,7 +337,7 @@
 }

 void CTexture::BuildC8FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);
   std::vector<RGBA8> palette = DecodePalette(256, in);

@@ -332,26 +345,29 @@
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 7) / 8;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 8;
+    const int bwidth = (w + 7) / 8;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 8;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          u8 source[8];
-          in.readBytesToBuf(source, 8);
-          for (int x = 0; x < 8; ++x)
+          std::array<u8, 8> source;
+          in.readBytesToBuf(source.data(), source.size());
+          for (size_t x = 0; x < source.size(); ++x) {
             target[x] = palette[source[x]];
+          }
         }
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -365,23 +381,23 @@
 void CTexture::BuildC14X2FromGCN(CInputStream& in) {}

 void CTexture::BuildRGB565FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 3) / 4;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 4;
+    const int bwidth = (w + 3) / 4;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 4;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          for (int x = 0; x < 4; ++x) {
-            u16 texel = in.readUint16Big();
+          for (size_t x = 0; x < 4; ++x) {
+            const u16 texel = in.readUint16Big();
             target[x].r = Convert5To8(texel >> 11 & 0x1f);
             target[x].g = Convert6To8(texel >> 5 & 0x3f);
             target[x].b = Convert5To8(texel & 0x1f);
@@ -391,10 +407,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -413,17 +431,17 @@
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 3) / 4;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 4;
+    const int bwidth = (w + 3) / 4;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 4;
         for (int y = 0; y < 4; ++y) {
           RGBA8* target = targetMip + (baseY + y) * w + baseX;
-          for (int x = 0; x < 4; ++x) {
-            u16 texel = in.readUint16Big();
-            if (texel & 0x8000) {
+          for (size_t x = 0; x < 4; ++x) {
+            const u16 texel = in.readUint16Big();
+            if ((texel & 0x8000) != 0) {
               target[x].r = Convert5To8(texel >> 10 & 0x1f);
               target[x].g = Convert5To8(texel >> 5 & 0x1f);
               target[x].b = Convert5To8(texel & 0x1f);
@@ -439,10 +457,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -454,26 +474,26 @@
 }

 void CTexture::BuildRGBA8FromGCN(CInputStream& in) {
-  size_t texelCount = ComputeMippedTexelCount();
+  const size_t texelCount = ComputeMippedTexelCount();
   std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount]);

   int w = x4_w;
   int h = x6_h;
   RGBA8* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 3) / 4;
-    int bheight = (h + 3) / 4;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 4;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 4;
+    const int bwidth = (w + 3) / 4;
+    const int bheight = (h + 3) / 4;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 4;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 4;
         for (int c = 0; c < 2; ++c) {
           for (int y = 0; y < 4; ++y) {
             RGBA8* target = targetMip + (baseY + y) * w + baseX;
-            u8 source[8];
-            in.readBytesToBuf(source, 8);
-            for (int x = 0; x < 4; ++x) {
-              if (c) {
+            std::array<u8, 8> source;
+            in.readBytesToBuf(source.data(), source.size());
+            for (size_t x = 0; x < 4; ++x) {
+              if (c != 0) {
                 target[x].g = source[x * 2];
                 target[x].b = source[x * 2 + 1];
               } else {
@@ -486,10 +506,12 @@
       }
     }
     targetMip += w * h;
-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -501,29 +523,29 @@
 }

 void CTexture::BuildDXT1FromGCN(CInputStream& in) {
-  size_t blockCount = ComputeMippedBlockCountDXT1();
+  const size_t blockCount = ComputeMippedBlockCountDXT1();
   std::unique_ptr<DXT1Block[]> buf(new DXT1Block[blockCount]);

   int w = x4_w / 4;
   int h = x6_h / 4;
   DXT1Block* targetMip = buf.get();
   for (u32 mip = 0; mip < x8_mips; ++mip) {
-    int bwidth = (w + 1) / 2;
-    int bheight = (h + 1) / 2;
-    for (int by = 0; by < bheight; ++by) {
-      int baseY = by * 2;
-      for (int bx = 0; bx < bwidth; ++bx) {
-        int baseX = bx * 2;
+    const int bwidth = (w + 1) / 2;
+    const int bheight = (h + 1) / 2;
+    for (int by = 0; by < bheight; ++by) {
+      const int baseY = by * 2;
+      for (int bx = 0; bx < bwidth; ++bx) {
+        const int baseX = bx * 2;
         for (int y = 0; y < 2; ++y) {
           DXT1Block* target = targetMip + (baseY + y) * w + baseX;
-          DXT1Block source[2];
-          in.readBytesToBuf(source, 16);
-          for (int x = 0; x < 2; ++x) {
+          std::array<DXT1Block, 2> source;
+          in.readBytesToBuf(source.data(), sizeof(source));
+          for (size_t x = 0; x < source.size(); ++x) {
             target[x].color1 = hecl::SBig(source[x].color1);
             target[x].color2 = hecl::SBig(source[x].color2);
-            for (u32 i = 0; i < 4; ++i) {
-              u8 ind[4];
-              u8 packed = source[x].lines[i];
+            for (size_t i = 0; i < 4; ++i) {
+              std::array<u8, 4> ind;
+              const u8 packed = source[x].lines[i];
               ind[3] = packed & 0x3;
               ind[2] = (packed >> 2) & 0x3;
               ind[1] = (packed >> 4) & 0x3;
@@ -536,10 +558,12 @@
     }
     targetMip += w * h;

-    if (w > 1)
-      w /= 2;
-    if (h > 1)
-      h /= 2;
+    if (w > 1) {
+      w /= 2;
+    }
+    if (h > 1) {
+      h /= 2;
+    }
   }

   CGraphics::CommitResources([&](boo::IGraphicsDataFactory::Context& ctx) {
@@ -604,10 +628,9 @@
     break;
   }

-  uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
+  const uint32_t nentries = hecl::SBig(*reinterpret_cast<const uint32_t*>(data));
   const u8* texels = reinterpret_cast<const u8*>(data) + 4 + nentries * 4;
-  std::unique_ptr<RGBA8[]> buf(new RGBA8[texelCount * layerCount]);
-  memset(buf.get(), 0, texelCount * layerCount * 4);
+  auto buf = std::make_unique<RGBA8[]>(texelCount * layerCount);

   size_t w = x4_w;
   size_t h = x6_h;


Clean debug output

Clean debug output

--- src/plugins/projectexplorer/editorsettingspropertiespage.cpp
+++ src/plugins/projectexplorer/editorsettingspropertiespage.cpp
@@ -96,8 +96,6 @@

     defaultTextCodec = m_project->editorConfiguration()->defaultTextCodec();

-    qDebug() << "create editor settings widget for project with encoding" << defaultTextCodec;
-
     QList<int> mibs = QTextCodec::availableMibs();
     qSort(mibs);
     QList<int> sortedMibs;


reduce multiplicity bin for pp analysis

reduce multiplicity bin for pp analysis

--- PWGCF/Correlations/DPhi/AliAnalysisTaskSEpPbCorrelationsYS.cxx
+++ PWGCF/Correlations/DPhi/AliAnalysisTaskSEpPbCorrelationsYS.cxx
@@ -1203,6 +1203,7 @@
    //multiplicity

    const Double_t binning_mult_trig[10]={0,10,15,20,30,40,50,80,110,140};//multiplicity pp and pPb
+   const Double_t binning_mult_pp[8]={0,10,15,20,30,60,80,110};//multiplicity pp and pPb
    const Double_t binning_mult_pbpb[10]={0,30,80,100,300,500,1000,1500,2000,2500};//multiplicity pp and pPb

@@ -1216,7 +1217,8 @@
    //centrality bin
    Int_t ncentbin;
    if(fCentType=="Manual") {
-     ncentbin=9;
+     if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP")) ncentbin=7;
+     else ncentbin=9;
    }else {
      if (fcollisiontype=="PbPb") ncentbin=8;
      else ncentbin=7;
@@ -1273,7 +1275,8 @@
      const Int_t iEvtBinV0Leading[3]={ncentbin,nfmdbin,10};
      fHistTriggerTrack= new AliTHn("fHistTriggerTrack", "fHistTriggerTrack", nCFStepstrig, nEvtVarsV0Leading, iEvtBinV0Leading);
      if(fCentType=="Manual"){
-       fHistTriggerTrack->SetBinLimits(0,binning_mult_trig);
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP"))       fHistTriggerTrack->SetBinLimits(0,binning_mult_pp);
+       else  fHistTriggerTrack->SetBinLimits(0,binning_mult_trig);
      }else{
        if(fcollisiontype.Contains("HMPP"))  fHistTriggerTrack->SetBinLimits(0,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")  fHistTriggerTrack->SetBinLimits(0, binning_cent_MBPP);
@@ -1326,8 +1329,9 @@
      else fHistTriggerTrack->SetBinLimits(0,fPtMin, fPtMax);

      if(fCentType=="Manual"){
-       fHistTriggerTrack->SetBinLimits(1,binning_mult_trig);
-     }else{
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP"))       fHistTriggerTrack->SetBinLimits(1,binning_mult_pp);
+       else  fHistTriggerTrack->SetBinLimits(1,binning_mult_trig);
+      }else{
        if(fcollisiontype.Contains("HMPP"))  fHistTriggerTrack->SetBinLimits(1,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")  fHistTriggerTrack->SetBinLimits(1,binning_cent_MBPP);
        else if(fcollisiontype=="PbPb")  fHistTriggerTrack->SetBinLimits(1, binning_cent_fmdfmd_PbPb);
@@ -1555,7 +1559,8 @@
      else fHistReconstTrack->SetBinLimits(1,fPtMin,fPtMax);

      if(fCentType=="Manual"){
-       fHistReconstTrack->SetBinLimits(3,binning_mult_trig);
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP")) fHistReconstTrack->SetBinLimits(3,binning_mult_pp);
+       else fHistReconstTrack->SetBinLimits(3,binning_mult_trig);
      }else{
        if(fcollisiontype.Contains("HMPP")) fHistReconstTrack->SetBinLimits(3,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")fHistReconstTrack->SetBinLimits(3,binning_cent_MBPP);
@@ -1579,7 +1584,10 @@
      else fHistReconstTrackMix->SetBinLimits(1,fPtMin,fPtMax);

      if(fCentType=="Manual"){
-       fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP")) fHistReconstTrackMix->SetBinLimits(3,binning_mult_pp);
+       else fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
+
+       //fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
      }else{
        if(fcollisiontype.Contains("HMPP")) fHistReconstTrackMix->SetBinLimits(3,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")fHistReconstTrackMix->SetBinLimits(3,binning_cent_MBPP);
@@ -1632,7 +1640,10 @@
        fHistReconstTrack->SetBinLimits(2,binning_etafmdc);
      }
      if(fCentType=="Manual"){
-       fHistReconstTrack->SetBinLimits(3,binning_mult_trig);
+       //fHistReconstTrack->SetBinLimits(3,binning_mult_trig);
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP")) fHistReconstTrack->SetBinLimits(3,binning_mult_pp);
+       else fHistReconstTrack->SetBinLimits(3,binning_mult_trig);
+
      }else{
        if(fcollisiontype.Contains("HMPP"))  fHistReconstTrack->SetBinLimits(3,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")fHistReconstTrack->SetBinLimits(3,binning_cent_MBPP);
@@ -1660,7 +1671,10 @@
        fHistReconstTrackMix->SetBinLimits(2,binning_etafmdc);
      }
      if(fCentType=="Manual"){
-       fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
+       //fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
+       if(fcollisiontype.Contains("HMPP")||fcollisiontype.Contains("MBPP")) fHistReconstTrackMix->SetBinLimits(3,binning_mult_pp);
+       else fHistReconstTrackMix->SetBinLimits(3,binning_mult_trig);
+
      }else{
        if(fcollisiontype.Contains("HMPP"))fHistReconstTrackMix->SetBinLimits(3,binning_cent_HMPP);
        else if(fcollisiontype=="MBPP")fHistReconstTrackMix->SetBinLimits(3,binning_cent_MBPP);
@@ -2116,11 +2130,13 @@
    */
    // Multiplicity Object
    if(fcollisiontype=="HMPPSPD" && fcuthighmult>0){
+
      AliVMultiplicity *tracklets = ((AliAODEvent*)fEvent)->GetTracklets();
      //    if (!tracklets) return;
      Int_t nTracklets = tracklets->GetNumberOfTracklets();
      Int_t nITScluster= tracklets->GetNumberOfITSClusters(0)+tracklets->GetNumberOfITSClusters(1);
      Int_t nTracks = fEvent->GetNumberOfTracks();
+
      fh2_SPD_multcorr->Fill(nTracklets,nITScluster);
      fh2_SPDtrack_multcorr->Fill(nTracklets,nTracks);
      if(nTracklets<fcuthighmult){


Correct indentation for loops over iInst.

--- SU2_CFD/src/driver_structure.cpp
+++ SU2_CFD/src/driver_structure.cpp
@@ -146,10 +146,10 @@

     geometry_container[iZone] = new CGeometry** [nInst[iZone]];
     for (iInst = 0; iInst < nInst[iZone]; iInst++){
-    geometry_container[iZone][iInst] = NULL;
-
-    geometry_container[iZone][iInst] = new CGeometry *[config_container[iZone]->GetnMGLevels()+1];
-    geometry_container[iZone][iInst][MESH_0] = new CPhysicalGeometry(geometry_aux, config_container[iZone]);
+      geometry_container[iZone][iInst] = NULL;
+
+      geometry_container[iZone][iInst] = new CGeometry *[config_container[iZone]->GetnMGLevels()+1];
+      geometry_container[iZone][iInst][MESH_0] = new CPhysicalGeometry(geometry_aux, config_container[iZone]);

     }

@@ -161,13 +161,13 @@

     for (iInst = 0; iInst < nInst[iZone]; iInst++){

-    /*--- Add the Send/Receive boundaries ---*/
-
-    geometry_container[iZone][iInst][MESH_0]->SetSendReceive(config_container[iZone]);
-
-    /*--- Add the Send/Receive boundaries ---*/
-
-    geometry_container[iZone][iInst][MESH_0]->SetBoundaries(config_container[iZone]);
+      /*--- Add the Send/Receive boundaries ---*/
+
+      geometry_container[iZone][iInst][MESH_0]->SetSendReceive(config_container[iZone]);
+
+      /*--- Add the Send/Receive boundaries ---*/
+
+      geometry_container[iZone][iInst][MESH_0]->SetBoundaries(config_container[iZone]);

     }

@@ -187,28 +187,28 @@

     for (iInst = 0; iInst < nInst[iZone]; iInst++){

-    /*--- Computation of wall distances for turbulence modeling ---*/
-
-    if (rank == MASTER_NODE)
-      cout << "Computing wall distances." << endl;
-
-    if ((config_container[iZone]->GetKind_Solver() == RANS) ||
-        (config_container[iZone]->GetKind_Solver() == ADJ_RANS) ||
-        (config_container[iZone]->GetKind_Solver() == DISC_ADJ_RANS))
-      geometry_container[iZone][iInst][MESH_0]->ComputeWall_Distance(config_container[iZone]);
-
-    /*--- Computation of positive surface area in the z-plane which is used for
+      /*--- Computation of wall distances for turbulence modeling ---*/
+
+      if (rank == MASTER_NODE)
+        cout << "Computing wall distances." << endl;
+
+      if ((config_container[iZone]->GetKind_Solver() == RANS) ||
+          (config_container[iZone]->GetKind_Solver() == ADJ_RANS) ||
+          (config_container[iZone]->GetKind_Solver() == DISC_ADJ_RANS))
+        geometry_container[iZone][iInst][MESH_0]->ComputeWall_Distance(config_container[iZone]);
+
+      /*--- Computation of positive surface area in the z-plane which is used for
      the calculation of force coefficient (non-dimensionalization). ---*/

-    geometry_container[iZone][iInst][MESH_0]->SetPositive_ZArea(config_container[iZone]);
-
-    /*--- Set the near-field, interface and actuator disk boundary conditions, if necessary. ---*/
-
-    for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
-      geometry_container[iZone][iInst][iMesh]->MatchNearField(config_container[iZone]);
-      geometry_container[iZone][iInst][iMesh]->MatchInterface(config_container[iZone]);
-      geometry_container[iZone][iInst][iMesh]->MatchActuator_Disk(config_container[iZone]);
-    }
+      geometry_container[iZone][iInst][MESH_0]->SetPositive_ZArea(config_container[iZone]);
+
+      /*--- Set the near-field, interface and actuator disk boundary conditions, if necessary. ---*/
+
+      for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
+        geometry_container[iZone][iInst][iMesh]->MatchNearField(config_container[iZone]);
+        geometry_container[iZone][iInst][iMesh]->MatchInterface(config_container[iZone]);
+        geometry_container[iZone][iInst][iMesh]->MatchActuator_Disk(config_container[iZone]);
+      }

     }

@@ -313,23 +313,23 @@
     solver_container[iZone] = new CSolver*** [nInst[iZone]];

     for (iInst = 0; iInst < nInst[iZone]; iInst++){
-       solver_container[iZone][iInst] = NULL;
-
-     if (rank == MASTER_NODE)
-       cout << endl <<"------------------------- Solver Preprocessing --------------------------" << endl;
-
-    solver_container[iZone][iInst] = new CSolver** [config_container[iZone]->GetnMGLevels()+1];
-    for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++)
-      solver_container[iZone][iInst][iMesh] = NULL;
-
-    for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
-      solver_container[iZone][iInst][iMesh] = new CSolver* [MAX_SOLS];
-      for (iSol = 0; iSol < MAX_SOLS; iSol++)
-        solver_container[iZone][iInst][iMesh][iSol] = NULL;
-    }
-
-    Solver_Preprocessing(solver_container[iZone], geometry_container[iZone],
-        config_container[iZone], iInst);
+      solver_container[iZone][iInst] = NULL;
+
+      if (rank == MASTER_NODE)
+        cout << endl <<"------------------------- Solver Preprocessing --------------------------" << endl;
+
+      solver_container[iZone][iInst] = new CSolver** [config_container[iZone]->GetnMGLevels()+1];
+      for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++)
+        solver_container[iZone][iInst][iMesh] = NULL;
+
+      for (iMesh = 0; iMesh <= config_container[iZone]->GetnMGLevels(); iMesh++) {
+        solver_container[iZone][iInst][iMesh] = new CSolver* [MAX_SOLS];
+        for (iSol = 0; iSol < MAX_SOLS; iSol++)
+          solver_container[iZone][iInst][iMesh][iSol] = NULL;
+      }
+
+      Solver_Preprocessing(solver_container[iZone], geometry_container[iZone],
+          config_container[iZone], iInst);

     } // End of loop over iInst

@@ -346,10 +346,10 @@
     for (iInst = 0; iInst < nInst[iZone]; iInst++){
       integration_container[iZone][iInst] = NULL;

-    integration_container[iZone][iInst] = new CIntegration*[MAX_SOLS];
-    Integration_Preprocessing(integration_container[iZone], geometry_container[iZone],
-                              config_container[iZone], iInst);
-    } // End of loop over iInst
+      integration_container[iZone][iInst] = new CIntegration*[MAX_SOLS];
+      Integration_Preprocessing(integration_container[iZone], geometry_container[iZone],
+          config_container[iZone], iInst);
+    }

     if (rank == MASTER_NODE) cout << "Integration Preprocessing." << endl;

@@ -364,11 +364,11 @@
     for (iInst = 0; iInst < nInst[iZone]; iInst++){
       numerics_container[iZone][iInst] = NULL;

-    numerics_container[iZone][iInst] = new CNumerics***[config_container[iZone]->GetnMGLevels()+1];
-
-    Numerics_Preprocessing(numerics_container[iZone], solver_container[iZone],
-        geometry_container[iZone], config_container[iZone], iInst);
-    } // End of loop over iInst
+      numerics_container[iZone][iInst] = new CNumerics***[config_container[iZone]->GetnMGLevels()+1];
+
+      Numerics_Preprocessing(numerics_container[iZone], solver_container[iZone],
+          geometry_container[iZone], config_container[iZone], iInst);
+    }

     if (rank == MASTER_NODE) cout << "Numerics Preprocessing." << endl;

@@ -392,7 +392,6 @@
         interpolator_container[iZone][jZone]         = NULL;
       }
     }
-
     Interface_Preprocessing();
   }

@@ -436,27 +435,27 @@
        This computes the derivative of the volume mesh with respect to the surface nodes ---*/

       for (iInst = 0; iInst < nInst[iZone]; iInst++){
-      grid_movement[iZone][iInst]->SetVolume_Deformation(geometry_container[iZone][iInst][MESH_0],config_container[iZone], true, true);
-
-      /*--- Update the multi-grid structure to propagate the derivative information to the coarser levels ---*/
-
-      geometry_container[iZone][iInst][MESH_0]->UpdateGeometry(geometry_container[iZone][INST_0],config_container[iZone]);
-
-      /*--- Set the derivative of the wall-distance with respect to the surface nodes ---*/
-
-      if ( (config_container[iZone]->GetKind_Solver() == RANS) ||
-          (config_container[iZone]->GetKind_Solver() == ADJ_RANS) ||
-          (config_container[iZone]->GetKind_Solver() == DISC_ADJ_RANS))
-        geometry_container[iZone][iInst][MESH_0]->ComputeWall_Distance(config_container[iZone]);
-    }
+        grid_movement[iZone][iInst]->SetVolume_Deformation(geometry_container[iZone][iInst][MESH_0],config_container[iZone], true, true);
+
+        /*--- Update the multi-grid structure to propagate the derivative information to the coarser levels ---*/
+
+        geometry_container[iZone][iInst][MESH_0]->UpdateGeometry(geometry_container[iZone][INST_0],config_container[iZone]);
+
+        /*--- Set the derivative of the wall-distance with respect to the surface nodes ---*/
+
+        if ( (config_container[iZone]->GetKind_Solver() == RANS) ||
+            (config_container[iZone]->GetKind_Solver() == ADJ_RANS) ||
+            (config_container[iZone]->GetKind_Solver() == DISC_ADJ_RANS))
+          geometry_container[iZone][iInst][MESH_0]->ComputeWall_Distance(config_container[iZone]);
+      }
     }

     if (config_container[iZone]->GetKind_GridMovement(iZone) == FLUID_STRUCTURE_STATIC){
       if (rank == MASTER_NODE)
         cout << "Setting moving mesh structure for static FSI problems." << endl;
-        /*--- Instantiate the container for the grid movement structure ---*/
+      /*--- Instantiate the container for the grid movement structure ---*/
       for (iInst = 0; iInst < nInst[iZone]; iInst++)
-      grid_movement[iZone][iInst] = new CElasticityMovement(geometry_container[iZone][iInst][MESH_0], config_container[iZone]);
+        grid_movement[iZone][iInst] = new CElasticityMovement(geometry_container[iZone][iInst][MESH_0], config_container[iZone]);
     }

   }
@@ -508,8 +507,8 @@
     for (iZone = 0; iZone < nZone; iZone++) {
       ConvHist_file[iZone] = new ofstream[nInst[iZone]];
       for (iInst = 0; iInst < nInst[iZone]; iInst++) {
-      output->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst);
-      config_container[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]);
+        output->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst);
+        config_container[iZone]->SetHistFile(&ConvHist_file[iZone][INST_0]);
       }
     }
   }
@@ -558,7 +557,7 @@
     /*--- Close the convergence history file. ---*/
     for (iZone = 0; iZone < nZone; iZone++) {
       for (iInst = 0; iInst < nInst[iZone]; iInst++) {
-      ConvHist_file[iZone][iInst].close();
+        ConvHist_file[iZone][iInst].close();
       }
       delete [] ConvHist_file[iZone];
     }
@@ -570,34 +569,34 @@
     cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl;

   for (iZone = 0; iZone < nZone; iZone++) {
-     for (iInst = 0; iInst < nInst[iZone]; iInst++){
-     Numerics_Postprocessing(numerics_container[iZone], solver_container[iZone][iInst],
-     geometry_container[iZone][iInst], config_container[iZone], iInst);
-     }
-     delete [] numerics_container[iZone];
+    for (iInst = 0; iInst < nInst[iZone]; iInst++){
+      Numerics_Postprocessing(numerics_container[iZone], solver_container[iZone][iInst],
+          geometry_container[iZone][iInst], config_container[iZone], iInst);
+    }
+    delete [] numerics_container[iZone];
   }
   delete [] numerics_container;
   if (rank == MASTER_NODE) cout << "Deleted CNumerics container." << endl;

   for (iZone = 0; iZone < nZone; iZone++) {
-	for (iInst = 0; iInst < nInst[iZone]; iInst++){
-    Integration_Postprocessing(integration_container[iZone],
-                               geometry_container[iZone][iInst],
-                               config_container[iZone],
-                               iInst);
-	}
+    for (iInst = 0; iInst < nInst[iZone]; iInst++){
+      Integration_Postprocessing(integration_container[iZone],
+          geometry_container[iZone][iInst],
+          config_container[iZone],
+          iInst);
+    }
     delete [] integration_container[iZone];
   }
   delete [] integration_container;
   if (rank == MASTER_NODE) cout << "Deleted CIntegration container." << endl;

   for (iZone = 0; iZone < nZone; iZone++) {
-	for (iInst = 0; iInst < nInst[iZone]; iInst++){
-    Solver_Postprocessing(solver_container[iZone],
-                          geometry_container[iZone][iInst],
-                          config_container[iZone],
-                          iInst);
-	}
+    for (iInst = 0; iInst < nInst[iZone]; iInst++){
+      Solver_Postprocessing(solver_container[iZone],
+          geometry_container[iZone][iInst],
+          config_container[iZone],
+          iInst);
+    }
     delete [] solver_container[iZone];
   }
   delete [] solver_container;
@@ -613,8 +612,8 @@

   if (interpolator_container != NULL) {
     for (iZone = 0; iZone < nZone; iZone++) {
-    if (interpolator_container[iZone] != NULL){
-            delete [] interpolator_container[iZone];
+      if (interpolator_container[iZone] != NULL){
+        delete [] interpolator_container[iZone];
       }
     }
     delete [] interpolator_container;
@@ -645,10 +644,10 @@
   for (iZone = 0; iZone < nZone; iZone++) {
     if (geometry_container[iZone] != NULL) {
       for (iInst = 0; iInst < nInst[iZone]; iInst++){
-      for (unsigned short iMGlevel = 0; iMGlevel < config_container[iZone]->GetnMGLevels()+1; iMGlevel++) {
-        if (geometry_container[iZone][iInst][iMGlevel] != NULL) delete geometry_container[iZone][iInst][iMGlevel];
-      }
-      if (geometry_container[iZone][iInst] != NULL) delete geometry_container[iZone][iInst];
+        for (unsigned short iMGlevel = 0; iMGlevel < config_container[iZone]->GetnMGLevels()+1; iMGlevel++) {
+          if (geometry_container[iZone][iInst][iMGlevel] != NULL) delete geometry_container[iZone][iInst][iMGlevel];
+        }
+        if (geometry_container[iZone][iInst] != NULL) delete geometry_container[iZone][iInst];
       }
       delete [] geometry_container[iZone];
     }
@@ -819,44 +818,44 @@

     for (iInst = 0; iInst < nInst[iZone]; iInst++){

-    /*--- Loop over all the new grid ---*/
-
-    for (iMGlevel = 1; iMGlevel <= config_container[iZone]->GetnMGLevels(); iMGlevel++) {
-
-      /*--- Create main agglomeration structure ---*/
-
-      geometry_container[iZone][iInst][iMGlevel] = new CMultiGridGeometry(geometry_container, config_container, iMGlevel, iZone, iInst);
-
-      /*--- Compute points surrounding points. ---*/
-
-      geometry_container[iZone][iInst][iMGlevel]->SetPoint_Connectivity(geometry_container[iZone][iInst][iMGlevel-1]);
-
-      /*--- Create the edge structure ---*/
-
-      geometry_container[iZone][iInst][iMGlevel]->SetEdges();
-      geometry_container[iZone][iInst][iMGlevel]->SetVertex(geometry_container[iZone][iInst][iMGlevel-1], config_container[iZone]);
-
-      /*--- Create the control volume structures ---*/
-
-      geometry_container[iZone][iInst][iMGlevel]->SetControlVolume(config_container[iZone], geometry_container[iZone][iInst][iMGlevel-1], ALLOCATE);
-      geometry_container[iZone][iInst][iMGlevel]->SetBoundControlVolume(config_container[iZone], geometry_container[iZone][iInst][iMGlevel-1], ALLOCATE);
-      geometry_container[iZone][iInst][iMGlevel]->SetCoord(geometry_container[iZone][iInst][iMGlevel-1]);
-
-      /*--- Find closest neighbor to a surface point ---*/
-
-      geometry_container[iZone][iInst][iMGlevel]->FindNormal_Neighbor(config_container[iZone]);
-
-      /*--- Protect against the situation that we were not able to complete
+      /*--- Loop over all the new grid ---*/
+
+      for (iMGlevel = 1; iMGlevel <= config_container[iZone]->GetnMGLevels(); iMGlevel++) {
+
+        /*--- Create main agglomeration structure ---*/
+
+        geometry_container[iZone][iInst][iMGlevel] = new CMultiGridGeometry(geometry_container, config_container, iMGlevel, iZone, iInst);
+
+        /*--- Compute points surrounding points. ---*/
+
+        geometry_container[iZone][iInst][iMGlevel]->SetPoint_Connectivity(geometry_container[iZone][iInst][iMGlevel-1]);
+
+        /*--- Create the edge structure ---*/
+
+        geometry_container[iZone][iInst][iMGlevel]->SetEdges();
+        geometry_container[iZone][iInst][iMGlevel]->SetVertex(geometry_container[iZone][iInst][iMGlevel-1], config_container[iZone]);
+
+        /*--- Create the control volume structures ---*/
+
+        geometry_container[iZone][iInst][iMGlevel]->SetControlVolume(config_container[iZone], geometry_container[iZone][iInst][iMGlevel-1], ALLOCATE);
+        geometry_container[iZone][iInst][iMGlevel]->SetBoundControlVolume(config_container[iZone], geometry_container[iZone][iInst][iMGlevel-1], ALLOCATE);
+        geometry_container[iZone][iInst][iMGlevel]->SetCoord(geometry_container[iZone][iInst][iMGlevel-1]);
+
+        /*--- Find closest neighbor to a surface point ---*/
+
+        geometry_container[iZone][iInst][iMGlevel]->FindNormal_Neighbor(config_container[iZone]);
+
+        /*--- Protect against the situation that we were not able to complete
        the agglomeration for this level, i.e., there weren't enough points.
        We need to check if we changed the total number of levels and delete
        the incomplete CMultiGridGeometry object. ---*/

-      if (config_container[iZone]->GetnMGLevels() != requestedMGlevels) {
-        delete geometry_container[iZone][iInst][iMGlevel];
-        break;
-      }
-
-    }
+        if (config_container[iZone]->GetnMGLevels() != requestedMGlevels) {
+          delete geometry_container[iZone][iInst][iMGlevel];
+          break;
+        }
+
+      }

     }

@@ -867,22 +866,22 @@

   for (iZone = 0; iZone < nZone; iZone++) {
     for (iInst = 0; iInst < nInst[iZone]; iInst++){
-    if (config_container[iZone]->GetUnsteady_Simulation() && config_container[iZone]->GetGrid_Movement()) {
-      for (iMGlevel = 0; iMGlevel <= config_container[iZone]->GetnMGLevels(); iMGlevel++) {
-        for (iPoint = 0; iPoint < geometry_container[iZone][iInst][iMGlevel]->GetnPoint(); iPoint++) {
-
-          /*--- Update cell volume ---*/
-
-          geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetVolume_n();
-          geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetVolume_nM1();
-
-          /*--- Update point coordinates ---*/
-          geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetCoord_n();
-          geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetCoord_n1();
-
-        }
-      }
-    }
+      if (config_container[iZone]->GetUnsteady_Simulation() && config_container[iZone]->GetGrid_Movement()) {
+        for (iMGlevel = 0; iMGlevel <= config_container[iZone]->GetnMGLevels(); iMGlevel++) {
+          for (iPoint = 0; iPoint < geometry_container[iZone][iInst][iMGlevel]->GetnPoint(); iPoint++) {
+
+            /*--- Update cell volume ---*/
+
+            geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetVolume_n();
+            geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetVolume_nM1();
+
+            /*--- Update point coordinates ---*/
+            geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetCoord_n();
+            geometry_container[iZone][iInst][iMGlevel]->node[iPoint]->SetCoord_n1();
+
+          }
+        }
+      }
     }
   }

@@ -2661,22 +2660,22 @@
     if (rank == MASTER_NODE) cout << "Zone " << iZone+1;
     if ((rank == MASTER_NODE) && (nInst[iZone] > 1)) cout << ", instance: " << iInst+1;

-  /*--- Loop over all zones and instantiate the physics iteration. ---*/
-
-  switch (config_container[iZone]->GetKind_Solver()) {
+    /*--- Loop over all zones and instantiate the physics iteration. ---*/
+
+    switch (config_container[iZone]->GetKind_Solver()) {

     case EULER: case NAVIER_STOKES: case RANS:

       if(config_container[iZone]->GetBoolTurbomachinery()){
         if (rank == MASTER_NODE)
           cout << ": Euler/Navier-Stokes/RANS turbomachinery fluid iteration." << endl;
-      iteration_container[iZone][iInst] = new CTurboIteration(config_container[iZone]);
+        iteration_container[iZone][iInst] = new CTurboIteration(config_container[iZone]);

       }
       else{
         if (rank == MASTER_NODE)
           cout << ": Euler/Navier-Stokes/RANS fluid iteration." << endl;
-      iteration_container[iZone][iInst] = new CFluidIteration(config_container[iZone]);
+        iteration_container[iZone][iInst] = new CFluidIteration(config_container[iZone]);
       }
       break;

@@ -2727,8 +2726,8 @@
         cout << ": discrete adjoint FEM structural iteration." << endl;
       iteration_container[iZone][iInst] = new CDiscAdjFEAIteration(config_container[iZone]);
       break;
-  }
-
+    }
+
   }

 }
@@ -3334,7 +3333,7 @@
           (config_container[iZone]->GetKind_Solver() ==  NAVIER_STOKES) ||
           (config_container[iZone]->GetKind_Solver() ==  RANS) ) {
         for (iInst = 0; iInst < nInst[iZone]; iInst++)
-        solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], ExtIter);
+          solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], ExtIter);
       }
     }
   }
@@ -3372,8 +3371,8 @@
   if (!fsi) {
     for (iZone = 0; iZone < nZone; iZone++) {
       for (iInst = 0; iInst < nInst[iZone]; iInst++)
-      output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container,
-          config_container, integration_container, false, UsedTime, iZone, iInst);
+        output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container,
+            config_container, integration_container, false, UsedTime, iZone, iInst);
     }
   }

@@ -3812,8 +3811,8 @@

   for (iZone = 0; iZone < nZone; iZone++) {
     for (iInst = 0; iInst < nInst[iZone]; iInst++)
-    output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container,
-        config_container, integration_container, false, UsedTime, iZone, iInst);
+      output->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container,
+          config_container, integration_container, false, UsedTime, iZone, iInst);
   }


Switched of pairing for resolution file run

--- PWGDQ/dielectron/macrosLMEE/Config_acapon_ElectronEfficiency.C
+++ PWGDQ/dielectron/macrosLMEE/Config_acapon_ElectronEfficiency.C
@@ -28,9 +28,9 @@
 Bool_t bUseEtaResolution      = kTRUE; // use eta or theta resolution?
 Bool_t CalcEfficiencyRec      = kTRUE;
 Bool_t CalcEfficiencyPoslabel = kFALSE;
-Bool_t CalcResolution         = kFALSE;
+Bool_t CalcResolution         = kTRUE;
 Bool_t MakeResolutionSparse   = kFALSE;
-Bool_t doPairing              = kTRUE;
+Bool_t doPairing              = kFALSE;

 // resolution binnings
 Int_t    NbinsMom        = 2000;


Added x,y,z location to max residual point in console output. Closes #114

--- SU2_CFD/src/output_structure.cpp
+++ SU2_CFD/src/output_structure.cpp
@@ -4216,10 +4216,10 @@
     adj_turb_resid[1000], resid_aux[1000], levelset_resid[1000], adj_levelset_resid[1000], wave_coeff[1000],
     heat_coeff[1000], fea_coeff[1000], wave_resid[1000], heat_resid[1000], fea_resid[1000], end[1000];
     char oneD_outputs[1000];
-    double dummy = 0.0;
+    double dummy = 0.0, *Coord;
     unsigned short iVar, iMarker, iMarker_Monitoring;

-    unsigned long LinSolvIter = 0;
+    unsigned long LinSolvIter = 0, iPointMaxResid;
     double timeiter = timeused/double(iExtIter+1);

     unsigned short nDim = geometry[val_iZone][FinestMesh]->GetnDim();
@@ -4891,8 +4891,12 @@
           case FLUID_STRUCTURE_EULER :  case FLUID_STRUCTURE_NAVIER_STOKES:

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             /*--- Print out the number of non-physical points and reconstructions ---*/
             if (config[val_iZone]->GetNonphysical_Points() > 0)
@@ -4918,8 +4922,12 @@
           case TNE2_EULER :  case TNE2_NAVIER_STOKES:

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][TNE2_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][TNE2_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][TNE2_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][TNE2_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             if (!Unsteady) cout << endl << " Iter" << "    Time(s)";
             else cout << endl << " IntIter" << " ExtIter";
@@ -4933,8 +4941,12 @@
           case RANS : case FLUID_STRUCTURE_RANS:

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             /*--- Print out the number of non-physical points and reconstructions ---*/
             if (config[val_iZone]->GetNonphysical_Points() > 0)
@@ -4986,8 +4998,12 @@
           case ADJ_EULER :              case ADJ_NAVIER_STOKES :

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             if (!Unsteady) cout << endl << " Iter" << "    Time(s)";
             else cout << endl << " IntIter" << "  ExtIter";
@@ -5004,8 +5020,12 @@
           case ADJ_RANS :

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             if (!Unsteady) cout << endl << " Iter" << "    Time(s)";
             else cout << endl << " IntIter" << "  ExtIter";
@@ -5030,8 +5050,12 @@
           case ADJ_TNE2_EULER :              case ADJ_TNE2_NAVIER_STOKES :

             /*--- Visualize the maximum residual ---*/
-            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJTNE2_SOL]->GetRes_Max(0))
-            <<", located at point "<< solver_container[val_iZone][FinestMesh][ADJTNE2_SOL]->GetPoint_Max(0) << "." << endl;
+            iPointMaxResid = solver_container[val_iZone][FinestMesh][ADJTNE2_SOL]->GetPoint_Max(0);
+            Coord = geometry[val_iZone][FinestMesh]->node[iPointMaxResid]->GetCoord();
+            cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][FinestMesh][ADJTNE2_SOL]->GetRes_Max(0)) << "." << endl;
+            cout <<"Max residual point " << iPointMaxResid << " is located at (" << Coord[0] << "," << Coord[1];
+            if (nDim == 3) cout << "," << Coord[2];
+            cout <<   ")." << endl;

             if (!Unsteady) cout << endl << " Iter" << "    Time(s)";
             else cout << endl << " IntIter" << "  ExtIter";


Bugfix in selection of noise events

Bugfix in selection of noise events

--- PWGJE/EMCALJetTasks/Tracks/AliAnalysisTaskEmcalTriggerBase.cxx
+++ PWGJE/EMCALJetTasks/Tracks/AliAnalysisTaskEmcalTriggerBase.cxx
@@ -182,7 +182,7 @@
       if(isEMC7) isEMC7 &= selector(kCPREL0);
     } else {
       if(isEJ1) isEJ1 &= !selector(kCPREJ1);
-      if(isEJ1) isEJ2 &= !selector(kCPREJ2);
+      if(isEJ2) isEJ2 &= !selector(kCPREJ2);
       if(isEG1) isEG1 &= !selector(kCPREG1);
       if(isEG2) isEG2 &= !selector(kCPREG2);
       if(isEMC7) isEMC7 &= !selector(kCPREL0);


change video output for turboperformance

--- SU2_CFD/src/output_structure.cpp
+++ SU2_CFD/src/output_structure.cpp
@@ -4310,6 +4310,8 @@
     (config[val_iZone]->GetKind_Solver() == RANS) || (config[val_iZone]->GetKind_Solver() == ADJ_EULER) ||
     (config[val_iZone]->GetKind_Solver() == ADJ_NAVIER_STOKES) || (config[val_iZone]->GetKind_Solver() == ADJ_RANS);

+    bool turbo = config[val_iZone]->GetBoolTurboPerf();
+
     bool output_per_surface = false;
     if (config[val_iZone]->GetnMarker_Monitoring() > 1) output_per_surface = true;

@@ -5076,6 +5078,7 @@
               else if (rotating_frame && nDim == 3) cout << "     Res[Rho]" << "     Res[RhoE]" << " CThrust(Total)" << " CTorque(Total)" << endl;
               else if (aeroelastic) cout << "     Res[Rho]" << "     Res[RhoE]" << "   CLift(Total)" << "   CDrag(Total)" << "         plunge" << "          pitch" << endl;
               else if (equiv_area) cout << "     Res[Rho]" << "   CLift(Total)" << "   CDrag(Total)" << "    CPress(N-F)" << endl;
+              else if (turbo)      cout << "     Res[Rho]" << "     Res[RhoE]" << "   Efficiency(%)" << "   DeltaMassFlow(%)" << endl;
               else cout << "     Res[Rho]" << "     Res[RhoE]" << "   CLift(Total)" << "   CDrag(Total)" << endl;
 //            }
 //            else if (fluid_structure) cout << "     Res[Rho]" << "   Res[Displx]" << "   CLift(Total)" << "   CDrag(Total)" << endl;
@@ -5153,6 +5156,7 @@
             else if (rotating_frame && nDim == 3 ) cout << "   CThrust(Total)" << "   CTorque(Total)" << endl;
             else if (aeroelastic) cout << "   CLift(Total)" << "   CDrag(Total)" << "         plunge" << "          pitch" << endl;
             else if (equiv_area) cout << "   CLift(Total)" << "   CDrag(Total)" << "    CPress(N-F)" << endl;
+            else if (turbo)      cout << "   Efficiency(%)" << "   DeltaMassFlow(%)" << endl;
             else cout << "   CLift(Total)"   << "   CDrag(Total)"   << endl;

             break;
@@ -5391,6 +5395,12 @@
             cout.precision(4);
             cout.setf(ios::scientific, ios::floatfield);
             cout << Total_CNearFieldOF; }
+          if (turbo) {
+        	cout.setf(ios::scientific, ios::floatfield);
+		    cout.width(15); cout << solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetTotalStaticEfficiency(0); cout.width(15);
+		    cout << solver_container[val_iZone][FinestMesh][FLOW_SOL]->GetTotalPressureLoss(0);
+		    cout.unsetf(ios_base::floatfield);
+		  }
           else { cout.width(15); cout << min(10000.0, max(-10000.0, Total_CLift)); cout.width(15); cout << min(10000.0, max(-10000.0, Total_CDrag)); }

           if (aeroelastic) {


plot total total efficiency next to residuals

--- SU2_CFD/src/output_structure.cpp
+++ SU2_CFD/src/output_structure.cpp
@@ -5682,7 +5682,7 @@
           	}
           	else{
 						/*--- multi zone output ---*/
-							cout.width(15); cout << TotalStaticEfficiency[nTurboPerf - 1]*100.0;
+							cout.width(15); cout << TotalTotalEfficiency[nTurboPerf - 1]*100.0;
 							cout.width(15); cout << EntropyGen[nTurboPerf -1]*100.0;
               if (direct_diff){
                 cout.width(15); cout << D_EntropyGen;


Suppress a __host__ __device__ warning in asynchronous_state

--- agency/detail/asynchronous_state.hpp
+++ agency/detail/asynchronous_state.hpp
@@ -62,6 +62,7 @@
     asynchronous_state_impl() = default;

     // constructs an immediately ready state
+    __agency_hd_warning_disable__
     template<class... Args,
              class = typename std::enable_if<
                std::is_constructible<T,Args...>::value


Remove incorrect log message

Remove incorrect log message

Change-Id: Ia71c15ac13e109c41eac8d229c525cebd1112a53
Signed-off-by: Rob Adams <dc34e1981fc17062c98433ad1bfcab20a4e3a66c@readams.net>

--- agent-ovs/src/PolicyStatsManager.cpp
+++ agent-ovs/src/PolicyStatsManager.cpp
@@ -390,9 +390,6 @@
             if (ret != EOF) {
                 LOG(ERROR) << "Failed to decode flow stats reply: "
                            << ovs_strerror(ret);
-            } else {
-                LOG(ERROR) << "No more flow stats entries to decode "
-                           << ovs_strerror(ret);
             }
             break;
         } else {


Rename appDomainFriendlyName to psl_cmdline_host

--- host/main.cpp
+++ host/main.cpp
@@ -77,7 +77,7 @@
     void* hostHandle;
     unsigned int domainId;
     int status = startCoreCLR(
-        "ps_cmdline_host",
+        "psl_cmdline_host",
         &hostHandle,
         &domainId);


ShaderResourceLayoutTest: unified test buffer creation

--- UnitTests/DiligentCoreAPITest/src/ShaderResourceLayoutTest.cpp
+++ UnitTests/DiligentCoreAPITest/src/ShaderResourceLayoutTest.cpp
@@ -161,6 +161,47 @@
             pPSO->CreateShaderResourceBinding(&pSRB, false);
     }

+    static RefCntAutoPtr<IBufferView> CreateResourceBufferView(BUFFER_MODE BufferMode, BUFFER_VIEW_TYPE ViewType)
+    {
+        VERIFY_EXPR(ViewType == BUFFER_VIEW_SHADER_RESOURCE || ViewType == BUFFER_VIEW_UNORDERED_ACCESS);
+
+        auto* pEnv    = TestingEnvironment::GetInstance();
+        auto* pDevice = pEnv->GetDevice();
+
+        BufferDesc BuffDesc;
+        BuffDesc.Name              = "Formatted buffer";
+        BuffDesc.uiSizeInBytes     = 256;
+        BuffDesc.BindFlags         = ViewType == BUFFER_VIEW_SHADER_RESOURCE ? BIND_SHADER_RESOURCE : BIND_UNORDERED_ACCESS;
+        BuffDesc.Usage             = USAGE_DEFAULT;
+        BuffDesc.ElementByteStride = 16;
+        BuffDesc.Mode              = BufferMode;
+        RefCntAutoPtr<IBuffer>     pBuffer;
+        RefCntAutoPtr<IBufferView> pBufferView;
+        pDevice->CreateBuffer(BuffDesc, nullptr, &pBuffer);
+        if (!pBuffer)
+        {
+            ADD_FAILURE() << "Unable to create buffer " << BuffDesc;
+            return pBufferView;
+        }
+
+        if (BufferMode == BUFFER_MODE_FORMATTED)
+        {
+            BufferViewDesc BuffViewDesc;
+            BuffViewDesc.Name                 = "Formatted buffer SRV";
+            BuffViewDesc.ViewType             = ViewType;
+            BuffViewDesc.Format.ValueType     = VT_FLOAT32;
+            BuffViewDesc.Format.NumComponents = 4;
+            BuffViewDesc.Format.IsNormalized  = false;
+            pBuffer->CreateView(BuffViewDesc, &pBufferView);
+        }
+        else
+        {
+            pBufferView = pBuffer->GetDefaultView(ViewType);
+        }
+
+        return pBufferView;
+    }
+
     static void CreateComputePSO(IShader*                               pCS,
                                  const PipelineResourceLayoutDesc&      ResourceLayout,
                                  RefCntAutoPtr<IPipelineState>&         pPSO,
@@ -429,34 +470,8 @@

     for (Uint32 i = 0; i < MaxBuffers; ++i)
     {
-        BufferDesc BuffDesc;
-        BuffDesc.Name              = "Formatted buffer";
-        BuffDesc.uiSizeInBytes     = 256;
-        BuffDesc.BindFlags         = BIND_SHADER_RESOURCE;
-        BuffDesc.Usage             = USAGE_DEFAULT;
-        BuffDesc.ElementByteStride = 16;
-        BuffDesc.Mode              = IsFormatted ? BUFFER_MODE_FORMATTED : BUFFER_MODE_STRUCTURED;
-        RefCntAutoPtr<IBuffer> pBuffer;
-        pDevice->CreateBuffer(BuffDesc, nullptr, &pBuffer);
-        ASSERT_NE(pBuffer, nullptr) << "Unable to create buffer " << BuffDesc;
-
-        if (IsFormatted)
-        {
-            BufferViewDesc BuffViewDesc;
-            BuffViewDesc.Name                 = "Formatted buffer (uniform texel buffer) SRV";
-            BuffViewDesc.ViewType             = BUFFER_VIEW_SHADER_RESOURCE;
-            BuffViewDesc.Format.ValueType     = VT_FLOAT32;
-            BuffViewDesc.Format.NumComponents = 4;
-            BuffViewDesc.Format.IsNormalized  = false;
-            pBuffer->CreateView(BuffViewDesc, &pBufferViews[i]);
-        }
-        else
-        {
-            pBufferViews[i] = pBuffer->GetDefaultView(BUFFER_VIEW_SHADER_RESOURCE);
-        }
-
+        pBufferViews[i] = CreateResourceBufferView(IsFormatted ? BUFFER_MODE_FORMATTED : BUFFER_MODE_STRUCTURED, BUFFER_VIEW_SHADER_RESOURCE);
         ASSERT_NE(pBufferViews[i], nullptr) << "Unable to formatted buffer view ";
-
         pBuffSRVs[i] = pBufferViews[i];
     }

@@ -613,34 +628,8 @@

     for (Uint32 i = 0; i < TotalBuffers; ++i)
     {
-        BufferDesc BuffDesc;
-        BuffDesc.Name              = "Formatted buffer";
-        BuffDesc.uiSizeInBytes     = 256;
-        BuffDesc.BindFlags         = BIND_UNORDERED_ACCESS;
-        BuffDesc.Usage             = USAGE_DEFAULT;
-        BuffDesc.ElementByteStride = 16;
-        BuffDesc.Mode              = IsFormatted ? BUFFER_MODE_FORMATTED : BUFFER_MODE_STRUCTURED;
-        RefCntAutoPtr<IBuffer> pBuffer;
-        pDevice->CreateBuffer(BuffDesc, nullptr, &pBuffer);
-        ASSERT_NE(pBuffer, nullptr) << "Unable to create buffer " << BuffDesc;
-
-        if (IsFormatted)
-        {
-            BufferViewDesc BuffViewDesc;
-            BuffViewDesc.Name                 = "Formatted buffer (uniform texel buffer) SRV";
-            BuffViewDesc.ViewType             = BUFFER_VIEW_UNORDERED_ACCESS;
-            BuffViewDesc.Format.ValueType     = VT_FLOAT32;
-            BuffViewDesc.Format.NumComponents = 4;
-            BuffViewDesc.Format.IsNormalized  = false;
-            pBuffer->CreateView(BuffViewDesc, &pBufferViews[i]);
-        }
-        else
-        {
-            pBufferViews[i] = pBuffer->GetDefaultView(BUFFER_VIEW_UNORDERED_ACCESS);
-        }
-
+        pBufferViews[i] = CreateResourceBufferView(IsFormatted ? BUFFER_MODE_FORMATTED : BUFFER_MODE_STRUCTURED, BUFFER_VIEW_UNORDERED_ACCESS);
         ASSERT_NE(pBufferViews[i], nullptr) << "Unable to formatted buffer view ";
-
         pBuffUAVs[i] = pBufferViews[i];
     }


clang-format

clang-format

--- ice40/arch.cc
+++ ice40/arch.cc
@@ -19,13 +19,13 @@

 #include <algorithm>
 #include <cmath>
+#include "cells.h"
 #include "gfx.h"
 #include "log.h"
 #include "nextpnr.h"
 #include "placer1.h"
 #include "router1.h"
 #include "util.h"
-#include "cells.h"
 NEXTPNR_NAMESPACE_BEGIN

 // -----------------------------------------------------------------------


inc/types.hpp: Changed Closure::banreuse() to work on all continuations

--- inc/types.hpp
+++ inc/types.hpp
@@ -240,7 +240,27 @@
   }
   bytecode_t* code() { return body; }
   void codereset(bytecode_t *b) { body = b; }
-  void banreuse() { nonreusable = true; }
+  void banreuse() {
+    /*ban reuse for this and for every other continuation referred to*/
+    Closure* kp = this;
+    if(kp) {
+    loop:
+      kp->nonreusable = true;
+      for(size_t i; i < kp->sz; ++i) {
+        Object::ref tmp = kp->index(i);
+        if(is_a<Generic*>(tmp)) {
+          Closure* cp = dynamic_cast<Closure*>(as_a<Generic*>(tmp));
+          if(cp && cp->kontinuation) {
+            /*assume only one continuation is actually referred to
+            directly (this is what the compiler emits anyway)
+            */
+            kp = cp;
+            goto loop;
+          }
+        }
+      }
+    }
+  }
   bool reusable() { return !nonreusable; }
   static Closure* NewKClosure(Heap & h, bytecode_t *body, size_t n);
   static Closure* NewClosure(Heap & h, bytecode_t *body, size_t n);


fix test: isEmpty() requires that robot_state be diff

--- moveit_core/planning_scene/test/test_planning_scene.cpp
+++ moveit_core/planning_scene/test/test_planning_scene.cpp
@@ -90,6 +90,7 @@
   world.addToObject("sphere", shapes::ShapeConstPtr(new shapes::Sphere(0.4)), id);

   moveit_msgs::PlanningScene ps_msg;
+  ps_msg.robot_state.is_diff = true;
   EXPECT_TRUE(planning_scene::PlanningScene::isEmpty(ps_msg));
   ps->getPlanningSceneMsg(ps_msg);
   ps->setPlanningSceneMsg(ps_msg);


testing the baby

testing the baby

--- applications/ISM/ex3/ex3.cpp
+++ applications/ISM/ex3/ex3.cpp
@@ -23,18 +23,33 @@
 // }

-//2D CASE rigid translation
+//2D CASE translation
 double InitalValueU(const std::vector < double >& x) {
-  return -x[1];
+  return 1.;
 }

 double InitalValueV(const std::vector < double >& x) {
-  return x[0];
+  return 0.;
 }

 double InitalValueW(const std::vector < double >& x) {
   return 0.;
 }
+
+
+
+//2D CASE rigid rotation
+// double InitalValueU(const std::vector < double >& x) {
+//   return -x[1];
+// }
+//
+// double InitalValueV(const std::vector < double >& x) {
+//   return x[0];
+// }
+//
+// double InitalValueW(const std::vector < double >& x) {
+//   return 0.;
+// }

 // double InitalValueU(const std::vector < double >& x) {
@@ -219,13 +234,29 @@
   unsigned pSize = 100;
   std::vector < Marker*> particle(pSize);

-  double pi = acos(-1.);
-  for(unsigned j = 0; j < pSize; j++) {
-    x[0] = 0. + 0.125 * cos(2.*pi / pSize * j);
-    x[1] = .25 + 0.125 * sin(2.*pi / pSize * j);
+
+//uncomment to do solid body rotation and vortex test
+//   double pi = acos(-1.);
+//   for(unsigned j = 0; j < pSize; j++) {
+//     x[0] = 0. + 0.125 * cos(2.*pi / pSize * j);
+//     x[1] = .25 + 0.125 * sin(2.*pi / pSize * j);
+//     x[2] = 0.;
+//     particle[j] = new Marker(x, VOLUME, mlMsh.GetLevel(numberOfUniformLevels - 1), solType, true);
+//   }
+
+
+  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  //initializing the particles for the translation test
+
+    T = 1.;
+    for(unsigned j = 0; j < pSize; j++) {
+    x[0] = -0.5;
+    x[1] = -0.5 + j/99;
     x[2] = 0.;
     particle[j] = new Marker(x, VOLUME, mlMsh.GetLevel(numberOfUniformLevels - 1), solType, true);
   }
+  //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+

   std::vector < std::vector < std::vector < double > > > line(1);
   line[0].resize(pSize + 1);
@@ -239,15 +270,16 @@

   PrintLine(DEFAULT_OUTPUTDIR, line, false, 0);

-  n = 200;
+  n = 10;

   clock_t start_time = clock();

   for(unsigned k = 1; k <= n; k++) {
-    mlSol.CopySolutionToOldSolution();
-    mlSol.UpdateSolution("U" , InitalValueU, pi * k / n);
-    mlSol.UpdateSolution("V" , InitalValueV, pi * k / n);
-    if(dim == 3) mlSol.UpdateSolution("W" , InitalValueW, pi * k / n);
+ // uncomment for rigid translation ad vortex test
+     //mlSol.CopySolutionToOldSolution();
+  //     mlSol.UpdateSolution("U" , InitalValueU, pi * k / n);
+//     mlSol.UpdateSolution("V" , InitalValueV, pi * k / n);
+//     if(dim == 3) mlSol.UpdateSolution("W" , InitalValueW, pi * k / n);
     for(unsigned j = 0; j < pSize; j++) {
       particle[j]->Advection(mlSol.GetLevel(numberOfUniformLevels - 1), 4, T / n);
       particle[j]->GetMarkerCoordinates(line[0][j]);


Fixed indentation in description

Fixed indentation in description

--- applications/lbgen/lbgen.cpp
+++ applications/lbgen/lbgen.cpp
@@ -64,7 +64,7 @@
     cout << "                   Valid formats:" << endl;
     cout << "                       Surface Scattering Distribution Data (\".ssdd\")" << endl;
     cout << "                       Integra Diffuse Distribution (\".ddr, .ddt\")" << endl;
-    cout << "                           If there is no file extension, \".ddr\" and \".ddt\" files are generated." << endl;
+    cout << "                       If there is no file extension, \".ddr\" and \".ddt\" files are generated." << endl;
     cout << endl;
     cout << "Options:" << endl;
     cout << "  -h, --help                   show this help message and exit" << endl;


Using scoped viewport when clear FBOs after init

--- samples/_opengl/DeferredShadingAdvanced/src/DeferredShadingAdvancedApp.cpp
+++ samples/_opengl/DeferredShadingAdvanced/src/DeferredShadingAdvancedApp.cpp
@@ -214,6 +214,9 @@
 		gl::Fbo::Format fboFormat;
 		fboFormat.attachment( GL_DEPTH_ATTACHMENT, mTextureFboShadowMap );
 		mFboShadowMap = gl::Fbo::create( sz, sz, fboFormat );
+		gl::ScopedFramebuffer scopedFramebuffer( mFboShadowMap );
+		gl::ScopedViewport scopedViewport( ivec2( 0 ), mFboShadowMap->getSize() );
+		gl::clear();
 	}

 	// Set up shadow camera
@@ -793,7 +796,7 @@
 		}
 		mFboPingPong = gl::Fbo::create( w, h, fboFormat );
 		gl::ScopedFramebuffer scopedFramebuffer( mFboPingPong );
-		gl::viewport( mFboPingPong->getSize() );
+		gl::ScopedViewport scopedViewport( ivec2( 0 ), mFboPingPong->getSize() );
 		gl::clear();
 	}

@@ -830,7 +833,7 @@
 		try {
 			mFboGBuffer = gl::Fbo::create( w, h, fboFormat );
 			gl::ScopedFramebuffer scopedFramebuffer( mFboGBuffer );
-			gl::viewport( mFboGBuffer->getSize() );
+			gl::ScopedViewport scopedViewport( ivec2( 0 ), mFboGBuffer->getSize() );
 			gl::clear();
 		} catch ( gl::FboExceptionInvalidSpecification ex ) {
 			console() << ex.what() << endl;
@@ -853,7 +856,7 @@
 		}
 		mFboSmall = gl::Fbo::create( w / 2, h / 2, fboFormat );
 		gl::ScopedFramebuffer scopedFramebuffer( mFboSmall );
-		gl::viewport( mFboSmall->getSize() );
+		gl::ScopedViewport scopedViewport( ivec2( 0 ), mFboSmall->getSize() );
 		gl::clear();
 	}
 }


relax volume of the cell

relax volume of the cell

--- apps/dft_loop/sirius.scf.cpp
+++ apps/dft_loop/sirius.scf.cpp
@@ -1,6 +1,134 @@
 #include <sirius.h>

 using namespace sirius;
+
+class lattice3d
+{
+    private:
+
+        /// Bravais lattice vectors in column order.
+        /** The following convention is used to transform fractional coordinates to Cartesian:
+         *  \f[
+         *    \vec v_{C} = {\bf L} \vec v_{f}
+         *  \f]
+         */
+        matrix3d<double> lattice_vectors_;
+
+    public:
+
+        lattice3d(vector3d<double> a0__,
+                  vector3d<double> a1__,
+                  vector3d<double> a2__)
+        {
+            for (int x: {0, 1, 2}) {
+                lattice_vectors_(x, 0) = a0__[x];
+                lattice_vectors_(x, 1) = a1__[x];
+                lattice_vectors_(x, 2) = a2__[x];
+            }
+        }
+
+        lattice3d(double a__,
+                  double b__,
+                  double c__,
+                  double alpha__,
+                  double beta__,
+                  double gamma__)
+        {
+            lattice_vectors_(0, 0) = a__;
+            lattice_vectors_(1, 0) = 0.0;
+            lattice_vectors_(2, 0) = 0.0;
+
+            lattice_vectors_(0, 1) = b__ * std::cos(gamma__);
+            lattice_vectors_(1, 1) = b__ * std::sin(gamma__);
+            lattice_vectors_(2, 1) = 0.0;
+
+            lattice_vectors_(0, 2) = c__ * std::cos(beta__);
+            lattice_vectors_(1, 2) = c__ * (std::cos(alpha__) - std::cos(gamma__) * std::cos(beta__)) / std::sin(gamma__);
+            lattice_vectors_(2, 2) = std::sqrt(c__ * c__ - std::pow(lattice_vectors_(0, 2), 2) - std::pow(lattice_vectors_(1, 2), 2));
+        }
+
+        unit_cell_parameters_descriptor parameters()
+        {
+            unit_cell_parameters_descriptor d;
+
+            vector3d<double> v0(lattice_vectors_(0, 0), lattice_vectors_(1, 0), lattice_vectors_(2, 0));
+            vector3d<double> v1(lattice_vectors_(0, 1), lattice_vectors_(1, 1), lattice_vectors_(2, 1));
+            vector3d<double> v2(lattice_vectors_(0, 2), lattice_vectors_(1, 2), lattice_vectors_(2, 2));
+
+            d.a = v0.length();
+            d.b = v1.length();
+            d.c = v2.length();
+
+            d.alpha = std::acos((v1 * v2) / d.b / d.c);
+            d.beta  = std::acos((v0 * v2) / d.a / d.c);
+            d.gamma = std::acos((v0 * v1) / d.a / d.b);
+
+            return d;
+        }
+
+};
+
+class Parameter_optimization
+{
+    private:
+
+        double step_;
+
+        bool can_increase_step_{true};
+
+        std::vector<double> x_;
+
+        std::vector<double> f_;
+
+        std::vector<double> df_;
+
+        std::vector<int> df_sign_change_;
+
+    public:
+
+        Parameter_optimization(double step__)
+            : step_(step__)
+        {
+        }
+
+        void add_point(double x__, double f__, double df__)
+        {
+            if (df_.size() > 0) {
+                if (df_.back() * df__ > 0) {
+                    if (can_increase_step_) {
+                        step_ *= 1.5;
+                    }
+                } else {
+                    step_ *= 0.25;
+                    can_increase_step_ = false;
+                    df_sign_change_.push_back(static_cast<int>(df_.size()));
+                }
+            }
+
+            x_.push_back(x__);
+            f_.push_back(f__);
+            df_.push_back(df__);
+        }
+
+        double next_x()
+        {
+            return x_.back() - Utils::sign(df_.back()) * step_;
+        }
+
+        void estimate_x0()
+        {
+            //for (int i = *(df_sign_change_.end() - 4); i < df_.size(); i++) {
+            for (int i = df_sign_change_[0]; i < (int)df_.size(); i++) {
+                printf("%18.10f %18.10f\n", x_[i], df_[i]);
+            }
+        }
+
+        double step() const
+        {
+            return step_;
+        }
+
+};

 enum class task_t
 {
@@ -8,7 +136,8 @@
     ground_state_restart = 1,
     relaxation_new = 2,
     relaxation_restart = 3,
-    lattice_relaxation_new = 4
+    lattice_relaxation_new = 4,
+    volume_relaxation_new = 5
 };

 const double au2angs = 0.5291772108;
@@ -206,143 +335,156 @@
     return std::pow((a0 - a0__).length(), 2) + std::pow((a1 - a1__).length(), 2) + std::pow((a2 - a2__).length(), 2);
 }

+double Etot_fake(double a__, double b__, double c__, double alpha__, double beta__, double gamma__)
+{
+    vector3d<double> a0{0, 5, 5};
+    vector3d<double> a1{5, 0, 5};
+    vector3d<double> a2{5, 5, 0};
+
+    lattice3d ref_lat(a0, a1, a2);
+
+    auto ref_lat_param = ref_lat.parameters();
+
+    //std::cout << ref_lat_param.a << " " << ref_lat_param.b << " " << ref_lat_param.c << " "
+    //          << ref_lat_param.alpha << " " << ref_lat_param.beta << " " << ref_lat_param.gamma << std::endl;
+
+    //std::cout << a__ << " " << b__ << " " << c__ << " "
+    //          << alpha__ << " " << beta__ << " " << gamma__ << std::endl;
+
+    return std::pow(a__ - ref_lat_param.a, 2) +
+           std::pow(b__ - ref_lat_param.b, 2) +
+           std::pow(c__ - ref_lat_param.c, 2) +
+           std::pow(std::abs(alpha__ - ref_lat_param.alpha), 2) +
+           std::pow(std::abs(beta__ - ref_lat_param.beta), 2) +
+           std::pow(std::abs(gamma__ - ref_lat_param.gamma), 2);
+}
+
 void lattice_relaxation(task_t task, cmd_args args, Parameters_input_section& inp)
 {
     /* get the input file name */
     std::string fname = args.value<std::string>("input", "sirius.json");

-    std::vector< matrix3d<double> > strain;
-
-    strain.push_back({{1, 0, 0},
-                      {0, 0, 0},
-                      {0, 0, 0}});
-
-    strain.push_back({{0, 0, 0},
-                      {0, 1, 0},
-                      {0, 0, 0}});
-
-    strain.push_back({{0, 0, 0},
-                      {0, 0, 0},
-                      {0, 0, 1}});
-
-    strain.push_back({{0, 1, 0},
-                      {1, 0, 0},
-                      {0, 0, 0}});
-
-    strain.push_back({{0, 0, 0},
-                      {0, 0, 1},
-                      {0, 1, 0}});
-
-    strain.push_back({{0, 0, 1},
-                      {0, 0, 0},
-                      {1, 0, 0}});
-
-    Simulation_context* ctx0 = create_sim_ctx(fname, args, inp);
+    std::unique_ptr<Simulation_context> ctx0(create_sim_ctx(fname, args, inp));
+
     auto a0 = ctx0->unit_cell().lattice_vector(0);
     auto a1 = ctx0->unit_cell().lattice_vector(1);
     auto a2 = ctx0->unit_cell().lattice_vector(2);

-    ///double step = 1e-4;
-    std::vector<double> lat_step(6, 1e-1);
-    std::vector<double> stress_prev(6, 0);
-
-    matrix3d<double> mt, mtprev;
+    auto lat_param = lattice3d(a0, a1, a2).parameters();
+
+    std::vector<double> params({lat_param.a,
+                                lat_param.b,
+                                lat_param.c,
+                                lat_param.alpha,
+                                lat_param.beta,
+                                lat_param.gamma});
+
+    std::vector<Parameter_optimization> param_opt({Parameter_optimization(0.25),
+                                                   Parameter_optimization(0.25),
+                                                   Parameter_optimization(0.25),
+                                                   Parameter_optimization(0.1),
+                                                   Parameter_optimization(0.1),
+                                                   Parameter_optimization(0.1)});
+

     for (int iter = 0; iter < 100; iter++) {
-        matrix3d<double> latv;
-        for (int x: {0, 1, 2}) {
-            latv(x, 0) = a0[x];
-            latv(x, 1) = a1[x];
-            latv(x, 2) = a2[x];
-        }
-        std::vector< matrix3d<double> > strain_cart;
+        std::vector<double> p0 = params;
+        double e0 = Etot_fake(p0[0], p0[1], p0[2], p0[3], p0[4], p0[5]);
+
         for (int i = 0; i < 6; i++) {
-            strain_cart.push_back(latv * strain[i]);
-        }
-
-        double e0 = Etot_fake(a0, a1, a2);
-        std::vector<double> stress(6);
+            double step = 1e-5;
+            std::vector<double> p1 = params;
+            p1[i] += step;
+            double e1 = Etot_fake(p1[0], p1[1], p1[2], p1[3], p1[4], p1[5]);
+            param_opt[i].add_point(p0[i], e0, (e1 - e0) / step);
+        }
         for (int i = 0; i < 6; i++) {
-            double step = lat_step[i] / 8;
-            vector3d<double> c0 = a0;
-            vector3d<double> c1 = a1;
-            vector3d<double> c2 = a2;
-
-            for (int j = 0; j < 3; j++) {
-                c0[j] += step * strain[i](0, j);
-                c1[j] += step * strain[i](1, j);
-                c2[j] += step * strain[i](2, j);
-            }
-
-            double e1 = Etot_fake(c0, c1, c2);
-
-            stress[i] = -(e1 - e0) / step;
-        }
-
-        for (int i = 0; i < 6; i++) {
-            if (stress[i] * stress_prev[i] >= 0) {
-                lat_step[i] *= 1.25;
-            }
-            else {
-                lat_step[i] *= 0.5;
-            }
-        }
-        stress_prev = stress;
-
-        for (int i = 0; i < 6; i++) {
-            for (int j = 0; j < 3; j++) {
-                a0[j] += stress[i] * lat_step[i] * strain[i](0, j);
-                a1[j] += stress[i] * lat_step[i] * strain[i](1, j);
-                a2[j] += stress[i] * lat_step[i] * strain[i](2, j);
-            }
+            params[i] = param_opt[i].next_x();
         }

         double d{0};
         for (int i = 0; i < 6; i++) {
-            d += std::abs(lat_step[i]);
+            d += std::abs(param_opt[i].step());
         }
         std::cout << "diff in step=" << d << std::endl;
-        if (d < 1e-7) {
+        if (d < 1e-5) {
             printf("Done in %i iterations!\n", iter);
             break;
         }
-
-        for (int i = 0; i < 6; i++) {
-            std::cout << i << " " << stress[i] << " " << lat_step[i] << std::endl;
-        }
-
-        mtprev = mt;
-
-        mt(0, 0) = a0 * a0;
-        mt(0, 1) = a0 * a1;
-        mt(0, 2) = a0 * a2;
-
-        mt(1, 0) = a1 * a0;
-        mt(1, 1) = a1 * a1;
-        mt(1, 2) = a1 * a2;
-
-        mt(2, 0) = a2 * a0;
-        mt(2, 1) = a2 * a1;
-        mt(2, 2) = a2 * a2;
-
-        d = 0;
-        for (int i: {0, 1, 2}) {
-            for (int j: {0, 1, 2}) {
-                d += std::abs(mt(i, j) - mtprev(i, j));
+    }
+    param_opt[0].estimate_x0();
+    param_opt[3].estimate_x0();
+}
+
+void volume_relaxation(task_t task, cmd_args args, Parameters_input_section& inp)
+{
+    /* get the input file name */
+    std::string fname = args.value<std::string>("input", "sirius.json");
+
+    int npt{5};
+
+    Radial_grid scale(linear_grid, npt, 0.9, 1.1);
+    Spline<double> etot(scale);
+
+    for (int i = 0; i < npt; i++) {
+        std::unique_ptr<Simulation_context> ctx0(create_sim_ctx(fname, args, inp));
+
+        auto a0 = ctx0->unit_cell().lattice_vector(0) * scale[i];
+        auto a1 = ctx0->unit_cell().lattice_vector(1) * scale[i];
+        auto a2 = ctx0->unit_cell().lattice_vector(2) * scale[i];
+        ctx0->unit_cell().set_lattice_vectors(a0, a1, a2);
+        ctx0->initialize();
+
+        //etot[i] = Etot_fake(a0, a1, a2);
+        etot[i] = ground_state(*ctx0, task_t::ground_state_new, args, inp, 0);
+    }
+    etot.interpolate();
+
+    double s0{0};
+    bool found{false};
+    for (int i = 0; i < npt - 1; i++) {
+        if (etot.deriv(1, i) * etot.deriv(1, i + 1) < 0) {
+            for (int j = 0; j < 10000; j++) {
+                double dx = scale.dx(i) / 10000.0;
+                if (etot.deriv(1, i, dx * j) * etot.deriv(1, i, dx * (j + 1)) < 0) {
+                    if (found) {
+                        TERMINATE("one minimum was already found");
+                    }
+                    s0 = scale[i] + dx * j;
+                    found = true;
+                    break;
+                }
             }
         }
-        std::cout << "diff in mt=" << d << std::endl;
-        if (d < 1e-4) {
-            printf("Metric tensor converged in %i iter!\n", iter);
-            break;
-        }
-
-
-        std::cout << "new vectors: " << std::endl;
-        std::cout << a0 << std::endl;
-        std::cout << a1 << std::endl;
-        std::cout << a2 << std::endl;
-    }
+    }
+
+    if (found) {
+        std::unique_ptr<Simulation_context> ctx0(create_sim_ctx(fname, args, inp));
+        auto a0 = ctx0->unit_cell().lattice_vector(0) * s0;
+        auto a1 = ctx0->unit_cell().lattice_vector(1) * s0;
+        auto a2 = ctx0->unit_cell().lattice_vector(2) * s0;
+        ctx0->unit_cell().set_lattice_vectors(a0, a1, a2);
+        ctx0->unit_cell().write_json("relaxed_unit_cell.json");
+    }
+
+
+    //double scale = 1.0;
+    //Parameter_optimization scale_opt(0.01);
+
+    //for (int iter = 0; iter < 100; iter++) {
+    //    double e0 = Etot_fake(a0 * scale, a1 * scale, a2 * scale);
+    //    double step = 1e-6;
+    //    double e1 = Etot_fake(a0 * scale * (1 + step), a1 * scale * (1 + step), a2 * scale * (1 + step));
+    //    scale_opt.add_point(scale, e0, (e1 - e0) / step);
+    //    scale = scale_opt.next_x();
+
+    //    std::cout << scale << std::endl;
+
+    //    if (scale_opt.step() < 1e-6) {
+    //        printf("Done in %i iterations!\n", iter);
+    //        break;
+    //    }
+    //}
 }

 void run_tasks(cmd_args const& args)
@@ -361,14 +503,17 @@
     }

     if (task == task_t::ground_state_new || task == task_t::ground_state_restart) {
-        Simulation_context* ctx = create_sim_ctx(fname, args, inp);
+        std::unique_ptr<Simulation_context> ctx(create_sim_ctx(fname, args, inp));
         ctx->initialize();
         ground_state(*ctx, task, args, inp, 1);
-        delete ctx;
     }

     if (task == task_t::lattice_relaxation_new) {
         lattice_relaxation(task, args, inp);
+    }
+
+    if (task == task_t::volume_relaxation_new) {
+        volume_relaxation(task, args, inp);
     }

 }


Buffer of std::cin now cleared properly when asking if four cards are the same suit.

--- apps/crib_hand_helper.cpp
+++ apps/crib_hand_helper.cpp
@@ -226,6 +226,8 @@
         if (!input_is_valid)
         {
           std::cout << "Invalid selection. Please enter y or n.\n";
+          std::cin.clear();
+          std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
         }
       }
       need_suits = response == 'y';


Started with px4io stop implementation

Started with px4io stop implementation

--- apps/drivers/px4io/px4io.cpp
+++ apps/drivers/px4io/px4io.cpp
@@ -825,9 +825,38 @@
 		exit(0);
 	}

+	if (!strcmp(argv[1], "stop")) {
+
+			if (g_dev != nullptr) {
+				/* stop the driver */
+				delete g_dev;
+			} else {
+				errx(1, "not loaded");
+			}
+			exit(0);
+		}
+
+
+	if (!strcmp(argv[1], "status")) {
+
+			if (g_dev != nullptr)
+				printf("[px4io] loaded\n");
+			else
+				printf("[px4io] not loaded\n");
+
+			exit(0);
+		}
+
 	/* note, stop not currently implemented */

 	if (!strcmp(argv[1], "update")) {
+
+		if (g_dev != nullptr) {
+			printf("[px4io] loaded, detaching first\n");
+			/* stop the driver */
+			delete g_dev;
+		}
+
 		PX4IO_Uploader *up;
 		const char *fn[3];

@@ -883,5 +912,5 @@
 	if (!strcmp(argv[1], "monitor"))
 		monitor();

-	errx(1, "need a command, try 'start', 'test', 'monitor' or 'update'");
-}
+	errx(1, "need a command, try 'start', 'stop', 'status', 'test', 'monitor' or 'update'");
+}


Issue fix and verification of Tizen PPM Sample App after CA Integration

Change-Id: I3a13be7425e5cd7d4b9dd9c2e381ece23142d778
Signed-off-by: krishna.kb <05971beb6b54eccc91b6e39c974ca99ace4664bd@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/840
Reviewed-by: Madan Lanka <f0ab8ffa6f9be130982d9ec09d220706b52daee1@samsung.com>
Tested-by: Madan Lanka <f0ab8ffa6f9be130982d9ec09d220706b52daee1@samsung.com>

--- service/protocol-plugin/sample-app/tizen/PPMSampleApp/src/ppmsampleapp.cpp
+++ service/protocol-plugin/sample-app/tizen/PPMSampleApp/src/ppmsampleapp.cpp
@@ -541,8 +541,9 @@
             std::cout << "Before find Resource... " << std::endl;

             // Find fan resources
-            OCPlatform::findResource("", "coap://224.0.1.187/oc/core?rt=core.fan", OC_WIFI,
-                                     &foundResourceFan);
+            std::ostringstream requestURI;
+            requestURI << OC_WELL_KNOWN_QUERY << "?rt=core.fan";
+            OCPlatform::findResource("", requestURI.str(), OC_WIFI, &foundResourceFan);
             std::cout << "Finding Resource... " << std::endl;
         }
         catch (OCException &e)


Update opengl_test to use Buffer

Update opengl_test to use Buffer

--- apps/glsl/opengl_test.cpp
+++ apps/glsl/opengl_test.cpp
@@ -4,76 +4,47 @@

 #include "HalideRuntime.h"
 #include "HalideRuntimeOpenGL.h"
+#include "HalideBuffer.h"
+
+using Halide::Buffer;

 #include "halide_blur_glsl.h"
 #include "halide_ycc_glsl.h"

-
-class Image {
-public:
-    enum Layout {
-        Interleaved, Planar
-    };
-
-    buffer_t buf;
-
-    Image(int w, int h, int c, int elem_size, Layout layout = Interleaved) {
-        memset(&buf, 0, sizeof(buffer_t));
-        buf.extent[0] = w;
-        buf.extent[1] = h;
-        buf.extent[2] = c;
-        buf.elem_size = elem_size;
-
-        if (layout == Interleaved) {
-            buf.stride[0] = buf.extent[2];
-            buf.stride[1] = buf.extent[0] * buf.stride[0];
-            buf.stride[2] = 1;
-        } else {
-            buf.stride[0] = 1;
-            buf.stride[1] = buf.extent[0] * buf.stride[0];
-            buf.stride[2] = buf.extent[1] * buf.stride[1];
-        }
-        size_t size = w * h * c * elem_size;
-        buf.host = (uint8_t*)malloc(size);
-        memset(buf.host, 0, size);
-        buf.host_dirty = true;
-    }
-    ~Image() {
-        free(buf.host);
-    }
-};
-
 void test_blur() {
     const int W = 12, H = 32, C = 3;
-    Image input(W, H, C, sizeof(uint8_t), Image::Planar);
-    Image output(W, H, C, sizeof(uint8_t), Image::Planar);
+    Buffer<uint8_t> input(W, H, C);
+    Buffer<uint8_t> output(W, H, C);

     fprintf(stderr, "test_blur\n");
-    halide_blur_glsl(&input.buf, &output.buf);
+    halide_blur_glsl(input, output);
     fprintf(stderr, "test_blur complete\n");
 }

 void test_ycc() {
     const int W = 12, H = 32, C = 3;
-    Image input(W, H, C, sizeof(uint8_t), Image::Planar);
-    Image output(W, H, C, sizeof(uint8_t), Image::Planar);
+    Buffer<uint8_t> input(W, H, C);
+    Buffer<uint8_t> output(W, H, C);

     fprintf(stderr, "test_ycc\n");
-    halide_ycc_glsl(&input.buf, &output.buf);
+    halide_ycc_glsl(input, output);
     fprintf(stderr, "Ycc complete\n");
 }

 void test_device_sync() {
     const int W = 12, H = 32, C = 3;
-    Image temp(W, H, C, sizeof(uint8_t), Image::Planar);
+    Buffer<uint8_t> temp(W, H, C);

-    int result = halide_device_malloc(nullptr, &temp.buf, halide_opengl_device_interface());
+    temp.set_host_dirty();
+    int result = temp.copy_to_device(halide_opengl_device_interface());
     if (result != 0) {
         fprintf(stderr, "halide_device_malloc failed with return %d.\n", result);
+        abort();
     } else {
-        result = halide_device_sync(nullptr, &temp.buf);
+        result = temp.device_sync();
         if (result != 0) {
             fprintf(stderr, "halide_device_sync failed with return %d.\n", result);
+            abort();
         } else {
             fprintf(stderr, "Test device sync complete.\n");
         }


INTEGRATION: CWS ooxtablefilter (1.3.2); FILE MERGED 2008/06/10 09:52:24 sj 1.3.2.2: RESYNC: (1.3-1.4); FILE MERGED 2008/04/02 17:43:49 sj 1.3.2.1: added table import

--- oox/source/drawingml/textparagraphpropertiescontext.cxx
+++ oox/source/drawingml/textparagraphpropertiescontext.cxx
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: textparagraphpropertiescontext.cxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -36,10 +36,10 @@
 #include "oox/drawingml/colorchoicecontext.hxx"
 #include "oox/drawingml/textcharacterpropertiescontext.hxx"
 #include "oox/drawingml/drawingmltypes.hxx"
+#include "oox/drawingml/textfontcontext.hxx"
 #include "oox/helper/attributelist.hxx"
 #include "oox/core/namespaces.hxx"
 #include "textspacingcontext.hxx"
-#include "textfontcontext.hxx"
 #include "texttabstoplistcontext.hxx"
 #include "tokens.hxx"


moved widget update to main thread

moved widget update to main thread

git-svn-id: 767549f2a3626ae39d79f5348867a3ebb5082aca@2689 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/perception/world_model/maps/src/renderers/DataControlRenderer.cpp
+++ software/perception/world_model/maps/src/renderers/DataControlRenderer.cpp
@@ -43,51 +43,11 @@
     TimeKeeper() : mLastUpdateTime(-1), mLabel(NULL) {}
   };

-  struct LastUpdateChecker {
-    DataControlRenderer* mRenderer;
-    std::thread mThread;
-    bool mIsRunning;
-
-    LastUpdateChecker(DataControlRenderer* iRenderer) : mRenderer(iRenderer) {
-      mThread = std::thread(std::ref(*this));
-    }
-
-    ~LastUpdateChecker() {
-      mIsRunning = false;
-      mThread.join();
-    }
-
-    void operator()() {
-      mIsRunning = true;
-      while (mIsRunning) {
-        int64_t currentTime = drc::Clock::instance()->getCurrentWallTime();
-        std::unordered_map<std::string, TimeKeeper>::const_iterator iter;
-        {
-          std::lock_guard<std::mutex> lock(mRenderer->mTimeKeepersMutex);
-          for (iter = mRenderer->mTimeKeepers.begin();
-               iter != mRenderer->mTimeKeepers.end(); ++iter) {
-            int64_t lastUpdateTime = iter->second.mLastUpdateTime;
-            if (lastUpdateTime < 0) continue;
-            int dtSec = (currentTime - lastUpdateTime)/1000000;
-            if (dtSec > 0) {
-              std::string text = static_cast<std::ostringstream*>
-                (&(std::ostringstream() << dtSec) )->str();
-              text = "(" + text + "s)";
-              iter->second.mLabel->set_text(text);
-            }
-          }
-        }
-        std::this_thread::sleep_for(std::chrono::milliseconds(500));
-      }
-    }
-  };
-
 protected:
   Gtk::VBox* mRequestControlBox;
   std::unordered_map<int, RequestControl::Ptr> mRequestControls;
   int mSpinRate;

-  std::shared_ptr<LastUpdateChecker> mUpdateChecker;
   std::unordered_map<std::string, ChannelType> mChannels;
   std::unordered_map<std::string, TimeKeeper> mTimeKeepers;
   std::mutex mTimeKeepersMutex;
@@ -107,13 +67,32 @@
     // create and show ui widgets
     setupWidgets();

-    // create update timers
-    mUpdateChecker.reset(new LastUpdateChecker(this));
+    // create update timer
+    Glib::signal_timeout().connect
+      (sigc::mem_fun(*this, &DataControlRenderer::checkTimers), 500);
   }

   ~DataControlRenderer() {
-    mUpdateChecker->mIsRunning = false;
-    mUpdateChecker.reset();
+  }
+
+  bool checkTimers() {
+    int64_t currentTime = drc::Clock::instance()->getCurrentWallTime();
+    std::unordered_map<std::string, TimeKeeper>::const_iterator iter;
+    {
+      std::lock_guard<std::mutex> lock(mTimeKeepersMutex);
+      for (iter = mTimeKeepers.begin(); iter != mTimeKeepers.end(); ++iter) {
+	int64_t lastUpdateTime = iter->second.mLastUpdateTime;
+	if (lastUpdateTime < 0) continue;
+	int dtSec = (currentTime - lastUpdateTime)/1000000;
+	if (dtSec > 0) {
+	  std::string text = static_cast<std::ostringstream*>
+	    (&(std::ostringstream() << dtSec) )->str();
+	  text = "(" + text + "s)";
+	  iter->second.mLabel->set_text(text);
+	}
+      }
+    }
+    return true;
   }

   void onMessage(const lcm::ReceiveBuffer* iBuf, const std::string& iChannel) {


Add initial windows login item implementation

--- atom/browser/browser_win.cc
+++ atom/browser/browser_win.cc
@@ -274,10 +274,47 @@
 }

 void Browser::SetLoginItemSettings(LoginItemSettings settings) {
+  base::FilePath path;
+  if (!PathService::Get(base::FILE_EXE, &path)) {
+    LOG(ERROR) << "Error getting app exe path";
+    return;
+  }
+
+  // Main Registry Key
+  HKEY root = HKEY_CURRENT_USER;
+  std::string keyPathStr = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
+  std::wstring keyPath = std::wstring(keyPathStr.begin(), keyPathStr.end());
+
+  // Executable Path
+  std::wstring exePath(path.value());
+  base::win::RegKey key(root, keyPath.c_str(), KEY_ALL_ACCESS);
+
+  if (settings.open_at_login)
+    key.WriteValue(GetAppUserModelID(), exePath.c_str());
+  else {
+    key.DeleteValue(GetAppUserModelID())
+  }
 }

 LoginItemSettings Browser::GetLoginItemSettings() {
-  return LoginItemSettings();
+  LoginItemSettings settings;
+
+  base::FilePath path;
+  if (!PathService::Get(base::FILE_EXE, &path)) {
+    LOG(ERROR) << "Error getting app exe path";
+    return;
+  }
+
+  // Main Registry Key
+  HKEY root = HKEY_CURRENT_USER;
+  std::string keyPathStr = "Software\\Microsoft\\Windows\\CurrentVersion\\Run";
+  std::wstring keyPath = std::wstring(keyPathStr.begin(), keyPathStr.end());
+
+  // Executable Path
+  std::wstring exePath(path.value());
+  base::win::RegKey key(root, keyPath.c_str(), KEY_ALL_ACCESS);
+
+  settings.open_at_login = key.HasValue(GetAppUserModelID());
 }


avoid loop for normals of cone

avoid loop for normals of cone

--- src/Core/Mesh/MeshPrimitives.cpp
+++ src/Core/Mesh/MeshPrimitives.cpp
@@ -527,23 +527,28 @@
     result.m_normals.reserve(2+nFaces);
     result.m_triangles.reserve(2*nFaces);

-    Core::Vector3 ab = tip - base;
+    Vector3 ab = tip - base;
+    Vector3 dir = ab.normalized();

     //  Create two circles normal centered on A and B and normal to ab;
-    Core::Vector3 xPlane, yPlane;
-    Core::Vector::getOrthogonalVectors( ab, xPlane, yPlane );
+    Vector3 xPlane, yPlane;
+    Vector::getOrthogonalVectors( ab, xPlane, yPlane );
     xPlane.normalize();
     yPlane.normalize();

     result.m_vertices.push_back( base );
     result.m_vertices.push_back( tip );
+    result.m_normals.push_back( -dir );
+    result.m_normals.push_back( dir );

     const Scalar thetaInc( Core::Math::PiMul2 / Scalar( nFaces ) );
     for ( uint i = 0; i < nFaces; ++i )
     {
         const Scalar theta = i * thetaInc;
-        result.m_vertices.push_back(
-            base + radius * ( std::cos( theta ) * xPlane + std::sin( theta ) * yPlane ) );
+        Vector3 normal = std::cos( theta ) * xPlane + std::sin( theta ) * yPlane;
+
+        result.m_vertices.push_back( base + radius * normal );
+        result.m_normals.push_back( (normal-dir).normalized() );
     }

     for ( uint i = 0; i < nFaces; ++i )
@@ -554,7 +559,6 @@
         result.m_triangles.push_back( Triangle( 0, br, bl ) );
         result.m_triangles.push_back( Triangle( 1, bl, br ) );
     }
-    getAutoNormals( result, result.m_normals );
     checkConsistency( result );
     return result;
 }