22 #ifndef INCLUDE_TRAINER_SERVER_H_
23 #define INCLUDE_TRAINER_SERVER_H_
25 #include <unordered_map>
26 #include <utils/param.h>
27 #include <utils/updater.h>
28 #include "proto/job.pb.h"
29 #include "communication/socket.h"
44 Server(
int thread_id,
int group_id,
int server_id);
46 void Setup(
const UpdaterProto& proto,
47 const std::vector<int>& slice2group,
48 const std::vector<int>& slice2server);
50 const int grp_id()
const {
53 const int id()
const {
124 int thread_id_,grp_id_, id_;
127 std::unordered_map<int, ParamEntry*> shard_;
132 std::vector<int> nPendingSync_;
133 std::vector<Blob<float>> last_sync_;
134 std::unordered_map<int, std::vector<Msg*>> buffer_requests_;
137 #endif //INCLUDE_TRAINER_SERVER_H_
virtual Msg * HandlePut(Msg **msg)
Process PUT request.
virtual Msg * HandleGet(Msg **msg)
Process GET request.
Updater * updater_
map from slice ID to slice and deleted in the destructor
Definition: server.h:125
std::vector< int > slice2server_
num of updates from last sync with master server group for a param/slice
Definition: server.h:128
Msg used to transfer Param info (gradient or value), feature blob, etc between workers, stubs and servers.
Definition: msg.h:91
virtual Msg * HandleSyncRequest(Msg **msg)
Handle sync request from other server groups.
Updater for Param.
Definition: updater.h:88
std::vector< int > nUpdates_
num of sync requests that have not been responded
Definition: server.h:130
const std::vector< Msg * > HandleUpdate(Msg **msg)
Process Update request.
void HandleSyncResponse(Msg **msg)
Handle sync response.