1
0
Fork 0

Fix various conversion warnings

This commit is contained in:
Simon Grätzer 2017-03-24 17:52:50 +01:00
parent 7007db2f44
commit aadcad3a00
6 changed files with 15 additions and 14 deletions

View File

@ -88,7 +88,7 @@ uint32_t HLLCounter::getCount() {
} else if (estimate > (1.0 / 30.0) * pow_2_32) {
estimate = neg_pow_2_32 * log(1.0 - (estimate / pow_2_32));
}
return estimate;
return (uint32_t) estimate;
}
void HLLCounter::merge(HLLCounter const& other) {

View File

@ -56,13 +56,13 @@ struct HITSComputation
void compute(
MessageIterator<SenderMessage<double>> const& messages) override {
double auth = 0.0f;
double hub = 0.0f;
double auth = 0.0;
double hub = 0.0;
// we don't know our incoming neighbours in step 0, therfore we need step 0
// as 'initialization' before actually starting to converge
if (globalSuperstep() <= 1) {
auth = 1.0f;
hub = 1.0f;
auth = 1.0;
hub = 1.0;
} else {
HITSWorkerContext const* ctx = static_cast<HITSWorkerContext const*>(context());
for (SenderMessage<double> const* message : messages) {

View File

@ -32,7 +32,7 @@ using namespace arangodb;
using namespace arangodb::pregel;
using namespace arangodb::pregel::algos;
static float EPS = 0.00001;
static float EPS = 0.00001f;
static std::string const kConvergence = "convergence";
struct PRWorkerContext : public WorkerContext {
@ -41,9 +41,9 @@ struct PRWorkerContext : public WorkerContext {
float commonProb = 0;
void preGlobalSuperstep(uint64_t gss) override {
if (gss == 0) {
commonProb = 1.0 / vertexCount();
commonProb = 1.0f / vertexCount();
} else {
commonProb = 0.15 / vertexCount();
commonProb = 0.15f / vertexCount();
}
}
};
@ -64,11 +64,11 @@ struct PRComputation : public VertexComputation<float, float, float> {
if (globalSuperstep() == 0) {
*ptr = ctx->commonProb;
} else {
float sum = 0.0;
float sum = 0.0f;
for (const float* msg : messages) {
sum += *msg;
}
*ptr = 0.85 * sum + ctx->commonProb;
*ptr = 0.85f * sum + ctx->commonProb;
}
float diff = fabs(copy - *ptr);
aggregate<float>(kConvergence, diff);

View File

@ -115,7 +115,7 @@ struct SenderMessageFormat : public MessageFormat<SenderMessage<T>> {
SenderMessageFormat() {}
void unwrapValue(VPackSlice s, SenderMessage<T>& senderVal) const override {
VPackArrayIterator array(s);
senderVal.senderId.shard = (*array).getUInt();
senderVal.senderId.shard = (PregelShard) ((*array).getUInt());
senderVal.senderId.key = (*(++array)).copyString();
senderVal.value = (*(++array)).getNumber<T>();
}

View File

@ -522,9 +522,9 @@ void Worker<V, E, M>::_finishedProcessing() {
// async adaptive message buffering
_messageBatchSize = _algorithm->messageBatchSize(_config, _messageStats);
} else {
uint32_t tn = _config.parallelism();
uint32_t s = _messageStats.sendCount / tn / 2UL;
_messageBatchSize = s > 1000 ? s : 1000;
uint64_t tn = _config.parallelism();
uint64_t s = _messageStats.sendCount / tn / 2UL;
_messageBatchSize = s > 1000 ? (uint32_t)s : 1000;
}
_messageStats.resetTracking();
LOG_TOPIC(DEBUG, Logger::PREGEL) << "Batch size: " << _messageBatchSize;

View File

@ -40,6 +40,7 @@ using VPackHelper = arangodb::basics::VelocyPackHelper;
using TraverserOptions = arangodb::traverser::TraverserOptions;
using ShortestPathOptions = arangodb::traverser::ShortestPathOptions;
using BaseTraverserOptions = arangodb::traverser::BaseTraverserOptions;
using namespace arangodb::transaction;
BaseTraverserOptions::LookupInfo::LookupInfo()
: expression(nullptr),