Index: src/Fragmentation/Automation/Jobs/MPQCCommandJob.cpp
===================================================================
--- src/Fragmentation/Automation/Jobs/MPQCCommandJob.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * MPQCCommandJob.cpp
- *
- *  Created on: Feb 05, 2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-// include headers that implement a archive in simple text format
-// otherwise BOOST_CLASS_EXPORT_IMPLEMENT has no effect
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-#include "MPQCCommandJob.hpp"
-
-// include headers that implement a archive in simple text format
-#include <boost/archive/text_oarchive.hpp>
-
-#include <boost/algorithm/string.hpp>
-#include <boost/lexical_cast.hpp>
-#include <boost/tokenizer.hpp>
-#include <sstream>
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Log.hpp"
-
-const std::string MPQCCommandJob::keyword_hartreefock_energy("total scf energy");
-const std::string MPQCCommandJob::keyword_moellerplesset_energy("MP2 energy [au]:");
-const std::string MPQCCommandJob::keyword_hartreefock_forces("Total Gradient");
-const std::string MPQCCommandJob::keyword_moellerplesset_forces("Total MP2 gradient [au]:");
-
-/** Default constructor for class MPQCCommandJob.
- *
- */
-MPQCCommandJob::MPQCCommandJob()
-{}
-
-/** Constructor for class MPQCCommandJob.
- *
- * @param _inputfile string of inputfile contents
- * @param _JobId id of this job
- * @param command mpqc command, "mpqc" as default
- */
-MPQCCommandJob::MPQCCommandJob(
-    const std::string &_inputfile,
-    const JobId_t _JobId,
-    const std::string &command) :
-    SystemCommandJob(command, _inputfile, _JobId)
-{}
-
-/** Destructor for class MPQCCommandJob.
- *
- */
-MPQCCommandJob::~MPQCCommandJob()
-{}
-
-/** Extracts energy and forces from the output of the command.
- *
- * @param resultstring output of the command to parse
- * @return FragmentResult with energy and forces
- */
-FragmentResult::ptr MPQCCommandJob::extractResult(const std::string &resultstring)
-{
-  std::stringstream returnstream;
-  // tokenizers
-  typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
-  boost::char_separator<char> keyvalue_separator("=:");
-  boost::char_separator<char> whitespace(" \t");
-
-  // split into lines
-  std::vector<std::string> lines;
-  boost::split(lines, resultstring, boost::is_any_of("\n"));
-
-  // go through each line
-  bool gradient_section = false;
-  for (std::vector<std::string>::const_iterator iter = lines.begin();
-      iter != lines.end();++iter) {
-    LOG(3, "DEBUG: Current line is '" << *iter << "'.");
-    if (gradient_section) {
-      tokenizer tokens(*iter, whitespace);
-      if (*iter != std::string("")) {
-        tokenizer::iterator tok_iter = tokens.begin();
-        tok_iter++;
-        tok_iter++;
-        MPQCData::vector_type forcevector(NDIM);
-        try { // first col is index, second is element
-          for (size_t index = 0;index < NDIM; ++index)
-            forcevector[index] = boost::lexical_cast<double>(*(tok_iter++));
-          LOG(2, "INFO: Recognized force vector in '"+*iter+"'.");
-          data.forces.push_back( forcevector );
-        } catch(boost::bad_lexical_cast){
-          LOG(2, "INFO: Did not recognize a force vector, hence ending section at '"+*iter+"'.");
-          gradient_section = false;
-        }
-      } else {
-        LOG(2, "INFO: Recognized gradient section end in '"+*iter+"'.");
-        gradient_section = false;
-      }
-    }
-    // extract energy ("total scf energy") ...
-    if (((*iter).find(keyword_hartreefock_energy) != std::string::npos)
-        || ((*iter).find(keyword_moellerplesset_energy) != std::string::npos))
-    {
-      LOG(2, "INFO: Recognized energy in '"+*iter+"'.");
-      tokenizer tokens(*iter, keyvalue_separator);
-      tokenizer::iterator tok_iter = tokens.begin();
-      tok_iter++;
-      std::stringstream energystring(*tok_iter);
-      energystring >> data.energy;
-    }
-    // ... and forces ("Total Gradient") from resultstring
-    if (((*iter).find(keyword_hartreefock_forces) != std::string::npos)
-        || ((*iter).find(keyword_moellerplesset_forces) != std::string::npos))
-    {
-      LOG(2, "INFO: Recognized gradient section init in '"+*iter+"'.");
-      gradient_section=true;
-      data.forces.clear();
-    }
-  }
-
-  // place into returnstream
-  boost::archive::text_oarchive oa(returnstream);
-  oa << data;
-
-  FragmentResult::ptr s( new FragmentResult(getId(), returnstream.str()) );
-  return s;
-}
-
-bool MPQCCommandJob::operator==(const MPQCCommandJob &other) const
-{
-  if (data != other.data) {
-    LOG(2, "INFO: data's of both MPQCCommandJob don't match.");
-    return false;
-  }
-  return (static_cast<const SystemCommandJob &>(*this)
-      == static_cast<const SystemCommandJob &>(other));
-}
-
-
-// we need to explicitly instantiate the serialization functions as
-// its is only serialized through its base class FragmentJob
-BOOST_CLASS_EXPORT_IMPLEMENT(MPQCCommandJob)
Index: src/Fragmentation/Automation/Jobs/MPQCCommandJob.hpp
===================================================================
--- src/Fragmentation/Automation/Jobs/MPQCCommandJob.hpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*
- * MPQCJob.hpp
- *
- *  Created on: Feb 05, 2012
- *      Author: heber
- */
-
-#ifndef MPQCCOMMANDJOB_HPP_
-#define MPQCCOMMANDJOB_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/serialization/export.hpp>
-
-#include <string>
-
-#include "Results/FragmentResult.hpp"
-#include "Jobs/SystemCommandJob.hpp"
-
-#include "Jobs/MPQCCommandJob_MPQCData.hpp"
-
-class MPQCCommandJobTest;
-
-/** This class calls mpqc for solving a specific Hartree Fock problem.
- *
- */
-class MPQCCommandJob : public SystemCommandJob
-{
-  //!> grant unit test access
-  friend class MPQCCommandJobTest;
-public:
-  MPQCCommandJob(const std::string &_inputfile, const JobId_t _JobId, const std::string &_command = std::string("mpqc"));
-  ~MPQCCommandJob();
-
-  bool operator==(const MPQCCommandJob &other) const;
-
-  bool operator!=(const MPQCCommandJob &other) const {
-    return !(*this == other);
-  }
-
-private:
-  //!> private default cstor only for serializatio
-  MPQCCommandJob();
-
-  friend class boost::serialization::access;
-  // serialization
-  template <typename Archive>
-  void serialize(Archive& ar, const unsigned int version)
-  {
-    ar & boost::serialization::base_object<SystemCommandJob>(*this);
-    ar & data;
-  }
-
-private:
-  //!> class that contains energy and forces and serialization capabilities
-  MPQCData data;
-
-  FragmentResult::ptr extractResult(const std::string &resultstring);
-  static const std::string keyword_hartreefock_energy;
-  static const std::string keyword_hartreefock_forces;
-  static const std::string keyword_moellerplesset_energy;
-  static const std::string keyword_moellerplesset_forces;
-};
-
-// we need to give this class a unique key for serialization
-// its is only serialized through its base class FragmentJob
-BOOST_CLASS_EXPORT_KEY(MPQCCommandJob)
-
-#endif /* MPQCCOMMANDJOB_HPP_ */
Index: src/Fragmentation/Automation/Jobs/MPQCCommandJob_MPQCData.cpp
===================================================================
--- src/Fragmentation/Automation/Jobs/MPQCCommandJob_MPQCData.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,73 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * MPQCCommandJob_MPQCData.cpp
- *
- *  Created on: Feb 08, 2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include "MPQCCommandJob_MPQCData.hpp"
-
-#include <iostream>
-#include <limits>
-
-#include "CodePatterns/Log.hpp"
-
-/** Constructor for class MPQCData.
- *
- */
-MPQCData::MPQCData() :
-    energy(0.)
-{}
-
-/** Destructor for class MPQCData.
- *
- */
-MPQCData::~MPQCData()
-{}
-
-/** Comparator for class MPQCData.
- *
- */
-bool MPQCData::operator==(const MPQCData &other) const
-{
-  if (fabs(energy - other.energy) > std::numeric_limits<double>::epsilon()) {
-    LOG(1, "INFO: Energy's in MPQCData differ: "
-        << energy << " != " << other.energy << ".");
-    return false;
-  }
-  if (forces.size() != other.forces.size()) {
-    LOG(1, "INFO: Forces's in MPQCData differ in size: "
-        << forces.size() << " != " << other.forces.size() << ".");
-    return false;
-  }
-  for (size_t i = 0; i < forces.size(); ++i)
-    for (size_t index = 0; index < NDIM; ++index)
-      if (fabs(forces[i][index] - other.forces[i][index]) > std::numeric_limits<double>::epsilon()) {
-        LOG(1, "INFO: " << index << "th component of force of particle "
-            << i << " in MPQCData differ: " << forces[i][index]
-            << " != " << other.forces[i][index] << ".");
-        return false;
-      }
-  return true;
-}
-
-std::ostream & operator<<(std::ostream &ost, const MPQCData &data)
-{
-  ost << "Energy: " << data.energy << "\t";
-  ost << "Forces: " << data.forces;
-  return ost;
-}
Index: src/Fragmentation/Automation/Jobs/MPQCCommandJob_MPQCData.hpp
===================================================================
--- src/Fragmentation/Automation/Jobs/MPQCCommandJob_MPQCData.hpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,68 +1,0 @@
-/*
- * MPQCCommandJob_MPQCData.hpp
- *
- *  Created on: Feb 08, 2012
- *      Author: heber
- */
-
-#ifndef MPQCCOMMANDJOB_MPQCDATA_HPP_
-#define MPQCCOMMANDJOB_MPQCDATA_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <boost/serialization/access.hpp>
-#include <boost/serialization/vector.hpp>
-
-#include <iosfwd>
-#include <vector>
-
-#include "LinearAlgebra/defs.hpp"
-
-class MPQCCommandJob;
-class MPQCCommandJobTest;
-class MPQCDataTest;
-
-/** Internal class that holds the data and can be serialized.
- *
- */
-class MPQCData {
-  //!> allow MPQCCommandJob access to member variables directly
-  friend class MPQCCommandJob;
-  //!> grant MPQCCommandJob's unit test access
-  friend class MPQCCommandJobTest;
-  //!> grant unit test access
-  friend class MPQCDataTest;
-  //!> grant access to output stream operator
-  friend std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
-public:
-  MPQCData();
-  ~MPQCData();
-
-  bool operator==(const MPQCData &other) const;
-
-  bool operator!=(const MPQCData &other) const {
-    return !(*this == other);
-  }
-
-  typedef std::vector<double> vector_type;
-
-  double energy;
-  std::vector< vector_type  > forces;
-
-private:
-  friend class boost::serialization::access;
-  // serialization
-  template <typename Archive>
-  void serialize(Archive& ar, const unsigned int version)
-  {
-    ar & energy;
-    ar & forces;
-  }
-};
-
-std::ostream & operator<<(std::ostream &ost, const MPQCData &data);
-
-#endif /* MPQCCOMMANDJOB_MPQCDATA_HPP_ */
Index: src/Fragmentation/Automation/Makefile.am
===================================================================
--- src/Fragmentation/Automation/Makefile.am	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ src/Fragmentation/Automation/Makefile.am	(revision cc5db582dad56745fce8f970d96f7197f1842609)
@@ -18,6 +18,4 @@
   JobId.cpp \
   Jobs/FragmentJob.cpp \
-  Jobs/MPQCCommandJob.cpp \
-  Jobs/MPQCCommandJob_MPQCData.cpp \
   Jobs/SystemCommandJob.cpp \
   Results/FragmentResult.cpp
@@ -27,6 +25,4 @@
   JobId.hpp \
   Jobs/FragmentJob.hpp \
-  Jobs/MPQCCommandJob.hpp \
-  Jobs/MPQCCommandJob_MPQCData.hpp \
   Jobs/SystemCommandJob.hpp \
   Results/FragmentResult.hpp
@@ -106,77 +102,2 @@
 include unittests/Makefile.am
 
-AM_LDFLAGS = -ldl ${BOOST_LDFLAGS}
-AM_CPPFLAGS = ${BOOST_CPPFLAGS} ${CodePatterns_CFLAGS}
-
-bin_PROGRAMS += Controller PoolWorker Server
-
-CONTROLLERSOURCE = \
-  FragmentController.cpp \
-  Operations/OperationRegistry.cpp
-
-CONTROLLERHEADER = \
-  Connection.hpp \
-  FragmentController.hpp \
-  Operations/OperationRegistry.hpp
-
-POOLWORKERSOURCE = \
-  Pool/PoolWorker.cpp
-
-POOLWORKERHEADER = \
-  Connection.hpp \
-  Pool/PoolWorker.hpp
-
-SERVERSOURCE = \
-  FragmentScheduler.cpp \
-  Pool/WorkerPool.cpp
-
-SERVERHEADER = \
-  Connection.hpp \
-  ControllerChoices.hpp \
-  FragmentScheduler.hpp \
-  Pool/WorkerPool.hpp
-
-Controller_SOURCES = $(CONTROLLERSOURCE) $(CONTROLLERHEADER) controller.cpp
-Controller_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
-Controller_CXXFLAGS = $(AM_CPPFLAGS)
-Controller_LDADD = \
-  libMolecuilderFragmentationAutomationHelper.la \
-  libMolecuilderFragmentationOperations.la \
-  libMolecuilderFragmentJobs.la \
-  $(top_builddir)/src/libMolecuilderFragmentation.la \
-  $(top_builddir)/src/libMolecuilderHelpers.la \
-  $(BOOST_ASIO_LIBS) \
-  $(BOOST_SERIALIZATION_LIBS) \
-  $(BOOST_PROGRAM_OPTIONS_LIBS) \
-  $(BOOST_THREAD_LIBS) \
-  $(BOOST_SYSTEM_LIBS) \
-  ${CodePatterns_LIBS}
-
-PoolWorker_SOURCES = $(POOLWORKERSOURCE) $(POOLWORKERHEADER) poolworker.cpp
-PoolWorker_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
-PoolWorker_CXXFLAGS = $(AM_CPPFLAGS) $(BOOST_ASIO_DEBUG)
-PoolWorker_LDADD = \
-  libMolecuilderFragmentationAutomationHelper.la \
-  libMolecuilderFragmentationOperations.la \
-  libMolecuilderFragmentJobs.la \
-  $(BOOST_ASIO_LIBS) \
-  $(BOOST_SERIALIZATION_LIBS) \
-  $(BOOST_PROGRAM_OPTIONS_LIBS) \
-  $(BOOST_THREAD_LIBS) \
-  $(BOOST_SYSTEM_LIBS) \
-  ${CodePatterns_LIBS}
-
-Server_SOURCES = $(SERVERSOURCE) $(SERVERHEADER) Server.cpp
-Server_LDFLAGS = $(AM_LDFLAGS) $(BOOST_ASIO_LDFLAGS) $(BOOST_SYSTEM_LDFLAGS) $(BOOST_THREAD_LDFLAGS) $(BOOST_SERIALIZATION_LDFLAGS)
-Server_CXXFLAGS = $(AM_CPPFLAGS)
-Server_LDADD = \
-  libMolecuilderFragmentationAutomationHelper.la \
-  libMolecuilderFragmentationOperations.la \
-  libMolecuilderFragmentJobs.la \
-  $(BOOST_ASIO_LIBS) \
-  $(BOOST_SERIALIZATION_LIBS) \
-  $(BOOST_PROGRAM_OPTIONS_LIBS) \
-  $(BOOST_THREAD_LIBS) \
-  $(BOOST_SYSTEM_LIBS) \
-  ${CodePatterns_LIBS}
-
Index: src/Fragmentation/Automation/Server.cpp
===================================================================
--- src/Fragmentation/Automation/Server.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,157 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2011-2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file Server.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see server.cpp)
- *
- *  Created on: Oct 21, 2011
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <boost/lexical_cast.hpp>
-#include <boost/program_options.hpp>
-#include <iostream>
-#include <signal.h>
-
-#include "atexit.hpp"
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "FragmentScheduler.hpp"
-
-
-//!> global shutdown function
-boost::function<void (int)> shutdownfunction;
-//!> global signal vector for later releasing
-std::vector<size_t> signals;
-//!> counter for the number of received signals
-size_t NoSignalsReceived = 0;
-//!> maximum number of received signals after which the handlers are released
-const size_t MAX_NOSIGNALSRECEIVED = 3;
-
-void signalhandler(int sig)
-{
-  // increment received signal counter
-  ++NoSignalsReceived;
-
-  // shutdown if we have handler
-  if (shutdownfunction)
-    shutdownfunction(sig);
-
-  if (NoSignalsReceived >= MAX_NOSIGNALSRECEIVED) {
-    // release signal hook again
-    for (std::vector<size_t>::const_iterator iter = signals.begin();
-        iter != signals.end(); ++iter)
-      signal(*iter, NULL);
-  }
-}
-
-int main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("signal", boost::program_options::value< std::vector<size_t> >(), "set signal to catch (can be given multiple times)")
-      ("workerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting workers")
-      ("controllerport", boost::program_options::value< unsigned short >(), "listen on this port for connecting controller")
-  ;
-
-  boost::program_options::variables_map vm;
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  if (vm.count("help")) {
-    std::cout << desc << "\n";
-    return 1;
-  }
-
-  if (vm.count("verbosity")) {
-    LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
-    setVerbosity(vm["verbosity"].as<size_t>());
-  } else {
-    LOG(0, "STATUS: Verbosity level was not set, defaulting to 3.");
-    setVerbosity(3);
-  }
-
-  unsigned short workerport;
-  if (vm.count("workerport")) {
-    try {
-      workerport = vm["workerport"].as< unsigned short >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << workerport << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << workerport << " as listen port for worker.");
-  } else {
-    ELOG(1, "Requiring listen port for worker.");
-    return 255;
-  }
-
-  unsigned short controllerport;
-  if (vm.count("controllerport")) {
-    try {
-      controllerport = vm["controllerport"].as< unsigned short >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << controllerport << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << controllerport << " as listen port for controller.");
-  } else {
-    ELOG(1, "Requiring listen port for controller.");
-    return 255;
-  }
-
-  size_t Exitflag = 0;
-  try
-  {
-    boost::asio::io_service io_service;
-    FragmentScheduler Server(io_service, workerport, controllerport);
-
-    // catch ctrl-c and shutdown worker properly
-    shutdownfunction = boost::bind(&FragmentScheduler::shutdown, boost::ref(Server), _1);
-    if (vm.count("signal")) {
-      signals =  vm["signal"].as< std::vector<size_t> >();
-      for (std::vector<size_t>::const_iterator iter = signals.begin();
-          iter != signals.end(); ++iter) {
-        LOG(0, "STATUS: Catching signal " << *iter << " via signal handler.");
-        signal(*iter, &signalhandler);
-      }
-    } else {
-      LOG(0, "STATUS: No signals are caught.");
-    }
-
-    {
-      Info info("io_service");
-      io_service.run();
-    }
-    Exitflag = Server.getExitflag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-
-  return Exitflag;
-}
Index: src/Fragmentation/Automation/controller.cpp
===================================================================
--- src/Fragmentation/Automation/controller.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,561 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2011 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file controller.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see client.cpp)
- *
- *  Created on: Nov 27, 2011
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-#include <boost/program_options.hpp>
-#include <fstream>
-#include <iostream>
-#include <map>
-#include <sstream>
-#include <streambuf>
-#include <vector>
-
-#include "atexit.hpp"
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "Fragmentation/EnergyMatrix.hpp"
-#include "Fragmentation/ForceMatrix.hpp"
-#include "Fragmentation/KeySetsContainer.hpp"
-#include "FragmentController.hpp"
-#include "Helpers/defs.hpp"
-#include "Jobs/MPQCCommandJob.hpp"
-#include "Jobs/MPQCCommandJob_MPQCData.hpp"
-#include "Jobs/SystemCommandJob.hpp"
-#include "Results/FragmentResult.hpp"
-
-enum CommandIndices {
-  UnknownCommandIndex = 0,
-  AddJobsIndex = 1,
-  CreateJobsIndex = 2,
-  CheckResultsIndex = 3,
-  ReceiveResultsIndex = 4,
-  ReceiveMPQCIndex = 5,
-  RemoveAllIndex = 6,
-  ShutdownIndex = 7,
-};
-
-
-/** Creates a SystemCommandJob out of give \a command with \a argument.
- *
- * @param jobs created job is added to this vector
- * @param command command to execute for SystemCommandJob
- * @param argument argument for command to execute
- * @param nextid id for this job
- */
-void createjobs(
-    std::vector<FragmentJob::ptr> &jobs,
-    const std::string &command,
-    const std::string &argument,
-    const JobId_t nextid)
-{
-
-  FragmentJob::ptr testJob( new SystemCommandJob(command, argument, nextid) );
-  jobs.push_back(testJob);
-  LOG(1, "INFO: Added one SystemCommandJob.");
-}
-
-/** Creates a MPQCCommandJob with argument \a filename.
- *
- * @param jobs created job is added to this vector
- * @param command mpqc command to execute
- * @param filename filename being argument to job
- * @param nextid id for this job
- */
-void parsejob(
-    std::vector<FragmentJob::ptr> &jobs,
-    const std::string &command,
-    const std::string &filename,
-    const JobId_t nextid)
-{
-  std::ifstream file;
-  file.open(filename.c_str());
-  ASSERT( file.good(), "parsejob() - file "+filename+" does not exist.");
-  std::string output((std::istreambuf_iterator<char>(file)),
-      std::istreambuf_iterator<char>());
-  FragmentJob::ptr testJob( new MPQCCommandJob(output, nextid, command) );
-  jobs.push_back(testJob);
-  file.close();
-  LOG(1, "INFO: Added MPQCCommandJob from file "+filename+".");
-}
-
-/** Print received results.
- *
- * @param results received results to print
- */
-void printReceivedResults(std::vector<FragmentResult::ptr> &results)
-{
-  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
-      iter != results.end(); ++iter)
-    LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
-}
-
-/** Print MPQCData from received results.
- *
- * @param results received results to extract MPQCData from
- * @param KeySetFilename filename with keysets to associate forces correctly
- * @param NoAtoms total number of atoms
- */
-bool printReceivedMPQCResults(
-    const std::vector<FragmentResult::ptr> &results,
-    const std::string &KeySetFilename,
-    size_t NoAtoms)
-{
-  EnergyMatrix Energy;
-  EnergyMatrix EnergyFragments;
-  ForceMatrix Force;
-  ForceMatrix ForceFragments;
-  KeySetsContainer KeySet;
-
-  // align fragments
-  std::map< JobId_t, size_t > MatrixNrLookup;
-  size_t FragmentCounter = 0;
-  {
-    // bring ids in order ...
-    typedef std::map< JobId_t, FragmentResult::ptr> IdResultMap_t;
-    IdResultMap_t IdResultMap;
-    for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
-        iter != results.end(); ++iter) {
-  #ifndef NDEBUG
-      std::pair< IdResultMap_t::iterator, bool> inserter =
-  #endif
-      IdResultMap.insert( make_pair((*iter)->getId(), *iter) );
-      ASSERT( inserter.second,
-          "printReceivedMPQCResults() - two results have same id "
-          +toString((*iter)->getId())+".");
-    }
-    // ... and fill lookup
-    for(IdResultMap_t::const_iterator iter = IdResultMap.begin();
-        iter != IdResultMap.end(); ++iter)
-      MatrixNrLookup.insert( make_pair(iter->first, FragmentCounter++) );
-  }
-  LOG(1, "INFO: There are " << FragmentCounter << " fragments.");
-
-  // extract results
-  std::vector<MPQCData> fragmentData(results.size());
-  MPQCData combinedData;
-
-  LOG(2, "DEBUG: Parsing now through " << results.size() << " results.");
-  for (std::vector<FragmentResult::ptr>::const_iterator iter = results.begin();
-      iter != results.end(); ++iter) {
-    LOG(1, "RESULT: job #"+toString((*iter)->getId())+": "+toString((*iter)->result));
-    MPQCData extractedData;
-    std::stringstream inputstream((*iter)->result);
-    LOG(2, "DEBUG: First 50 characters FragmentResult's string: "+(*iter)->result.substr(0, 50));
-    boost::archive::text_iarchive ia(inputstream);
-    ia >> extractedData;
-    LOG(1, "INFO: extracted data is " << extractedData << ".");
-
-    // place results into EnergyMatrix ...
-    {
-      MatrixContainer::MatrixArray matrix;
-      matrix.resize(1);
-      matrix[0].resize(1, extractedData.energy);
-      if (!Energy.AddMatrix(
-          std::string("MPQCJob ")+toString((*iter)->getId()),
-          matrix,
-          MatrixNrLookup[(*iter)->getId()])) {
-        ELOG(1, "Adding energy matrix failed.");
-        return false;
-      }
-    }
-    // ... and ForceMatrix (with two empty columns in front)
-    {
-      MatrixContainer::MatrixArray matrix;
-      const size_t rows = extractedData.forces.size();
-      matrix.resize(rows);
-      for (size_t i=0;i<rows;++i) {
-        const size_t columns = 2+extractedData.forces[i].size();
-        matrix[i].resize(columns, 0.);
-  //      for (size_t j=0;j<2;++j)
-  //        matrix[i][j] = 0.;
-        for (size_t j=2;j<columns;++j)
-          matrix[i][j] = extractedData.forces[i][j-2];
-      }
-      if (!Force.AddMatrix(
-          std::string("MPQCJob ")+toString((*iter)->getId()),
-          matrix,
-          MatrixNrLookup[(*iter)->getId()])) {
-        ELOG(1, "Adding force matrix failed.");
-        return false;
-      }
-    }
-  }
-  // add one more matrix (not required for energy)
-  MatrixContainer::MatrixArray matrix;
-  matrix.resize(1);
-  matrix[0].resize(1, 0.);
-  if (!Energy.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
-    return false;
-  // but for energy because we need to know total number of atoms
-  matrix.resize(NoAtoms);
-  for (size_t i = 0; i< NoAtoms; ++i)
-    matrix[i].resize(2+NDIM, 0.);
-  if (!Force.AddMatrix(std::string("MPQCJob total"), matrix, FragmentCounter))
-    return false;
-
-
-  // combine all found data
-  if (!Energy.InitialiseIndices()) return false;
-
-  if (!Force.ParseIndices(KeySetFilename.c_str())) return false;
-
-  if (!KeySet.ParseKeySets(KeySetFilename.c_str(), Force.RowCounter, Force.MatrixCounter)) return false;
-
-  if (!KeySet.ParseManyBodyTerms()) return false;
-
-  if (!EnergyFragments.AllocateMatrix(Energy.Header, Energy.MatrixCounter, Energy.RowCounter, Energy.ColumnCounter)) return false;
-  if (!ForceFragments.AllocateMatrix(Force.Header, Force.MatrixCounter, Force.RowCounter, Force.ColumnCounter)) return false;
-
-  if(!Energy.SetLastMatrix(0., 0)) return false;
-  if(!Force.SetLastMatrix(0., 2)) return false;
-
-  for (int BondOrder=0;BondOrder<KeySet.Order;BondOrder++) {
-    // --------- sum up energy --------------------
-    LOG(1, "INFO: Summing energy of order " << BondOrder+1 << " ...");
-    if (!EnergyFragments.SumSubManyBodyTerms(Energy, KeySet, BondOrder)) return false;
-    if (!Energy.SumSubEnergy(EnergyFragments, NULL, KeySet, BondOrder, 1.)) return false;
-
-    // --------- sum up Forces --------------------
-    LOG(1, "INFO: Summing forces of order " << BondOrder+1 << " ...");
-    if (!ForceFragments.SumSubManyBodyTerms(Force, KeySet, BondOrder)) return false;
-    if (!Force.SumSubForces(ForceFragments, KeySet, BondOrder, 1.)) return false;
-  }
-
-  // for debugging print resulting energy and forces
-  LOG(1, "INFO: Resulting energy is " << Energy.Matrix[ FragmentCounter ][0][0]);
-  std::stringstream output;
-  for (int i=0; i< Force.RowCounter[FragmentCounter]; ++i) {
-    for (int j=0; j< Force.ColumnCounter[FragmentCounter]; ++j)
-      output << Force.Matrix[ FragmentCounter ][i][j] << " ";
-    output << "\n";
-  }
-  LOG(1, "INFO: Resulting forces are " << std::endl << output.str());
-
-  return true;
-}
-
-/** Helper function to get number of atoms somehow.
- *
- * Here, we just parse the number of lines in the adjacency file as
- * it should correspond to the number of atoms, except when some atoms
- * are not bonded, but then fragmentation makes no sense.
- *
- * @param path path to the adjacency file
- */
-size_t getNoAtomsFromAdjacencyFile(const std::string &path)
-{
-  size_t NoAtoms = 0;
-
-  // parse in special file to get atom count (from line count)
-  std::string filename(path);
-  filename += FRAGMENTPREFIX;
-  filename += ADJACENCYFILE;
-  std::ifstream adjacency(filename.c_str());
-  if (adjacency.fail()) {
-    LOG(0, endl << "getNoAtomsFromAdjacencyFile() - Unable to open " << filename << ", is the directory correct?");
-    return false;
-  }
-  std::string buffer;
-  while (getline(adjacency, buffer))
-    NoAtoms++;
-  LOG(1, "INFO: There are " << NoAtoms << " atoms.");
-
-  return NoAtoms;
-}
-
-
-/** Returns a unique index for every command to allow switching over it.
- *
- * \param &commandmap map with command strings
- * \param &cmd command string
- * \return index from CommandIndices: UnkownCommandIndex - unknown command, else - command index
- */
-CommandIndices getCommandIndex(std::map<std::string, CommandIndices> &commandmap, const std::string &cmd)
-{
-  std::map<std::string, CommandIndices>::const_iterator iter = commandmap.find(cmd);
-  if (iter != commandmap.end())
-    return iter->second;
-  else
-    return UnknownCommandIndex;
-}
-
-
-int main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deeinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  setVerbosity(3);
-
-  size_t Exitflag = 0;
-  typedef std::map<std::string, CommandIndices> CommandsMap_t;
-  CommandsMap_t CommandsMap;
-  CommandsMap.insert( std::make_pair("addjobs", AddJobsIndex) );
-  CommandsMap.insert( std::make_pair("createjobs", CreateJobsIndex) );
-  CommandsMap.insert( std::make_pair("checkresults", CheckResultsIndex) );
-  CommandsMap.insert( std::make_pair("receiveresults", ReceiveResultsIndex) );
-  CommandsMap.insert( std::make_pair("receivempqc", ReceiveMPQCIndex) );
-  CommandsMap.insert( std::make_pair("removeall", RemoveAllIndex) );
-  CommandsMap.insert( std::make_pair("shutdown", ShutdownIndex) );
-  std::vector<std::string> Commands;
-  for (CommandsMap_t::const_iterator iter = CommandsMap.begin(); iter != CommandsMap.end(); ++iter)
-    Commands.push_back(iter->first);
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("server", boost::program_options::value< std::string >(), "connect to server at this address (host:port)")
-      ("command", boost::program_options::value< std::string >(), (std::string("command to send to server: ")+toString(Commands)).c_str())
-      ("executable", boost::program_options::value< std::string >(), "executable for commands 'addjobs' and 'createjobs'")
-      ("fragment-path", boost::program_options::value< std::string >(), "path to fragment files for 'receivempqcresults'")
-      ("jobcommand", boost::program_options::value< std::string >(), "command argument for executable for 'createjobs'")
-      ("jobfiles", boost::program_options::value< std::vector< std::string > >()->multitoken(), "list of files as single argument to executable for 'addjobs'")
-  ;
-
-  boost::program_options::variables_map vm;
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  if (vm.count("help")) {
-    std::cout << desc << "\n";
-    return 1;
-  }
-
-  if (vm.count("verbosity")) {
-    LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
-    setVerbosity(vm["verbosity"].as<size_t>());
-  } else {
-    LOG(0, "STATUS: Verbosity level was not set, defaulting to 5.");
-    setVerbosity(5);
-  }
-
-  std::string server;
-  std::string serverport;
-  if (vm.count("server")) {
-    server = vm["server"].as< std::string >();
-    serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
-    server = server.substr(0, server.find_last_of(':'));
-    try {
-      boost::lexical_cast<size_t>(serverport);
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not interpret " << serverport << " as server:port.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
-  } else {
-    ELOG(1, "Requiring server's address (host:port) to connect to.");
-    return 255;
-  }
-
-  if (!vm.count("command")) {
-    ELOG(1, "Controller requires one of the following commands: "+toString(Commands));
-    return 255;
-  }
-  const std::string command = vm["command"].as< std::string >();
-  const CommandIndices commandIndex = getCommandIndex(CommandsMap, command);
-
-  // check arguments
-  switch(commandIndex) {
-    case AddJobsIndex:
-      if (!vm.count("executable") && !vm.count("jobfiles")) {
-        ELOG(1, "'"+command+"' requires at least two options: [executable] [list of input files ...].");
-        return 255;
-      }
-      break;
-    case CreateJobsIndex:
-      if (!vm.count("executable") && !vm.count("jobcommand")) {
-        ELOG(1, "'"+command+"' requires two options: [executable] [jobcommand].");
-        return 255;
-      }
-      break;
-    case CheckResultsIndex:
-      break;
-    case ReceiveResultsIndex:
-      break;
-    case ReceiveMPQCIndex:
-      if (!vm.count("fragment-path")) {
-        ELOG(1, "'"+command+"' require one option: [path to fragment files].");
-        return 255;
-      }
-      break;
-    case RemoveAllIndex:
-      break;
-    case ShutdownIndex:
-      break;
-    case UnknownCommandIndex:
-    default:
-      ELOG(1, "Unrecognized command '"+toString(command)+"'.");
-      return 255;
-      break;
-  }
-
-  try
-  {
-
-    boost::asio::io_service io_service;
-    FragmentController controller(io_service);
-
-    // Initial phase: information gathering from server
-
-    switch(commandIndex) {
-      case AddJobsIndex:
-        controller.requestIds(server, serverport, vm["jobfiles"].as< std::vector<std::string> >().size());
-        break;
-      case CreateJobsIndex:
-        controller.requestIds(server, serverport, 1);
-        break;
-      case CheckResultsIndex:
-        break;
-      case ReceiveResultsIndex:
-        break;
-      case ReceiveMPQCIndex:
-        break;
-      case RemoveAllIndex:
-        break;
-      case ShutdownIndex:
-        break;
-      case UnknownCommandIndex:
-      default:
-        ELOG(0, "Unrecognized command '"+toString(command)+"'.");
-        return 255;
-        break;
-    }
-
-    {
-      io_service.reset();
-      Info info("io_service: Phase One");
-      io_service.run();
-    }
-
-    // Second phase: Building jobs and sending information to server
-
-    switch(commandIndex) {
-      case AddJobsIndex:
-      {
-        std::vector<FragmentJob::ptr> jobs;
-        const std::string executable(vm["executable"].as< std::string >());
-        const std::vector< std::string > jobfiles = vm["jobfiles"].as< std::vector< std::string > >();
-        for (std::vector< std::string >::const_iterator iter = jobfiles.begin();
-            iter != jobfiles.end(); ++iter) {
-          const JobId_t next_id = controller.getAvailableId();
-          const std::string &filename = *iter;
-          LOG(1, "INFO: Creating MPQCCommandJob with filename'"
-              +filename+"', and id "+toString(next_id)+".");
-          parsejob(jobs, executable, filename, next_id);
-        }
-        controller.addJobs(jobs);
-        controller.sendJobs(server, serverport);
-        break;
-      }
-      case CreateJobsIndex:
-      {
-        const JobId_t next_id = controller.getAvailableId();
-        std::vector<FragmentJob::ptr> jobs;
-        const std::string executable = vm["executable"].as< std::string >();
-        const std::string jobcommand = vm["jobcommand"].as< std::string >();
-        createjobs(jobs, executable, jobcommand, next_id);
-        controller.addJobs(jobs);
-        controller.sendJobs(server, serverport);
-        break;
-      }
-      case CheckResultsIndex:
-        controller.checkResults(server, serverport);
-        break;
-      case ReceiveResultsIndex:
-      case ReceiveMPQCIndex:
-        controller.receiveResults(server, serverport);
-        break;
-      case RemoveAllIndex:
-        controller.removeall(server, serverport);
-        break;
-      case ShutdownIndex:
-        controller.shutdown(server, serverport);
-        break;
-      case UnknownCommandIndex:
-      default:
-        ELOG(0, "Unrecognized command '"+toString(command)+"'.");
-        return 255;
-        break;
-    }
-
-    {
-      io_service.reset();
-      Info info("io_service: Phase Two");
-      io_service.run();
-    }
-
-    // Final phase: Print result of command
-
-    switch(commandIndex) {
-      case AddJobsIndex:
-      case CreateJobsIndex:
-        break;
-      case CheckResultsIndex:
-        controller.printDoneJobs();
-        break;
-      case ReceiveResultsIndex:
-      {
-        std::vector<FragmentResult::ptr> results = controller.getReceivedResults();
-        printReceivedResults(results);
-        break;
-      }
-      case ReceiveMPQCIndex:
-      {
-        const std::string path = vm["fragment-path"].as< std::string >();
-        LOG(1, "INFO: Parsing fragment files from " << path << ".");
-        std::vector<FragmentResult::ptr> results = controller.getReceivedResults();
-        printReceivedMPQCResults(
-            results,
-            path,
-            getNoAtomsFromAdjacencyFile(path));
-        break;
-      }
-      case RemoveAllIndex:
-        break;
-      case ShutdownIndex:
-        break;
-      case UnknownCommandIndex:
-      default:
-        ELOG(0, "Unrecognized command '"+toString(command)+"'.");
-        return 255;
-        break;
-    }
-    Exitflag = controller.getExitflag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-
-  return Exitflag;
-}
-
Index: src/Fragmentation/Automation/poolworker.cpp
===================================================================
--- src/Fragmentation/Automation/poolworker.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,181 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * \file poolworker.cpp
- *
- * This file strongly follows the Serialization example from the boost::asio
- * library (see client.cpp)
- *
- *  Created on: Feb 28, 2012
- *      Author: heber
- */
-
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-// boost asio needs specific operator new
-#include <boost/asio.hpp>
-
-#include "CodePatterns/MemDebug.hpp"
-
-#include <iostream>
-#include <boost/program_options.hpp>
-#include <boost/lexical_cast.hpp>
-#include <signal.h>
-#include <unistd.h>
-#include <vector>
-
-#include "atexit.hpp"
-#include "CodePatterns/Info.hpp"
-#include "CodePatterns/Log.hpp"
-#include "Pool/PoolWorker.hpp"
-
-//!> global shutdown function
-boost::function<void (int)> shutdownfunction;
-//!> global signal vector for later releasing
-std::vector<size_t> signals;
-//!> counter for the number of received signals
-size_t NoSignalsReceived = 0;
-//!> maximum number of received signals after which the handlers are released
-const size_t MAX_NOSIGNALSRECEIVED = 3;
-
-void signalhandler(int sig)
-{
-  // increment received signal counter
-  ++NoSignalsReceived;
-
-  // shutdown if we have handler
-  if (shutdownfunction)
-    shutdownfunction(sig);
-
-  if (NoSignalsReceived >= MAX_NOSIGNALSRECEIVED) {
-    // release signal hook again
-    for (std::vector<size_t>::const_iterator iter = signals.begin();
-        iter != signals.end(); ++iter)
-      signal(*iter, NULL);
-  }
-}
-
-int main(int argc, char* argv[])
-{
-  // from this moment on, we need to be sure to deeinitialize in the correct order
-  // this is handled by the cleanup function
-  atexit(cleanUp);
-
-  // Declare the supported options.
-  boost::program_options::options_description desc("Allowed options");
-  desc.add_options()
-      ("help,h", "produce help message")
-      ("verbosity,v", boost::program_options::value<size_t>(), "set verbosity level")
-      ("signal", boost::program_options::value< std::vector<size_t> >(), "set signal to catch (can be given multiple times)")
-      ("server", boost::program_options::value< std::string>(), "connect to server at this address (host:port)")
-      ("listen", boost::program_options::value< std::string >(), "listen on this port")
-      ("hostname", boost::program_options::value< std::string>(), "name of host on which this codes runs and which server can resolve")
-  ;
-
-  boost::program_options::variables_map vm;
-  boost::program_options::store(boost::program_options::parse_command_line(argc, argv, desc), vm);
-  boost::program_options::notify(vm);
-
-  if (vm.count("help")) {
-    std::cout << desc << "\n";
-    return 1;
-  }
-
-  if (vm.count("verbosity")) {
-    LOG(0, "STATUS: Verbosity level was set to " << vm["verbosity"].as<size_t>() << ".");
-    setVerbosity(vm["verbosity"].as<size_t>());
-  } else {
-    LOG(0, "STATUS: Verbosity level was not set, defaulting to 5.");
-    setVerbosity(5);
-  }
-
-  std::string server;
-  std::string serverport;
-  if (vm.count("server")) {
-    server = vm["server"].as< std::string >();
-    serverport = server.substr(server.find_last_of(':')+1, std::string::npos);
-    server = server.substr(0, server.find_last_of(':'));
-    try {
-      boost::lexical_cast<size_t>(serverport);
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not interpret " << serverport << " as server:port.");
-      return 255;
-    }
-    LOG(1, "INFO: Using " << server << ":" << serverport << " as server's address.");
-  } else {
-    ELOG(1, "Requiring server's address (host:port) to connect to.");
-    return 255;
-  }
-
-  std::string hostname("localhost");
-  if (vm.count("hostname")) {
-    hostname = vm["hostname"].as< std::string >();
-    LOG(1, "INFO: Using " << hostname << " as host's name.");
-  } else {
-    char name[1024];
-    if (gethostname(name, 1023) == 0) {
-      hostname = name;
-      LOG(1, "INFO: Using obtained hostname " << hostname << ".");
-    } else {
-      ELOG(1, "No hostname given and failed to determine automatically.");
-      return 255;
-    }
-  }
-
-  std::string listenport;
-  if (vm.count("listen")) {
-    try {
-      listenport = vm["listen"].as< std::string >();
-    } catch (boost::bad_lexical_cast) {
-      ELOG(1, "Could not read " << vm["listen"].as< std::string >() << " as digits.");
-      return 255;
-    }
-    LOG(1, "INFO: Using port " << listenport << " to listen to server connects.");
-  } else {
-    ELOG(1, "Requiring port to listen on .");
-    return 255;
-  }
-
-  size_t exitflag = 0;
-  try
-  {
-    boost::asio::io_service io_service;
-    PoolWorker client(io_service, server, serverport, hostname, listenport);
-
-    // catch ctrl-c and shutdown worker properly
-    shutdownfunction = boost::bind(&PoolWorker::shutdown, boost::ref(client), _1);
-    if (vm.count("signal")) {
-      signals =  vm["signal"].as< std::vector<size_t> >();
-      for (std::vector<size_t>::const_iterator iter = signals.begin();
-          iter != signals.end(); ++iter) {
-        LOG(0, "STATUS: Catching signal " << *iter << " via signal handler.");
-        signal(*iter, &signalhandler);
-      }
-    } else {
-      LOG(0, "STATUS: No signals are caught.");
-    }
-
-    // process io requests
-    {
-      Info info("io_service");
-      io_service.run();
-    }
-    exitflag = client.getFlag();
-  }
-  catch (std::exception& e)
-  {
-    std::cerr << e.what() << std::endl;
-  }
-
-
-  return exitflag;
-}
Index: src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,167 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * MPQCCommandJobUnitTest.cpp
- *
- *  Created on: Feb 08, 2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-
-// include headers that implement a archive in simple text format
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-#include <vector>
-
-#include "MPQCCommandJobUnitTest.hpp"
-
-#include "Jobs/MPQCCommandJob.hpp"
-
-#include "CodePatterns/Assert.hpp"
-#include "CodePatterns/Log.hpp"
-
-#ifdef HAVE_TESTRUNNER
-#include "UnitTestMain.hpp"
-#endif /*HAVE_TESTRUNNER*/
-
-/********************************************** Test classes **************************************/
-
-const std::string resultstring="\
-\n\
-  HOMO is     5   A =  -0.498625\n\
-  LUMO is     6   A =   0.251360\n\
-\n\
-  total scf energy =  -75.5133625967\n\
-\n\
-  Memory used for integral intermediates: 56628 Bytes\n\
-\n\
-    10  -0.02171957  3   A  3   A ->  6   A  6   A (+-+-)\n\
-\n\
-  RHF energy [au]:                    -75.513362596662\n\
-  MP2 correlation energy [au]:         -0.124136686358\n\
-  MP2 energy [au]:                    -75.637499283020\n\
-\n\
-  D1(MP2)                =   0.01063314\n\
-\n\
-  CPHF: iter =  7 rms(P) = 0.0000000011 eps = 0.0000000100\n\
-\n\
-  Total MP2 gradient [au]:\n\
-       1   O   0.1100072224   0.0000000000  -0.0000000000\n\
-       2   H  -0.0550036112  -0.0000000000  -0.1562140155\n\
-       3   H  -0.0550036112  -0.0000000000   0.1562140155\n\
-\n\
-  Value of the MolecularEnergy:  -75.6374992830\n\
-\n\
-";
-
-// Registers the fixture into the 'registry'
-CPPUNIT_TEST_SUITE_REGISTRATION( MPQCCommandJobTest );
-
-
-void MPQCCommandJobTest::setUp()
-{
-  // Throw assertions
-  ASSERT_DO(Assert::Throw);
-
-  setVerbosity(4);
-
-  job = new MPQCCommandJob(std::string("empty"), 1);
-}
-
-
-void MPQCCommandJobTest::tearDown()
-{
-  delete job;
-}
-
-/** UnitTest for extractString()
- */
-void MPQCCommandJobTest::extractStringTest()
-{
-  // prepare result container
-  MPQCData data;
-  data.energy = -75.637499283020;
-  std::vector<double> force;
-  std::vector< std::vector<double> > forces;
-  //  1   O   0.1100072224   0.0000000000  -0.0000000000
-  force.push_back(0.1100072224);
-  force.push_back(0.0000000000);
-  force.push_back(-0.0000000000);
-  data.forces.push_back( force );
-  //  2   H  -0.0550036112  -0.0000000000  -0.1562140155
-  force.clear();
-  force.push_back(-0.0550036112);
-  force.push_back(-0.0000000000);
-  force.push_back(-0.1562140155);
-  data.forces.push_back( force );
-  //  3   H  -0.0550036112  -0.0000000000   0.1562140155
-  force.clear();
-  force.push_back(-0.0550036112);
-  force.push_back(-0.0000000000);
-  force.push_back(0.1562140155);
-  data.forces.push_back( force );
-
-  // extract and check
-  FragmentResult::ptr result = job->extractResult(resultstring);
-  std::stringstream returnstream(result->result);
-
-  // deserialize
-  MPQCData extractedData;
-  boost::archive::text_iarchive ia(returnstream);
-  ia >> extractedData;
-
-  CPPUNIT_ASSERT( data == extractedData );
-}
-
-/** UnitTest for operator==()
- */
-void MPQCCommandJobTest::operatorTest()
-{
-  MPQCCommandJob otherJob(std::string("empty"), 1);
-
-  // ascertain equality
-  CPPUNIT_ASSERT( *job == otherJob );
-
-  // parse results
-  FragmentResult::ptr result = job->extractResult(resultstring);
-
-  // ascertain unequality as now data should differ
-  CPPUNIT_ASSERT( *job != otherJob );
-}
-
-/** UnitTest for serialization
- */
-void MPQCCommandJobTest::serializationTest()
-{
-  // parse results
-  FragmentResult::ptr result = job->extractResult(resultstring);
-
-  // serialize
-  std::stringstream outputstream;
-  boost::archive::text_oarchive oa(outputstream);
-  oa << job;
-
-  // deserialize
-  MPQCCommandJob *extractedJob;
-  std::stringstream returnstream(outputstream.str());
-  boost::archive::text_iarchive ia(returnstream);
-  ia >> extractedJob;
-
-  CPPUNIT_ASSERT( *job == *extractedJob );
-
-  delete extractedJob;
-}
Index: src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.hpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCCommandJobUnitTest.hpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,44 +1,0 @@
-/*
- * MPQCCommandJobUnitTest.hpp
- *
- *  Created on: Oct 23, 2011
- *      Author: heber
- */
-
-#ifndef MPQCCOMMANDJOBUNITTEST_HPP_
-#define MPQCCOMMANDJOBUNITTEST_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string>
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class MPQCCommandJob;
-
-
-/********************************************** Test classes **************************************/
-
-class MPQCCommandJobTest : public CppUnit::TestFixture
-{
-    CPPUNIT_TEST_SUITE( MPQCCommandJobTest) ;
-    CPPUNIT_TEST ( extractStringTest );
-    CPPUNIT_TEST ( operatorTest );
-    CPPUNIT_TEST ( serializationTest );
-    CPPUNIT_TEST_SUITE_END();
-
-public:
-      void setUp();
-      void tearDown();
-      void extractStringTest();
-      void operatorTest();
-      void serializationTest();
-
-private:
-      MPQCCommandJob *job;
-};
-
-#endif /* MPQCCOMMANDJOBUNITTEST_HPP_ */
Index: src/Fragmentation/Automation/unittests/MPQCDataUnitTest.cpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCDataUnitTest.cpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,140 +1,0 @@
-/*
- * Project: MoleCuilder
- * Description: creates and alters molecular systems
- * Copyright (C)  2012 University of Bonn. All rights reserved.
- * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
- */
-
-/*
- * MPQCDataUnitTest.cpp
- *
- *  Created on: Feb 09, 2012
- *      Author: heber
- */
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <cppunit/CompilerOutputter.h>
-#include <cppunit/extensions/TestFactoryRegistry.h>
-#include <cppunit/ui/text/TestRunner.h>
-
-// include headers that implement a archive in simple text format
-#include <boost/archive/text_oarchive.hpp>
-#include <boost/archive/text_iarchive.hpp>
-
-#include <limits>
-#include <vector>
-
-#include "MPQCDataUnitTest.hpp"
-
-#include "Jobs/MPQCCommandJob_MPQCData.hpp"
-
-#include "CodePatterns/Assert.hpp"
-
-#ifdef HAVE_TESTRUNNER
-#include "UnitTestMain.hpp"
-#endif /*HAVE_TESTRUNNER*/
-
-/********************************************** Test classes **************************************/
-
-// Registers the fixture into the 'registry'
-CPPUNIT_TEST_SUITE_REGISTRATION( MPQCDataTest );
-
-
-void MPQCDataTest::setUp()
-{
-  // Throw assertions
-  ASSERT_DO(Assert::Throw);
-
-  data = new MPQCData;
-
-  data->energy = -37.3479855;
-  std::vector<double> force;
-  std::vector< std::vector<double> > forces;
-  force.push_back(-2.35);
-  force.push_back(-0.54);
-  force.push_back(0.345);
-  data->forces.push_back(force);
-  force.clear();
-  force.push_back(-2.35);
-  force.push_back(-0.54);
-  force.push_back(0.345);
-  data->forces.push_back( force );
-
-  CPPUNIT_ASSERT_EQUAL( (size_t)2, data->forces.size() );
-}
-
-
-void MPQCDataTest::tearDown()
-{
-  delete data;
-}
-
-/** UnitTest for operator==()
- */
-void MPQCDataTest::operatorTest()
-{
-  MPQCData otherData;
-
-  // ascertain unequality
-  CPPUNIT_ASSERT( !(*data == otherData) );
-  CPPUNIT_ASSERT( *data != otherData );
-
-  // construct closer and closer pendant
-  otherData.energy = -37.3479855;
-  CPPUNIT_ASSERT( *data != otherData );
-  std::vector<double> force;
-  std::vector< std::vector<double> > forces;
-  force.push_back(-2.35);
-  force.push_back(-0.54);
-  force.push_back(0.345);
-  otherData.forces.push_back(force);
-  CPPUNIT_ASSERT( *data != otherData );
-  force.clear();
-  force.push_back(-2.35);
-  force.push_back(-0.54);
-  force.push_back(0.345);
-  otherData.forces.push_back( force );
-  CPPUNIT_ASSERT( *data == otherData );
-
-  // change energy
-  otherData.energy = -4;
-  CPPUNIT_ASSERT( *data != otherData );
-  otherData.energy = -37.3479855;
-  CPPUNIT_ASSERT( *data == otherData );
-
-  // change force component
-  otherData.forces[0][2] = -4;
-  CPPUNIT_ASSERT( *data != otherData );
-  otherData.forces[0][2] = 0.345;
-  CPPUNIT_ASSERT( *data == otherData );
-
-  // check sensibility
-  otherData.energy -= 1e-1*std::numeric_limits<double>::epsilon();
-  CPPUNIT_ASSERT( *data == otherData );
-  otherData.forces[1][0] -= 1e-1*std::numeric_limits<double>::epsilon();
-  CPPUNIT_ASSERT( *data == otherData );
-}
-
-/** UnitTest for serialization
- */
-void MPQCDataTest::serializationTest()
-{
-  // serialize
-  std::stringstream outputstream;
-  boost::archive::text_oarchive oa(outputstream);
-  oa << data;
-
-  // deserialize
-  MPQCData *extractedData;
-  std::stringstream returnstream(outputstream.str());
-  boost::archive::text_iarchive ia(returnstream);
-  ia >> extractedData;
-
-  CPPUNIT_ASSERT( *data == *extractedData );
-
-  delete extractedData;
-}
Index: src/Fragmentation/Automation/unittests/MPQCDataUnitTest.hpp
===================================================================
--- src/Fragmentation/Automation/unittests/MPQCDataUnitTest.hpp	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ 	(revision )
@@ -1,42 +1,0 @@
-/*
- * MPQCDataUnitTest.hpp
- *
- *  Created on: Feb 9, 2012
- *      Author: heber
- */
-
-#ifndef MPQCDATAUNITTEST_HPP_
-#define MPQCDATAUNITTEST_HPP_
-
-// include config.h
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <string>
-
-#include <cppunit/extensions/HelperMacros.h>
-
-class MPQCData;
-
-
-/********************************************** Test classes **************************************/
-
-class MPQCDataTest : public CppUnit::TestFixture
-{
-    CPPUNIT_TEST_SUITE( MPQCDataTest) ;
-    CPPUNIT_TEST ( operatorTest );
-    CPPUNIT_TEST ( serializationTest );
-    CPPUNIT_TEST_SUITE_END();
-
-public:
-      void setUp();
-      void tearDown();
-      void operatorTest();
-      void serializationTest();
-
-private:
-      MPQCData *data;
-};
-
-#endif /* MPQCDATAUNITTEST_HPP_ */
Index: src/Fragmentation/Automation/unittests/Makefile.am
===================================================================
--- src/Fragmentation/Automation/unittests/Makefile.am	(revision c586d8167c446dff7b1ea58c21d9589f1abb8b54)
+++ src/Fragmentation/Automation/unittests/Makefile.am	(revision cc5db582dad56745fce8f970d96f7197f1842609)
@@ -6,6 +6,4 @@
   unittests/FragmentResultUnitTest.cpp \
   unittests/FragmentQueueUnitTest.cpp \
-  unittests/MPQCCommandJobUnitTest.cpp \
-  unittests/MPQCDataUnitTest.cpp \
   unittests/OperationQueueUnitTest.cpp \
   unittests/SystemCommandJobUnitTest.cpp \
@@ -17,6 +15,4 @@
   unittests/FragmentResultUnitTest.hpp \
   unittests/FragmentQueueUnitTest.hpp \
-  unittests/MPQCCommandJobUnitTest.hpp \
-  unittests/MPQCDataUnitTest.hpp \
   unittests/OperationQueueUnitTest.hpp \
   unittests/SystemCommandJobUnitTest.hpp \
@@ -28,6 +24,4 @@
   FragmentResultUnitTest \
   FragmentQueueUnitTest \
-  MPQCCommandJobUnitTest \
-  MPQCDataUnitTest \
   OperationQueueUnitTest \
   SystemCommandJobUnitTest \
@@ -86,26 +80,4 @@
   unittests/FragmentResultUnitTest.hpp
 FragmentResultUnitTest_LDADD = \
-  libMolecuilderFragmentJobs.la \
-  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
-  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
-  ${CodePatterns_LIBS}
-
-MPQCCommandJobUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
-MPQCCommandJobUnitTest_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
-MPQCCommandJobUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
-  unittests/MPQCCommandJobUnitTest.cpp \
-  unittests/MPQCCommandJobUnitTest.hpp
-MPQCCommandJobUnitTest_LDADD = \
-  libMolecuilderFragmentJobs.la \
-  $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
-  $(BOOST_SYSTEM_LDFLAGS) $(BOOST_SYSTEM_LIBS) \
-  ${CodePatterns_LIBS}
-
-MPQCDataUnitTest_LDFLAGS = ${CodePatterns_LIBS} $(CPPUNIT_LIBS) -ldl
-MPQCDataUnitTest_CPPFLAGS = ${BOOST_CPPFLAGS} $(CPPUNIT_CFLAGS) ${CodePatterns_CFLAGS}
-MPQCDataUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
-  unittests/MPQCDataUnitTest.cpp \
-  unittests/MPQCDataUnitTest.hpp
-MPQCDataUnitTest_LDADD = \
   libMolecuilderFragmentJobs.la \
   $(BOOST_SERIALIZATION_LDFLAGS) $(BOOST_SERIALIZATION_LIBS) \
