Skip to content
Snippets Groups Projects
Commit e391ed61 authored by FKHals's avatar FKHals
Browse files

Use csv-formatted values in message to agent

so that it can be easier parsed using a saner alternative to sscanf() in
the future.
parent cc520585
No related branches found
No related tags found
No related merge requests found
...@@ -119,7 +119,7 @@ static int getProcessAgentRank(uint32_t jobid, uint32_t vpid, size_t size) { ...@@ -119,7 +119,7 @@ static int getProcessAgentRank(uint32_t jobid, uint32_t vpid, size_t size) {
char info_to_send[BUFFLEN]; char info_to_send[BUFFLEN];
snprintf(info_to_send, BUFFLEN+1, snprintf(info_to_send, BUFFLEN+1,
"Spawned - PID: %d, vpid: %u, jobID: %u, size: %zu", "%d,%u,%u,%zu",
pid, vpid, jobid, size); pid, vpid, jobid, size);
if (send(fdSock, info_to_send, BUFFLEN+1, 0) < 0) { if (send(fdSock, info_to_send, BUFFLEN+1, 0) < 0) {
errorExit("send"); errorExit("send");
......
...@@ -170,8 +170,8 @@ int main(void) { ...@@ -170,8 +170,8 @@ int main(void) {
uint32_t vpid; uint32_t vpid;
uint32_t jobid; uint32_t jobid;
size_t size; size_t size;
sscanf(client_message, "Spawned - PID: %d, vpid: %u, jobID: %u, size: %zu", &pid, &vpid, &jobid, &size); sscanf(client_message, "%d,%u,%u,%zu", &pid, &vpid, &jobid, &size);
//printf("\nCheck: PID: %d, vpid: %u, jobID: %u, size: %zu", pid, vpid, jobid, size); printf("Spawned - PID: %d, vpid: %u, jobID: %u, size: %zu\n", pid, vpid, jobid, size);
uint32_t desiredRank = getDesiredVpid(jobid, vpid, size, &hstorage); uint32_t desiredRank = getDesiredVpid(jobid, vpid, size, &hstorage);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment