Index: src/Fragmentation/Converter/DataConverter.hpp
===================================================================
--- src/Fragmentation/Converter/DataConverter.hpp	(revision 0398bd3f86573bb724b71c8e05ebaeadda50c7c7)
+++ src/Fragmentation/Converter/DataConverter.hpp	(revision 34340193276773ab7abaeb6bbee9133e14de0dfb)
@@ -15,5 +15,5 @@
 #endif
 
-#include <vector>
+#include <map>
 #include <boost/fusion/sequence.hpp>
 
@@ -38,6 +38,6 @@
 template <typename source, typename dest>
 inline void convertDataTo(
-    const std::vector<source> &fragmentData,
-    std::vector<dest> &MPQCData_fused)
+    const std::map<JobId_t, source> &fragmentData,
+    std::map<JobId_t, dest> &MPQCData_fused)
 {
   MPQCData_fused.clear();
@@ -46,13 +46,12 @@
 template <>
 inline void convertDataTo<MPQCData, MPQCDataEnergyMap_t>(
-    const std::vector<MPQCData> &fragmentData,
-    std::vector<MPQCDataEnergyMap_t> &MPQCData_Energy_fused)
+    const std::map<JobId_t, MPQCData> &fragmentData,
+    std::map<JobId_t, MPQCDataEnergyMap_t> &MPQCData_Energy_fused)
 {
   // energy_t
   MPQCData_Energy_fused.clear();
-  MPQCData_Energy_fused.reserve(fragmentData.size());
-  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+  for(std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
       dataiter != fragmentData.end(); ++dataiter) {
-    const MPQCData &extractedData = *dataiter;
+    const MPQCData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     MPQCDataEnergyMap_t instance;
@@ -66,5 +65,5 @@
     boost::fusion::at_key<MPQCDataFused::energy_hcore>(instance) = extractedData.energies.hcore;
     boost::fusion::at_key<MPQCDataFused::energy_eigenvalues>(instance) = extractedData.energies.eigenvalues;
-    MPQCData_Energy_fused.push_back(instance);
+    MPQCData_Energy_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
@@ -73,13 +72,12 @@
 template <>
 inline void convertDataTo<VMGData, VMGDataMap_t>(
-    const std::vector<VMGData> &longrangeData,
-    std::vector<VMGDataMap_t> &VMGData_fused)
+    const std::map<JobId_t, VMGData> &longrangeData,
+    std::map<JobId_t, VMGDataMap_t> &VMGData_fused)
 {
   // energy_t
   VMGData_fused.clear();
-  VMGData_fused.reserve(longrangeData.size());
-  for(std::vector<VMGData>::const_iterator dataiter = longrangeData.begin();
+  for(std::map<JobId_t, VMGData>::const_iterator dataiter = longrangeData.begin();
       dataiter != longrangeData.end(); ++dataiter) {
-    const VMGData &extractedData = *dataiter;
+    const VMGData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     VMGDataMap_t instance;
@@ -87,5 +85,5 @@
     boost::fusion::at_key<VMGDataFused::energy_potential>(instance) = extractedData.sampled_potential.integral();
     boost::fusion::at_key<VMGDataFused::energy_long>(instance) = extractedData.e_long;
-    VMGData_fused.push_back(instance);
+    VMGData_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
@@ -93,7 +91,7 @@
 
 inline void convertMPQCDatatoForceMap(
-    const std::vector<MPQCData> &fragmentData,
+    const std::map<JobId_t, MPQCData> &fragmentData,
     const KeySetsContainer &ForceKeySet,
-    std::vector<MPQCDataForceMap_t> &MPQCData_Force_fused)
+    std::map<JobId_t, MPQCDataForceMap_t> &MPQCData_Force_fused)
 {
   // forces
@@ -101,9 +99,8 @@
       "FragmentationAutomationAction::performCall() - indices and fragmentData differ in size.");
   MPQCData_Force_fused.clear();
-  MPQCData_Force_fused.reserve(fragmentData.size());
-  std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+  std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
   KeySetsContainer::ArrayOfIntVectors::const_iterator arrayiter = ForceKeySet.KeySets.begin();
   for(;dataiter != fragmentData.end(); ++dataiter, ++arrayiter) {
-    const MPQCData &extractedData = *dataiter;
+    const MPQCData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     MPQCDataForceMap_t instance;
@@ -112,5 +109,5 @@
     boost::fusion::at_key<MPQCDataFused::forces>(instance) =
         IndexedVectors(indices, extractedData.forces);
-    MPQCData_Force_fused.push_back(instance);
+    MPQCData_Force_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
@@ -118,17 +115,16 @@
 template <>
 inline void convertDataTo<MPQCData, MPQCDataGridMap_t>(
-    const std::vector<MPQCData> &fragmentData,
-    std::vector<MPQCDataGridMap_t> &MPQCData_Grid_fused)
+    const std::map<JobId_t, MPQCData> &fragmentData,
+    std::map<JobId_t, MPQCDataGridMap_t> &MPQCData_Grid_fused)
 {
   // sampled_grid
   MPQCData_Grid_fused.clear();
-  MPQCData_Grid_fused.reserve(fragmentData.size());
-  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+  for(std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
       dataiter != fragmentData.end(); ++dataiter) {
-    const MPQCData &extractedData = *dataiter;
+    const MPQCData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     MPQCDataGridMap_t instance;
     boost::fusion::at_key<MPQCDataFused::sampled_grid>(instance) = extractedData.sampled_grid;
-    MPQCData_Grid_fused.push_back(instance);
+    MPQCData_Grid_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
@@ -136,18 +132,17 @@
 template <>
 inline void convertDataTo<MPQCData, MPQCDataFragmentMap_t>(
-    const std::vector<MPQCData> &fragmentData,
-    std::vector<MPQCDataFragmentMap_t> &MPQCData_Fragment_fused)
+    const std::map<JobId_t, MPQCData> &fragmentData,
+    std::map<JobId_t, MPQCDataFragmentMap_t> &MPQCData_Fragment_fused)
 {
   // fragment
   MPQCData_Fragment_fused.clear();
-  MPQCData_Fragment_fused.reserve(fragmentData.size());
-  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+  for(std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
       dataiter != fragmentData.end(); ++dataiter) {
-    const MPQCData &extractedData = *dataiter;
+    const MPQCData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     MPQCDataFragmentMap_t instance;
     boost::fusion::at_key<MPQCDataFused::fragment>(instance) =
         Fragment(extractedData.positions, extractedData.charges);
-    MPQCData_Fragment_fused.push_back(instance);
+    MPQCData_Fragment_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
@@ -155,13 +150,12 @@
 template <>
 inline void convertDataTo<MPQCData, MPQCDataTimeMap_t>(
-    const std::vector<MPQCData> &fragmentData,
-    std::vector<MPQCDataTimeMap_t> &MPQCData_Time_fused)
+    const std::map<JobId_t, MPQCData> &fragmentData,
+    std::map<JobId_t, MPQCDataTimeMap_t> &MPQCData_Time_fused)
 {
   // times
   MPQCData_Time_fused.clear();
-  MPQCData_Time_fused.reserve(fragmentData.size());
-  for(std::vector<MPQCData>::const_iterator dataiter = fragmentData.begin();
+  for(std::map<JobId_t, MPQCData>::const_iterator dataiter = fragmentData.begin();
       dataiter != fragmentData.end(); ++dataiter) {
-    const MPQCData &extractedData = *dataiter;
+    const MPQCData &extractedData = dataiter->second;
     LOG(4, "DEBUG: Current extracted Data is " << extractedData << ".");
     MPQCDataTimeMap_t instance;
@@ -169,5 +163,5 @@
     boost::fusion::at_key<MPQCDataFused::times_cputime>(instance) = extractedData.times.cputime;
     boost::fusion::at_key<MPQCDataFused::times_flops>(instance) = extractedData.times.flops;
-    MPQCData_Time_fused.push_back(instance);
+    MPQCData_Time_fused.insert( std::make_pair(dataiter->first, instance) );
   }
 }
