Hi Jaison,
This is the reply from Richard; he is saying that the wait time between t_3 and t_4 is for all submitted task results to return.
sesPtr->fetchTaskOutput(tasksToSend)
- fetchTasKOutput will return after all task replies are received.
Code:
for (int iter = 0; iter < n; iter++ )
{
gettimeofday(&t_start, NULL);
int* rowsSend = new int[tasksToSend];
int* rowTag = new int[tasksToSend];
int rowCount = 0; //initiate row count
// Now we will send messages to our service
for (int taskCount = 0; taskCount < tasksToSend; taskCount++)
{
int lenVector = sizeof(double)*order;
int noOfRowsSend = numberOfRowsToSend(order, tasksToSend, taskCount);
gettimeofday(&t_1, NULL);
// Create message
MyInput inMsg(rowCount, noOfRowsSend, Vector, lenVector);
// Create task attributes
TaskSubmissionAttributes attrTask;
attrTask.setTaskInput(&inMsg);
// send it
TaskInputHandlePtr input = sesPtr->sendTaskInput(attrTask);
gettimeofday(&t_2, NULL);
elapsed1 = t_2.tv_sec - t_1.tv_sec +
(t_2.tv_usec - t_1.tv_usec) / 1.e6;
outFile1 << elapsed1 << " " << input->getId() << endl;
rowsSend[taskCount] = noOfRowsSend;
rowTag[taskCount]=rowCount;
rowCount = rowCount+noOfRowsSend;
}
gettimeofday(&t_3, NULL);
// Now get our results - will block here until all tasks retrieved
EnumItemsPtr enumOutput = sesPtr->fetchTaskOutput(tasksToSend);
gettimeofday(&t_4, NULL);
// Inspect results
TaskOutputHandlePtr output;
gettimeofday(&t_5, NULL);
From the code it seems like Jaison is doing the following
- Get an over start time
- for each task he is writing the time it takes for the message to be serialized and dispatched and confirmed between the client and the SSM
- Then records a time stamp T3
- Then tries to fetch all the tasks that he sent (at once)
- Then records another time stamp T4
- Then records another timestamp T5
- Iterates through all the replies
- Then records another timestamp T6
- Then calculate a bunch of elapsed times.
What is not clear to me is what is the real problem. This is a sync client. He is submitting more tasks than there are slots that have average run time of 1 second. (I don’t see a problem)..
- Ajith