Commit 51cc731e authored by neverlord's avatar neverlord

distributed benchmark

parent 89e7d2cb
......@@ -3,12 +3,13 @@ ACLOCAL_AMFLAGS = -I ../m4
AM_CXXFLAGS = -I../ --std=c++0x -pedantic -Wall -Wextra
noinst_PROGRAMS = actor_creation mailbox_performance mixed_case matching
noinst_PROGRAMS = actor_creation mailbox_performance mixed_case matching distributed
actor_creation_SOURCES = actor_creation.cpp
mailbox_performance_SOURCES = mailbox_performance.cpp
mixed_case_SOURCES = mixed_case.cpp
matching_SOURCES = matching.cpp
distributed_SOURCES = distributed.cpp
EXAMPLES_LIBS = -L../.libs/ -lcppa $(BOOST_LDFLAGS) $(BOOST_THREAD_LIB)
......@@ -16,3 +17,4 @@ actor_creation_LDADD = $(EXAMPLES_LIBS)
mailbox_performance_LDADD = $(EXAMPLES_LIBS)
mixed_case_LDADD = $(EXAMPLES_LIBS)
matching_LDADD = $(EXAMPLES_LIBS)
distributed_LDADD = $(EXAMPLES_LIBS)
This diff is collapsed.
......@@ -32,10 +32,32 @@
#define UTILITY_HPP
#include <vector>
#include <string>
#include <sstream>
#include <stdexcept>
#include <algorithm>
#include "boost/thread.hpp"
inline std::vector<std::string> split(std::string const& str, char delim)
{
std::vector<std::string> result;
std::stringstream strs{str};
std::string tmp;
while (std::getline(strs, tmp, delim)) result.push_back(tmp);
return result;
}
inline std::string join(std::vector<std::string> const& vec,
std::string const& delim = "")
{
if (vec.empty()) return "";
auto result = vec.front();
for (auto i = vec.begin() + 1; i != vec.end(); ++i)
{
result += delim;
result += *i;
}
return result;
}
template<typename T>
T rd(char const* cstr)
......@@ -53,12 +75,6 @@ T rd(char const* cstr)
return result;
}
#ifdef __APPLE__
int num_cores()
{
return static_cast<int>(boost::thread::hardware_concurrency());
}
#else
int num_cores()
{
char cbuf[100];
......@@ -73,7 +89,6 @@ int num_cores()
*i = '\0';
return rd<int>(cbuf);
}
#endif
std::vector<uint64_t> factorize(uint64_t n)
{
......
......@@ -268,3 +268,4 @@ cppa/detail/scheduled_actor_dummy.hpp
cppa/detail/nestable_receive_actor.hpp
cppa/detail/filter_result.hpp
benchmarks/PingPong.scala
benchmarks/distributed.cpp
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment