Commit c2a40cf0 by xiaotong

rename AddJobBroadcastSingle as AddJobBroadcast

parent 7950bd3c
...@@ -558,7 +558,7 @@ void XLeader::RunUpdate(XConfig * config, XOptimizer * optimizer, const int * ac ...@@ -558,7 +558,7 @@ void XLeader::RunUpdate(XConfig * config, XOptimizer * optimizer, const int * ac
updater->AddJobEnqueueFinished(jobQueue); updater->AddJobEnqueueFinished(jobQueue);
/* broadcast the new parameter to other models*/ /* broadcast the new parameter to other models*/
broadcaster->AddJobBroadcastSingle(jobQueue, &serverModel, &membersAll, j); broadcaster->AddJobBroadcast(jobQueue, &serverModel, &membersAll, j);
broadcaster->AddJobEnqueueFinished(jobQueue); broadcaster->AddJobEnqueueFinished(jobQueue);
} }
} }
......
...@@ -55,7 +55,7 @@ broadcast data for a parameter ...@@ -55,7 +55,7 @@ broadcast data for a parameter
>> targetList - the target places that we recieve the data >> targetList - the target places that we recieve the data
>> pid - the parameter index >> pid - the parameter index
*/ */
void XWorkerBroadcast::BroadcastDataSingle(XModel * source, XList * targetList, int pid) void XWorkerBroadcast::BroadcastData(XModel * source, XList * targetList, int pid)
{ {
CheckNTErrors(source->params[pid].flag == PARAM_STATE_UPDATED, CheckNTErrors(source->params[pid].flag == PARAM_STATE_UPDATED,
"The parameter is not ready for broadcasting"); "The parameter is not ready for broadcasting");
...@@ -75,7 +75,7 @@ void XWorkerBroadcast::BroadcastDataSingle(XModel * source, XList * targetList, ...@@ -75,7 +75,7 @@ void XWorkerBroadcast::BroadcastDataSingle(XModel * source, XList * targetList,
wrapper of BroadcastDataSingle wrapper of BroadcastDataSingle
>> args - the list of arguments >> args - the list of arguments
*/ */
void XWorkerBroadcast::BroadcastSingle(XList * args) void XWorkerBroadcast::Broadcast(XList * args)
{ {
int paramCount = 0; int paramCount = 0;
...@@ -93,7 +93,7 @@ void XWorkerBroadcast::BroadcastSingle(XList * args) ...@@ -93,7 +93,7 @@ void XWorkerBroadcast::BroadcastSingle(XList * args)
/* parameter index */ /* parameter index */
int p = args->GetInt(paramCount++); int p = args->GetInt(paramCount++);
broadcaster->BroadcastDataSingle(source, &target, p); broadcaster->BroadcastData(source, &target, p);
} }
/* /*
...@@ -118,7 +118,7 @@ add a new job of broadcasting data (for a parameter) ...@@ -118,7 +118,7 @@ add a new job of broadcasting data (for a parameter)
>> targetList - the target places that we recieve the data >> targetList - the target places that we recieve the data
>> pid - the parameter index >> pid - the parameter index
*/ */
bool XWorkerBroadcast::AddJobBroadcastSingle(XQueue * jobQueue, XModel * source, XList * targetList, int pid) bool XWorkerBroadcast::AddJobBroadcast(XQueue * jobQueue, XModel * source, XList * targetList, int pid)
{ {
CheckNTErrors(source != NULL, "no input source tensor!"); CheckNTErrors(source != NULL, "no input source tensor!");
CheckNTErrors(targetList != NULL, "no input target tensor list!"); CheckNTErrors(targetList != NULL, "no input target tensor list!");
...@@ -134,9 +134,9 @@ bool XWorkerBroadcast::AddJobBroadcastSingle(XQueue * jobQueue, XModel * source, ...@@ -134,9 +134,9 @@ bool XWorkerBroadcast::AddJobBroadcastSingle(XQueue * jobQueue, XModel * source,
XQueue& queueRun = jobQueue != NULL ? *jobQueue : queue; XQueue& queueRun = jobQueue != NULL ? *jobQueue : queue;
if (isInstantRun) if (isInstantRun)
XWorkerBroadcast::BroadcastSingle(&args); XWorkerBroadcast::Broadcast(&args);
else else
queueRun.EnqueueJob((void*)(char*)XWorkerBroadcast::BroadcastSingle, &args); queueRun.EnqueueJob((void*)(char*)XWorkerBroadcast::Broadcast, &args);
return true; return true;
} }
......
...@@ -61,17 +61,17 @@ public: ...@@ -61,17 +61,17 @@ public:
void SetBroadcastMode(DATA_BROADCAST_TYPE myMode); void SetBroadcastMode(DATA_BROADCAST_TYPE myMode);
/* broadcast data for a parameter */ /* broadcast data for a parameter */
void BroadcastDataSingle(XModel * source, XList * targetList, int pid); void BroadcastData(XModel * source, XList * targetList, int pid);
/* wrapper of BroadcastDataSingle */ /* wrapper of BroadcastDataSingle */
static static
void BroadcastSingle(XList * args); void Broadcast(XList * args);
/* P2P data broadcasting */ /* P2P data broadcasting */
void BroadcastP2P(XTensor * source, XTensor * target); void BroadcastP2P(XTensor * source, XTensor * target);
/* add a new job of broadcasting data (for a parameter) */ /* add a new job of broadcasting data (for a parameter) */
bool AddJobBroadcastSingle(XQueue * jobQueue, XModel * source, XList * targetList, int pid); bool AddJobBroadcast(XQueue * jobQueue, XModel * source, XList * targetList, int pid);
}; };
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论