Permalink
Browse files

More changes for MSVC

  • Loading branch information...
hkaiser committed Jul 19, 2017
1 parent ed2f6c0 commit 186b84a22c717f6f4c1e78fa33c7c9f7e91934c9
@@ -23,6 +23,7 @@
#include <iomanip>
#ifdef _WIN32
#include <windows.h>
#include <WinSock2.h>
#else
#include <unistd.h>
#endif
@@ -15,4 +15,6 @@ LIBGEODECOMP_REGISTER_HPX_COMM_TYPE(int)
LIBGEODECOMP_REGISTER_HPX_COMM_TYPE(CoordBox1)
LIBGEODECOMP_REGISTER_HPX_COMM_TYPE(CoordBox2)
LIBGEODECOMP_REGISTER_HPX_COMM_TYPE(CoordBox3)
HPX_REGISTER_COMPONENT_MODULE()
#endif
@@ -2,6 +2,7 @@
#define LIBGEODECOMP_COMMUNICATION_HPXRECEIVER_H
#include <libgeodecomp/config.h>
#include <hpx/config.hpp>
#ifdef LIBGEODECOMP_WITH_CPP14
#include <utility>
#endif
@@ -34,7 +35,7 @@
namespace LibGeoDecomp {
template <typename CARGO, typename BUFFER=hpx::lcos::local::receive_buffer<CARGO> >
class HPX_COMPONENT_EXPORT HPXReceiver : public hpx::components::managed_component_base<HPXReceiver<CARGO> >
class HPX_ALWAYS_EXPORT HPXReceiver : public hpx::components::managed_component_base<HPXReceiver<CARGO> >
{
public:
typedef CARGO Cargo;
@@ -18,6 +18,10 @@ namespace LibGeoDecomp {
* happens at compile time, thus no runtime overhead is incurred for
* filtered messages.
*/
#ifdef ERROR
#undef ERROR
#endif
class Logger {
public:
static const int FATAL = 0;
@@ -2,7 +2,7 @@
namespace LibGeoDecomp {
std::vector<std::size_t> LoadBalancer::initialWeights(std::size_t items, const std::vector<double> rankSpeeds)
std::vector<std::size_t> LoadBalancer::initialWeights(std::size_t items, const std::vector<double>& rankSpeeds)
{
std::size_t size = rankSpeeds.size();
double totalSum = sum(rankSpeeds);
@@ -11,7 +11,7 @@ namespace LibGeoDecomp {
* load by assigning a fraction of the total work to each
* MPI processes/HPX localities.
*/
class LoadBalancer
class HPX_COMPONENT_EXPORT LoadBalancer
{
public:
typedef std::vector<std::size_t> WeightVec;
@@ -46,10 +46,10 @@ class LoadBalancer
* number of cells in the simulation space). rankSpeeds gives an
* estimate of the relative performance of the different ranks
* (good when running on heterogeneous systems, e.g. clusters
* comprised of multiple genrations of nodes or x86 clusters with
* comprised of multiple generations of nodes or x86 clusters with
* additional Xeon Phi accelerators).
*/
static std::vector<std::size_t> initialWeights(std::size_t items, const std::vector<double> rankSpeeds);
static std::vector<std::size_t> initialWeights(std::size_t items, const std::vector<double>& rankSpeeds);
};
@@ -9,7 +9,7 @@ namespace LibGeoDecomp {
* This class is for testing purposes and will not not modify the
* given work loads.
*/
class NoOpBalancer : public LoadBalancer
class HPX_COMPONENT_EXPORT NoOpBalancer : public LoadBalancer
{
public:
virtual WeightVec balance(const WeightVec& weights, const LoadVec& /* relativeLoads */)
@@ -25,7 +25,7 @@ namespace LibGeoDecomp {
* OozeBalancer will return a weighted linear combination of the old
* distribution (weights) and the new one is returned.
*/
class OozeBalancer : public LoadBalancer
class HPX_COMPONENT_EXPORT OozeBalancer : public LoadBalancer
{
public:
friend class OozeBalancerTest1;
@@ -18,7 +18,7 @@ namespace LibGeoDecomp {
* This class relies on another LoadBalancer to do the job, but is
* able to pass debug output.
*/
class TracingBalancer : public LoadBalancer
class HPX_COMPONENT_EXPORT TracingBalancer : public LoadBalancer
{
public:
explicit TracingBalancer(
@@ -3,11 +3,11 @@
#include <cmath>
#if defined(_MSC_VER)
inline int round(double d)
{
return d >= 0.0 ? static_cast<int>(d + 0.5) : static_cast<int>(d - 0.5);
}
#endif
// #if defined(_MSC_VER)
// inline int round(double d)
// {
// return d >= 0.0 ? static_cast<int>(d + 0.5) : static_cast<int>(d - 0.5);
// }
// #endif
#endif
@@ -1,3 +1,5 @@
#include <hpx/hpx_init.hpp>
#include <iostream>
#include <libgeodecomp/geometry/partitions/unstructuredstripingpartition.h>
#include <libgeodecomp/geometry/floatcoord.h>
@@ -10,8 +12,6 @@
#include <libflatarray/testbed/cpu_benchmark.hpp>
#include <libflatarray/testbed/evaluate.hpp>
#include <hpx/hpx_init.hpp>
#include "../performancetests/cpubenchmark.h"
using namespace LibGeoDecomp;

0 comments on commit 186b84a

Please sign in to comment.