Index: ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.cpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.cpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.cpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -31,4 +31,5 @@
 #include "Operations/Controllers/CheckResultsOperation.hpp"
 #include "Operations/Controllers/GetNextJobIdOperation.hpp"
+#include "Operations/Controllers/GetNumberWorkersOperation.hpp"
 #include "Operations/Controllers/ReceiveResultsOperation.hpp"
 #include "Operations/Controllers/RemoveAllJobsOperation.hpp"
@@ -56,4 +57,5 @@
   Commands.registerInstance(new CheckResultsOperation(connection_, AsyncOperation::NoOpCallback, failed));
   Commands.registerInstance(new GetNextJobIdOperation(connection_, AsyncOperation::NoOpCallback, failed));
+  Commands.registerInstance(new GetNumberWorkersOperation(connection_, AsyncOperation::NoOpCallback, failed));
   Commands.registerInstance(new ReceiveResultsOperation(connection_, AsyncOperation::NoOpCallback, failed));
   Commands.registerInstance(new RemoveAllJobsOperation(connection_));
@@ -162,4 +164,18 @@
 }
 
+/** Obtains number of workers enrolled at server
+ *
+ * @param host address of server
+ * @param service port/service of server
+ */
+void FragmentController::checkEnrolledWorkers(
+    const std::string &host,
+    const std::string &service)
+{
+  GetNumberWorkersOperation *checkres = static_cast<GetNumberWorkersOperation *>(
+      Commands.getByName("numberworkers"));
+  (*checkres)(host, service);
+}
+
 /** Return scheduled and done jobs.
  *
@@ -173,4 +189,15 @@
   const size_t presentJobs = checkres->getPresentJobs();
   return make_pair(presentJobs, doneJobs);
+}
+
+/** Return scheduled and done jobs.
+ *
+ * @return number of workers in certain states enrolled in server
+ */
+std::vector<size_t> FragmentController::getNumberOfWorkers()
+{
+  const GetNumberWorkersOperation * const checkres = static_cast<const GetNumberWorkersOperation *>(
+      Commands.getByName("numberworkers"));
+  return checkres->get();
 }
 
Index: ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.hpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.hpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/Controller/FragmentController.hpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -49,4 +49,6 @@
   void checkResults(const std::string &host, const std::string &service);
   std::pair<size_t, size_t> getJobStatus() const;
+  void checkEnrolledWorkers(const std::string &host, const std::string &service);
+  std::vector<size_t> getNumberOfWorkers();
   void removeWaitingResults(const std::string &host, const std::string &service);
   void removeWaitingJobs(const std::string &host, const std::string &service);
Index: ThirdParty/JobMarket/src/JobMarket/Controller/controller_main.cpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Controller/controller_main.cpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/Controller/controller_main.cpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -57,4 +57,16 @@
 }
 
+/** Print the status of workers
+ *
+ * @param number_workers vector of workers in certain states (busy, idle, ...)
+ */
+void printNumberWorkers(const std::vector<size_t> &number_workers)
+{
+  ASSERT(number_workers.size() == 2,
+      "printNumberWorkers() - vector of worker numbers is not of size 2.");
+  LOG(1, "INFO: " << number_workers[0] << " are busy and "
+      << number_workers[1] << " are idle.");
+}
+
 inline std::vector<std::string> getListOfCommands(const ControllerCommandRegistry &ControllerCommands)
 {
@@ -96,4 +108,11 @@
         (boost::bind(&printJobStatus,
             boost::bind(&FragmentController::getJobStatus, boost::ref(controller))))
+      ));
+  registrator(new ControllerCommand("numberworkers",
+      boost::assign::list_of< ControllerCommand::commands_t >
+        (boost::bind(&FragmentController::checkEnrolledWorkers,
+            boost::ref(controller), boost::cref(ControllerInfo->server), boost::cref(ControllerInfo->serverport)))
+        (boost::bind(&printNumberWorkers,
+            boost::bind(&FragmentController::getNumberOfWorkers, boost::ref(controller))))
       ));
   registrator(new ControllerCommand("removeall",
Index: ThirdParty/JobMarket/src/JobMarket/ControllerChoices.hpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/ControllerChoices.hpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/ControllerChoices.hpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -24,5 +24,6 @@
   EmptyJobQueue,
   RemoveAll,
-  ShutdownControllerSocket
+  ShutdownControllerSocket,
+  NumberOfWorkers
 };
 
Index: ThirdParty/JobMarket/src/JobMarket/FragmentScheduler.hpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/FragmentScheduler.hpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/FragmentScheduler.hpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -205,4 +205,7 @@
     void handle_SendResults(const boost::system::error_code& e, connection_ptr conn);
 
+    /// Controller callback function when result are to be sent.
+    void handle_SendNumberWorkers(const boost::system::error_code& e, connection_ptr conn);
+
     /// Controller callback function when results has been sent.
     void handle_finishSendResults(const boost::system::error_code& e, connection_ptr conn);
Index: ThirdParty/JobMarket/src/JobMarket/FragmentScheduler_ControllerListener.cpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/FragmentScheduler_ControllerListener.cpp	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/FragmentScheduler_ControllerListener.cpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -25,4 +25,5 @@
 
 #include <algorithm>
+#include <boost/assign.hpp>
 #include <boost/bind.hpp>
 #include <sstream>
@@ -43,4 +44,6 @@
 
 #include "JobMarket/FragmentScheduler.hpp"
+
+using namespace boost::assign;
 
 /** Handle a new controller connection.
@@ -138,4 +141,15 @@
     {
       removeallWorkers();
+      break;
+    }
+    case NumberOfWorkers:
+    {
+      LOG(1, "INFO: Sending total number of workers to a controller ...");
+      std::vector<size_t> number_workers;
+      number_workers += pool.getNoBusyWorkers();
+      number_workers += pool.getNoIdleWorkers();
+      conn->async_write(number_workers,
+        boost::bind(&FragmentScheduler::ControllerListener_t::handle_SendNumberWorkers, this,
+        boost::asio::placeholders::error, conn));
       break;
     }
@@ -346,2 +360,14 @@
   LOG(1, "INFO: Results have been sent.");
 }
+
+/** Controller callback function when number of workers has been sent.
+ *
+ * \param e error code if something went wrong
+ * \param conn reference with the connection
+ */
+void FragmentScheduler::ControllerListener_t::handle_SendNumberWorkers(const boost::system::error_code& e, connection_ptr conn)
+{
+  DEBUG_FUNCTION_ENTRYEXIT
+  // do nothing
+  LOG(1, "INFO: Number of workers have been sent.");
+}
Index: ThirdParty/JobMarket/src/JobMarket/Makefile.am
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Makefile.am	(revision 1181a3214005c1d43c3945551dcf12bfc2cf7551)
+++ ThirdParty/JobMarket/src/JobMarket/Makefile.am	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -40,4 +40,5 @@
 	Operations/Controllers/CheckResultsOperation.cpp \
 	Operations/Controllers/GetNextJobIdOperation.cpp \
+	Operations/Controllers/GetNumberWorkersOperation.cpp \
 	Operations/Controllers/ReceiveResultsOperation.cpp \
 	Operations/Controllers/RemoveAllJobsOperation.cpp \
@@ -63,4 +64,5 @@
 	Operations/Controllers/CheckResultsOperation.hpp \
 	Operations/Controllers/GetNextJobIdOperation.hpp \
+	Operations/Controllers/GetNumberWorkersOperation.hpp \
 	Operations/Controllers/ReceiveResultsOperation.hpp \
 	Operations/Controllers/RemoveAllJobsOperation.hpp \
Index: ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.cpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.cpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
+++ ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.cpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -0,0 +1,105 @@
+/*
+ * Project: JobMarket
+ * Description: asynchronous Server/Controller/Client-approach to parallel computing, based on boost::asio
+ * Copyright (C)  2018 Frederik Heber. All rights reserved.
+ * 
+ */
+
+/*
+ * GetNumberWorkersOperation.cpp
+ *
+ *  Created on: Apr 5, 2018
+ *      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 "JobMarket/Operations/Controllers/GetNumberWorkersOperation.hpp"
+
+#include <boost/bind.hpp>
+#include <iostream>
+#include "JobMarket/Connection.hpp" // Must come before boost/serialization headers.
+#include <boost/serialization/vector.hpp>
+#include "CodePatterns/Info.hpp"
+#include "CodePatterns/Log.hpp"
+#include "JobMarket/ControllerChoices.hpp"
+#include "JobMarket/types.hpp"
+
+/** Handle connect operation to send number of done jobs.
+ *
+ * \param e error code if something went wrong
+ * \param endpoint_iterator endpoint of the connection
+ */
+void GetNumberWorkersOperation::handle_connect(const boost::system::error_code& e,
+    boost::asio::ip::tcp::resolver::iterator endpoint_iterator)
+{
+  DEBUG_FUNCTION_ENTRYEXIT
+  if (!e)
+  {
+    // Successfully established connection. Give choice.
+    enum ControllerChoices choice = NumberOfWorkers;
+    connection_.async_write(choice,
+      boost::bind(&GetNumberWorkersOperation::handle_ReceiveNumberWorkers, this,
+      boost::asio::placeholders::error));
+  } else if (endpoint_iterator != boost::asio::ip::tcp::resolver::iterator()) {
+    // Try the next endpoint.
+    connection_.socket().close();
+    boost::asio::ip::tcp::endpoint endpoint = *endpoint_iterator;
+    connection_.socket().async_connect(endpoint,
+      boost::bind(&GetNumberWorkersOperation::handle_connect, this,
+      boost::asio::placeholders::error, ++endpoint_iterator));
+  } else {
+    // An error occurred. Log it and return. Since we are not starting a new
+    // operation the io_service will run out of work to do and the client will
+    // exit.
+    ELOG(1, e.message());
+    AsyncOperation::handle_FinishOperation(e);
+  }
+}
+
+/** Callback function when receiving the number of idle and busy workers.
+ *
+ * \param e error code if something went wrong
+ */
+void GetNumberWorkersOperation::handle_ReceiveNumberWorkers(const boost::system::error_code& e)
+{
+  DEBUG_FUNCTION_ENTRYEXIT
+  if (!e)
+  {
+    // The connection::async_read() function will automatically
+    // decode the data that is written to the underlying socket.
+    LOG(1, "INFO: Obtaining number of workers ...");
+    connection_.async_read(number_workers,
+      boost::bind(&GetNumberWorkersOperation::handle_FinishOperation, this,
+      boost::asio::placeholders::error));
+  }
+  else
+  {
+    // An error occurred.
+    ELOG(1, e.message());
+    AsyncOperation::handle_FinishOperation(e);
+  }
+}
+
+/** Callback function when an operation has been completed.
+ *
+ * \param e error code if something went wrong
+ */
+void GetNumberWorkersOperation::handle_FinishOperation(const boost::system::error_code& e)
+{
+  DEBUG_FUNCTION_ENTRYEXIT
+
+  // place id into nextids
+  LOG(1, "INFO: Received " << number_workers << " workers.");
+
+  // and finish operation
+  AsyncOperation::handle_FinishOperation(e);
+}
Index: ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.hpp
===================================================================
--- ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.hpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
+++ ThirdParty/JobMarket/src/JobMarket/Operations/Controllers/GetNumberWorkersOperation.hpp	(revision 0542e2f463a06af301c7d8c1f236f8938a59f7b4)
@@ -0,0 +1,60 @@
+/*
+ * GetNumberWorkersOperation.hpp
+ *
+ *  Created on: Apr 5, 2018
+ *      Author: heber
+ */
+
+#ifndef FRAGMENTCONTROLLER_GETNUMBERWORKERSOPERATION_HPP_
+#define FRAGMENTCONTROLLER_GETNUMBERWORKERSOPERATION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <boost/asio.hpp>
+
+#include "JobMarket/Connection.hpp"
+
+#include "JobMarket/JobId.hpp"
+#include "JobMarket/Operations/AsyncOperation.hpp"
+#include "JobMarket/types.hpp"
+
+/** This Operations requests number of present jobs and present results (done
+ * jobs) from the server.
+ *
+ */
+class GetNumberWorkersOperation : public AsyncOperation  {
+public:
+  /// Constructor for class GetNumberWorkersOperation.
+  GetNumberWorkersOperation(Connection &_connection,
+      const boost::function<void ()> _callback_on_success = NoOpCallback,
+      const boost::function<void ()> _callback_on_failure = NoOpCallback) :
+    AsyncOperation(std::string("numberworkers"), _connection, _callback_on_success, _callback_on_failure)
+  {}
+  /// Destructor for class GetNumberWorkersOperation
+  ~GetNumberWorkersOperation() {}
+
+public:
+  // virtual function pointer to the connection handler
+  virtual void handle_connect(const boost::system::error_code& e,
+      boost::asio::ip::tcp::resolver::iterator endpoint_iterator);
+
+  /// Callback function when receiving the number of workers
+  void handle_ReceiveNumberWorkers(const boost::system::error_code& e);
+
+  // getter for the various numbers of workers after op has finished
+  const std::vector<size_t>& get() const
+  { return number_workers; }
+
+protected:
+  /// Callback function when Operations finishes.
+  void handle_FinishOperation(const boost::system::error_code& e);
+
+private:
+  //!> temporary for a idle and busy workers
+  std::vector<size_t> number_workers;
+};
+
+#endif /* FRAGMENTCONTROLLER_GETNUMBERWORKERSOPERATION_HPP_ */
