Commit 383bfc8c authored by Matthieu Dorier's avatar Matthieu Dorier

exposing placement to Cortex

parent 18ac8bbe
......@@ -1597,6 +1597,8 @@ int modelnet_mpi_replay(MPI_Comm comm, int* argc, char*** argv )
return -1;
}
jobmap_ctx = NULL; // make sure it's NULL if it's not used
if(strlen(workloads_conf_file) > 0)
{
FILE *name_file = fopen(workloads_conf_file, "r");
......@@ -1629,6 +1631,11 @@ int modelnet_mpi_replay(MPI_Comm comm, int* argc, char*** argv )
strcpy(file_name_of_job[0], workload_file);
num_traces_of_job[0] = num_net_traces;
alloc_spec = 0;
if(strlen(alloc_file) > 0) {
alloc_spec = 1;
jobmap_p.alloc_file = alloc_file;
jobmap_ctx = codes_jobmap_configure(CODES_JOBMAP_LIST, &jobmap_p);
}
}
MPI_Comm_rank(MPI_COMM_CODES, &rank);
MPI_Comm_size(MPI_COMM_CODES, &nprocs);
......
......@@ -14,6 +14,7 @@
#include "dumpi/libundumpi/libundumpi.h"
#include "codes/codes-workload.h"
#include "codes/quickhash.h"
#include "codes/codes-jobmap.h"
#include "codes/model-net.h"
#if ENABLE_CORTEX
......@@ -39,6 +40,9 @@
#define DUMPI_IGNORE_DELAY 100
#define RANK_HASH_TABLE_SIZE 400
/* This variable is defined in src/network-workloads/model-net-mpi-replay.c */
extern struct codes_jobmap_ctx *jobmap_ctx;
static struct qhash_table *rank_tbl = NULL;
static int rank_tbl_pop = 0;
......@@ -653,8 +657,21 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank)
profile = cortex_undumpi_open(file_name, app_id, dumpi_params->num_net_traces, rank);
}
// TODO: call cortex_placement_set (from cortex/placement.h) to set the compute node id of
// each rank of the application
{ int i;
for(i=0; i < dumpi_params->num_net_traces; i++) {
struct codes_jobmap_id id = {
.job = app_id,
.rank = i
};
uint32_t cn_id;
if(jobmap_ctx) {
cn_id = codes_jobmap_to_global_id(id, jobmap_ctx);
} else {
cn_id = i;
}
cortex_placement_set(profile, i, cn_id);
}
}
cortex_topology_set(profile,&model_net_topology);
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment