Index: src/Fragmentation/Automation/MPQCCommandFragmentController.cpp
===================================================================
--- src/Fragmentation/Automation/MPQCCommandFragmentController.cpp	(revision 1d17e57c9c64b6781a9d183fcf18872bae9cf9b9)
+++ src/Fragmentation/Automation/MPQCCommandFragmentController.cpp	(revision 1d17e57c9c64b6781a9d183fcf18872bae9cf9b9)
@@ -0,0 +1,111 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * MPQCCommandFragmentController.cpp
+ *
+ *  Created on: Apr 14, 2014
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/archive/text_iarchive.hpp>
+// boost asio needs specific operator new
+//#include <boost/asio.hpp>
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "MPQCCommandFragmentController.hpp"
+
+#include <boost/cast.hpp>
+#include <boost/filesystem/operations.hpp>
+#include <vector>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Box.hpp"
+#include "Helpers/defs.hpp"
+#include "Fragmentation/Automation/FragmentJobQueue.hpp"
+#include "Jobs/MPQCCommandJob.hpp"
+#include "LinearAlgebra/RealSpaceMatrix.hpp"
+#include "World.hpp"
+
+// static entities
+unsigned int MPQCCommandFragmentController::nextid = 0;
+
+bool MPQCCommandFragmentController::addJobsFromQueue(
+    const MPQCData::DoLongrange_t _DoLongrange,
+    const MPQCData::DoValenceOnly_t _DoValenceOnly
+    )
+{
+  // give them all valid ids
+  std::vector<FragmentJob::ptr> newjobs = FragmentJobQueue::getInstance().getJobs();
+  for (std::vector<FragmentJob::ptr>::iterator jobiter = newjobs.begin();
+      jobiter != newjobs.end();
+      ++jobiter) {
+    MPQCCommandJob *job = boost::polymorphic_downcast<MPQCCommandJob *>(jobiter->get());
+//    job->DoLongrange = _DoLongrange;
+//    job->DoValenceOnly = _DoValenceOnly;
+#ifndef HAVE_JOBMARKET
+    job->setId(getAvailableId());
+#endif /* cause we don't inherit from FragmentController */
+    // add the jobs
+    queue.push_back(job);
+  }
+
+  return queue.size();
+}
+
+void MPQCCommandFragmentController::run()
+{
+  // take jobs from queue and add them
+  std::vector<FragmentResult::ptr> resultvector;
+  while(!queue.empty()) {
+    // pop job from list
+    MPQCCommandJob *job = queue.front();
+    queue.pop_front();
+    // run job and set exitflag if failed (>0)
+    FragmentResult::ptr result = job->Work();
+    if (result->exitflag) {
+      ELOG(2, "Job #" << job->getId() << " has failed execution.");
+    }
+    exitflag = result->exitflag == 0 ?
+        exitflag :
+        ( result->exitflag > exitflag ?
+            result->exitflag :
+            exitflag );
+    // store result
+    resultvector.push_back(result);
+  }
+
+  // convert all results to MPQCData
+  std::vector<MPQCData> fragmentData;
+  results.ConvertFragmentResultTo(resultvector, fragmentData);
+  // insert into final map
+  results.insertResults(resultvector, fragmentData);
+}
Index: src/Fragmentation/Automation/MPQCCommandFragmentController.hpp
===================================================================
--- src/Fragmentation/Automation/MPQCCommandFragmentController.hpp	(revision 1d17e57c9c64b6781a9d183fcf18872bae9cf9b9)
+++ src/Fragmentation/Automation/MPQCCommandFragmentController.hpp	(revision 1d17e57c9c64b6781a9d183fcf18872bae9cf9b9)
@@ -0,0 +1,105 @@
+/*
+ * MPQCCommandFragmentController.hpp
+ *
+ *  Created on: Apr 14, 2014
+ *      Author: heber
+ */
+
+#ifndef MPQCCOMMANDFRAGMENTCONTROLLER_HPP_
+#define MPQCCOMMANDFRAGMENTCONTROLLER_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/filesystem/path.hpp>
+
+#include <list>
+#include <map>
+#include <string>
+#include <vector>
+
+#include "Fragmentation/Summation/Containers/MPQCData.hpp"
+#include "Fragmentation/Automation/ResultContainer.hpp"
+
+/** This class mimics the interface of SpecificFragmentController derived from
+ * JobMarket's FragmentController but without using JobMarket.
+ *
+ * This is for calculating fragments via MPQCCommandJobs when JobMarket is not
+ * available.
+ */
+class MPQCCommandFragmentController
+{
+public:
+  MPQCCommandFragmentController() :
+	  exitflag(0)
+  {}
+  ~MPQCCommandFragmentController()
+  {}
+
+  /** Command Controller to fill its hold of jobs from FragmentJobQueue.
+   *
+   * \param _DoSampleDensity whether to actually sample the resulting electronic density
+   * \param _DoValenceOnly whether to sample just the valence or the total elctron and nuclei density
+   * \return true - jobs obtained, false - queue empty
+   */
+  bool addJobsFromQueue(
+      const MPQCData::DoLongrange_t _DoLongrange,
+      const MPQCData::DoValenceOnly_t _DoValenceOnly
+      );
+
+  /** Mimicks waitforResults but actually does nothing.
+   *
+   */
+  void waitforResults(const size_t NoExpectedResults)
+  { return; }
+
+  /** Get results map of calculated jobs.
+   *
+   * \param fragmentData contains map of results on output
+   */
+  void getResults(std::map<JobId_t, MPQCData> &fragmentData) {
+    fragmentData.insert(results.IdData.begin(), results.IdData.end());
+    results.clear();
+  }
+
+  /** Runs the service.
+   *
+   * Here, we finalize each job's id and push them to the server.
+   */
+  void run();
+
+  /** Mimicks a (unlimited) pool of requested ids that are served by this function.
+   *
+   * \return next unique job id to use
+   */
+  unsigned int getAvailableId()
+  {
+	  return nextid++;
+  }
+
+  /** Getter for exitflag.
+   *
+   * \return exitflag
+   */
+  int getExitflag() const
+  { return exitflag; }
+
+private:
+  //!> static member variable to count individual job ids
+  static unsigned int nextid;
+
+  //!> overall exit flag of jobs
+  int exitflag;
+
+  //!> queue with all jobs to calculate serially
+  std::list<MPQCCommandJob *> queue;
+
+  //!> type-specific result container
+  ResultContainer<MPQCData> results;
+};
+
+
+#endif /* MPQCCOMMANDFRAGMENTCONTROLLER_HPP_ */
Index: src/Fragmentation/Automation/Makefile.am
===================================================================
--- src/Fragmentation/Automation/Makefile.am	(revision 786d28e4533ffcfc1d63d95f08f65c92dd946946)
+++ src/Fragmentation/Automation/Makefile.am	(revision 1d17e57c9c64b6781a9d183fcf18872bae9cf9b9)
@@ -3,5 +3,6 @@
 
 FRAGMENTATIONAUTOMATIONSOURCE = \
-	Fragmentation/Automation/FragmentJobQueue.cpp
+	Fragmentation/Automation/FragmentJobQueue.cpp \
+	Fragmentation/Automation/MPQCCommandFragmentController.cpp
 
 if CONDJOBMARKET
@@ -19,4 +20,5 @@
 FRAGMENTATIONAUTOMATIONHEADER = \
 	Fragmentation/Automation/FragmentJobQueue.hpp \
+	Fragmentation/Automation/MPQCCommandFragmentController.hpp \
 	Fragmentation/Automation/ResultContainer.hpp \
 	Fragmentation/Automation/ResultContainer_impl.hpp
