pslib_warpper.h 1012 字节
Newer Older
X
xiexionghang 已提交
1 2
#pragma once

X
xiexionghang 已提交
3
// Hide BLOG
4
#ifndef BUTIL_LOGGING_H_
X
xiexionghang 已提交
5
#define BUTIL_LOGGING_H_
6 7
#endif
#ifndef COMPACT_GOOGLE_LOG_NOTICE
X
xiexionghang 已提交
8
#define COMPACT_GOOGLE_LOG_NOTICE COMPACT_GOOGLE_LOG_INFO
9 10
#endif 

X
xiexionghang 已提交
11 12 13 14 15 16
#include "communicate/ps_server.h"
#include "communicate/ps_client.h"

namespace paddle {
namespace custom_trainer {
namespace feed {
X
xiexionghang 已提交
17

X
xiexionghang 已提交
18 19 20 21 22 23 24
    
class RuntimeEnvironment;
class PSlib {
public:
    PSlib() {}
    virtual ~PSlib() {}
    int initialize(const std::string& conf_path, 
X
xiexionghang 已提交
25
        RuntimeEnvironment* environment);
X
xiexionghang 已提交
26 27 28 29 30 31
        
    virtual paddle::ps::PSServer* ps_server();
    virtual paddle::ps::PSClient* ps_client();
    virtual paddle::PSParameter* get_param();
private:
    void init_gflag();
X
xiexionghang 已提交
32 33
    virtual int init_server();
    virtual int init_client();
X
xiexionghang 已提交
34 35 36 37 38 39 40 41 42 43

    paddle::PSParameter _ps_param;
    RuntimeEnvironment* _environment;
    std::shared_ptr<paddle::ps::PSServer> _server_ptr;
    std::shared_ptr<paddle::ps::PSClient> _client_ptr;  
};

}  // namespace feed
}  // namespace custom_trainer
}  // namespace paddle