rahul003 commented on a change in pull request #9933: Adding support to profile kvstore server during distributed training URL: https://github.com/apache/incubator-mxnet/pull/9933#discussion_r171484371
########## File path: src/kvstore/kvstore_dist_server.h ########## @@ -170,6 +187,33 @@ class KVStoreDistServer { app->Response(recved); } + void SetProfilerConfig(std::string params_str) { + std::vector<std::string> elems; + mxnet::kvstore::split(params_str, ',', std::back_inserter(elems)); + std::vector<const char*> ckeys; + std::vector<const char*> cvals; + ckeys.reserve(elems.size()); + cvals.reserve(elems.size()); + + for (int i=0; i < elems.size(); i++) { + std::vector<std::string> parts; + mxnet::kvstore::split(elems[i], ':', std::back_inserter(parts)); + CHECK_NOTNULL(parts[0].c_str()); + CHECK_NOTNULL(parts[1].c_str()); + if (parts[0] == "filename") { + parts[1] = "rank" + std::to_string(ps::MyRank()) + "_" + parts[1]; + } + char * ckey = new char[parts[0].length() + 1]; + std::sprintf(ckey, "%s", parts[0].c_str()); + ckeys.push_back(ckey); + + char* cval = new char[parts[1].length() + 1]; Review comment: fixed ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services