diff --git a/include/fednlib/grpc.h b/include/fednlib/grpc.h index c4fad0c..75bd7ed 100644 --- a/include/fednlib/grpc.h +++ b/include/fednlib/grpc.h @@ -65,7 +65,7 @@ class GrpcClient { void setName(const std::string& name); void setId(const std::string& id); void setChunkSize(std::size_t chunkSize); - bool logMetrics(const std::map& metrics, const std::optional step=std::nullopt, const bool commit=true); + bool logMetrics(const std::map& metrics, const int* step=nullptr, const bool commit=true); bool sendModelMetrics(const std::map& metrics, const std::string& name, const std::string& client_id, diff --git a/src/grpc.cpp b/src/grpc.cpp index e4db599..0a1624c 100644 --- a/src/grpc.cpp +++ b/src/grpc.cpp @@ -889,10 +889,10 @@ void sendIntervalHeartBeat(GrpcClient* client, int intervalSeconds) { } -bool GrpcClient::logMetrics(const std::map& metrics, const std::optional step, const bool commit){ +bool GrpcClient::logMetrics(const std::map& metrics, const int* step, const bool commit){ // Add step and commit information if provided - if (step.has_value()) { - loggingContext.setStep(step.value()); + if (step != nullptr) { + loggingContext.setStep(*step); } std::string roundId = loggingContext.getRoundId(); std::string modelId = loggingContext.getModelId();