diff --git a/paddle/fluid/framework/async_executor.cc b/paddle/fluid/framework/async_executor.cc index b2423694d0a04cec2d133fc74e1229b1c5b0b0f2..b13eefba2e6ce0613a35c01718c71d5f6df40403 100644 --- a/paddle/fluid/framework/async_executor.cc +++ b/paddle/fluid/framework/async_executor.cc @@ -155,8 +155,7 @@ void AsyncExecutor::RunFromFile(const ProgramDesc& main_program, } #ifdef PADDLE_WITH_PSLIB if (mode == "mpi") { - // todo ? - //_pull_dense_thread->stop(); + _pull_dense_thread->stop(); } #endif VLOG(3) << "start to run from files in async_executor"; diff --git a/paddle/fluid/framework/fleet/fleet_wrapper.h b/paddle/fluid/framework/fleet/fleet_wrapper.h index 6090ec753d55a1462b9609883b3c1cdf578cca32..7a60686c24073395df833562781c7cc09b9d476c 100644 --- a/paddle/fluid/framework/fleet/fleet_wrapper.h +++ b/paddle/fluid/framework/fleet/fleet_wrapper.h @@ -21,13 +21,14 @@ limitations under the License. */ #endif #include #include +#include #include #include #include +#include "paddle/fluid/framework/program_desc.h" #include "paddle/fluid/framework/scope.h" #include "paddle/fluid/framework/variable_helper.h" #include "paddle/fluid/platform/macros.h" // for DISABLE_COPY_AND_ASSIGN -#include "paddle/fluid/framework/program_desc.h" namespace paddle { namespace framework { @@ -72,9 +73,8 @@ class FleetWrapper { const std::vector& var_names, std::vector<::std::future>* pull_dense_status); - void PushDenseParamSync( - const ProgramDesc& program, const uint64_t table_id, - const std::vector& var_names); + void PushDenseParamSync(const ProgramDesc& program, const uint64_t table_id, + const std::vector& var_names); // Push dense variables to server in async mode // Param: scope, table_id, var_names, @@ -122,13 +122,12 @@ class FleetWrapper { uint64_t RunServer(); void GatherServers(const std::vector& host_sign_list, int node_num); - typedef std::function MsgHandlerFunc; + typedef std::function MsgHandlerFunc; int RegisterClientToClientMsgHandler(int msg_type, MsgHandlerFunc handler); - std::future SendClientToClientMsg(int msg_type, - int to_client_id, - const std::string& msg); - std::default_random_engine& LocalRandomEngine(); + std::future SendClientToClientMsg(int msg_type, int to_client_id, + const std::string& msg); + std::default_random_engine& LocalRandomEngine(); template void Serialize(const std::vector& t, std::string* str); template diff --git a/paddle/fluid/framework/io/shell.cc b/paddle/fluid/framework/io/shell.cc index 47de5c650a44e41bef12cc0f68f4c6f34e051e7a..42f513fef1e9fe34b606f2add912d77e3e8da3ce 100644 --- a/paddle/fluid/framework/io/shell.cc +++ b/paddle/fluid/framework/io/shell.cc @@ -197,7 +197,7 @@ std::shared_ptr shell_popen(const std::string& cmd, static int shell_p2open_fork_internal(const char* real_cmd, int pipein_fds[2], int pipeout_fds[2]) { -#ifndef +#ifndef _WIN32 int child_pid = -1; if ((child_pid = fork()) < 0) { return -1; diff --git a/paddle/fluid/framework/io/shell.h b/paddle/fluid/framework/io/shell.h index effaa1e99ed477bd1667b3237faed2824967911b..5c56417daf332e2f4340db29659bbb47c8787d24 100644 --- a/paddle/fluid/framework/io/shell.h +++ b/paddle/fluid/framework/io/shell.h @@ -16,7 +16,11 @@ #include #include +#ifdef _WIN32 +#include +#else #include +#endif #include #include #include diff --git a/paddle/fluid/platform/lodtensor_printer_test.cc b/paddle/fluid/platform/lodtensor_printer_test.cc index f0618c9216fb9646dd3a960a0088347855d4f7a9..0afc70fcf0639760d2f9a7df62798e97471ea809 100644 --- a/paddle/fluid/platform/lodtensor_printer_test.cc +++ b/paddle/fluid/platform/lodtensor_printer_test.cc @@ -18,7 +18,7 @@ TEST(LodTensorPrinter, PrintVar) { paddle::framework::Scope scope; - PrintVar(&scope, "NotAVar", "We don't have var"); + paddle::platform::PrintVar(&scope, "NotAVar", "We don't have var"); paddle::framework::Variable* v = scope.Var("NotAVar"); - PrintVar(&scope, "NotAVar", "Now we have a var"); + paddle::platform::PrintVar(&scope, "NotAVar", "Now we have a var"); }