Skip to content
Snippets Groups Projects

Add VRM Jobid to the send process infos

Merged felixkhals requested to merge feature/vrm_jobid into master
3 files
+ 74
44
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/un.h>
#include <unistd.h>
#include <string.h>
@@ -57,6 +58,8 @@
#define FD_STDIN 0
#define BUFFLEN 128
#define JOBID_ENV_VAR "SLURM_VRM_JOBID"
/*
** Table for Fortran <-> C communicator handle conversion
** Also used by P2P code to lookup communicator based
@@ -141,11 +144,20 @@ static int get_modified_ranks(uint32_t jobid, uint32_t vpid, size_t size, opal_v
pid_t pid = getpid();
const char * vrm_jobid = getenv(JOBID_ENV_VAR);
char vrm_jobid_with_leading_comma[sizeof(uint64_t) + 1] = "";
if (NULL != vrm_jobid) {
char comma = ',';
strncat(vrm_jobid_with_leading_comma, &comma, 1);
strcat(vrm_jobid_with_leading_comma, vrm_jobid);
printf("TEST: %s", vrm_jobid_with_leading_comma);
}
char info_to_send[BUFFLEN];
memset(info_to_send, 0, BUFFLEN);
snprintf(info_to_send, BUFFLEN,
"{\"msg_type\": 128, \"msg_data\": \"%d,%u,%u,%zu\"}",
pid, vpid, jobid, size);
"{\"msg_type\": 128, \"msg_data\": \"%d,%u,%u,%zu%s\"}",
pid, vpid, jobid, size, vrm_jobid_with_leading_comma);
// TODO: endianness
uint32_t msg_length = strlen(info_to_send) + 1;
Loading