Skip to content
Snippets Groups Projects
Commit 9fdfce51 authored by René Pascal Becker's avatar René Pascal Becker
Browse files

Use a single message type with request types

parent dccdbe0d
No related branches found
No related tags found
No related merge requests found
......@@ -62,8 +62,14 @@
#define THESIS_LOG FILE *ptr = fopen("/home/pmix","a"); fprintf(ptr, "%s:%d called\n", __FILE__, __LINE__); fclose(ptr);
#define DPM_AGENT_KEYSTORE_PUBLISH_MSG 0x100
#define DPM_AGENT_KEYSTORE_LOOKUP_MSG 0x101
#define DPM_AGENT_KEYSTORE_MSG 0x100
enum KeyStoreRequests
{
STORE_PUBLISH,
STORE_LOOKUP,
STORE_UNPUBLISH
};
struct PmixInfoData
{
......@@ -211,10 +217,10 @@ int publish_to_dpm_agent(const pmix_proc_t *proc, const pmix_info_t info[], size
char data[max_publish_size];
memset((void*)data, 0, max_publish_size);
snprintf(data, max_publish_size,
"%s,%zu,%s,%s",
"%d,%s,%zu,%s,%s", (int)STORE_PUBLISH,
(const char*)proc->nspace, (size_t)proc->rank, info_data.key, info_data.value);
if (!_send_message(socket_fd, DPM_AGENT_KEYSTORE_PUBLISH_MSG, data))
if (!_send_message(socket_fd, DPM_AGENT_KEYSTORE_MSG, data))
return 0;
close(socket_fd);
return 1;
......@@ -252,10 +258,10 @@ int lookup_from_dpm_agent(const pmix_proc_t *proc, const pmix_info_t info[], siz
char data[max_lookup_size];
memset((void*)data, 0, max_lookup_size);
snprintf(data, max_lookup_size,
"%s,%zu,%s",
"%d,%s,%zu,%s", (int)STORE_LOOKUP,
(const char*)proc->nspace, (size_t)proc->rank, key);
if (!_send_message(socket_fd, DPM_AGENT_KEYSTORE_LOOKUP_MSG, data))
if (!_send_message(socket_fd, DPM_AGENT_KEYSTORE_MSG, data))
return 0;
close(socket_fd);
return 1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment