Commit f2d4cad6 authored by Misbah Mubarak's avatar Misbah Mubarak

Fixing ordering issue with waits (should resolve the unmatched sends/receives...

Fixing ordering issue with waits (should resolve the unmatched sends/receives error with traces like minife)
parent 83bc8e21
......@@ -156,7 +156,7 @@ struct codes_workload_op
*/
/* what type of operation this is */
enum codes_workload_op_type op_type;
int op_type;
/* currently only used by network workloads */
double start_time;
double end_time;
......@@ -198,7 +198,7 @@ struct codes_workload_op
int16_t data_type; /* MPI data type to be matched with the recv */
int count; /* number of elements to be received */
int tag; /* tag of the message */
int32_t req_id;
int req_id;
} send;
struct {
/* TODO: not sure why source rank is here */
......@@ -208,7 +208,7 @@ struct codes_workload_op
int16_t data_type; /* MPI data type to be matched with the send */
int count; /* number of elements to be sent */
int tag; /* tag of the message */
int32_t req_id;
int req_id;
} recv;
/* TODO: non-stub for other collectives */
struct {
......@@ -216,14 +216,14 @@ struct codes_workload_op
} collective;
struct {
int count;
int32_t* req_ids;
int* req_ids;
} waits;
struct {
int32_t req_id;
int req_id;
} wait;
struct
{
int32_t req_id;
int req_id;
}
free;
}u;
......
......@@ -15,6 +15,7 @@
#include "codes/codes-workload.h"
#include "codes/quickhash.h"
#include "codes/codes-jobmap.h"
#include "codes/jenkins-hash.h"
#include "codes/model-net.h"
#if ENABLE_CORTEX
......@@ -108,6 +109,12 @@ static inline double time_to_us_lf(dumpi_clock t){
static inline double time_to_ns_lf(dumpi_clock t){
return (double) t.sec * 1e9 + (double) t.nsec;
}
static int32_t get_unique_req_id(int32_t request_id)
{
uint32_t pc = 0, pb = 0;
bj_hashlittle2(&request_id, sizeof(int32_t), &pc, &pb);
return pc;
}
/*static inline double time_to_s_lf(dumpi_clock t){
return (double) t.sec + (double) t.nsec / 1e9;
}*/
......@@ -340,10 +347,10 @@ int handleDUMPIWaitsome(const dumpi_waitsome *prm, uint16_t thread,
wrkld_per_rank.op_type = CODES_WK_WAITSOME;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int32_t*)malloc(prm->count * sizeof(int32_t));
wrkld_per_rank.u.waits.req_ids = (int*)malloc(prm->count * sizeof(int));
for( i = 0; i < prm->count; i++ )
wrkld_per_rank.u.waits.req_ids[i] = (int32_t)prm->requests[i];
wrkld_per_rank.u.waits.req_ids[i] = prm->requests[i];
update_times_and_insert(&wrkld_per_rank, wall, myctx);
return 0;
......@@ -365,10 +372,10 @@ int handleDUMPIWaitany(const dumpi_waitany *prm, uint16_t thread,
wrkld_per_rank.op_type = CODES_WK_WAITANY;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int32_t*)malloc(prm->count * sizeof(int32_t));
wrkld_per_rank.u.waits.req_ids = (int*)malloc(prm->count * sizeof(int));
for( i = 0; i < prm->count; i++ )
wrkld_per_rank.u.waits.req_ids[i] = (int32_t)prm->requests[i];
wrkld_per_rank.u.waits.req_ids[i] = prm->requests[i];
update_times_and_insert(&wrkld_per_rank, wall, myctx);
return 0;
......@@ -391,7 +398,7 @@ int handleDUMPIWaitall(const dumpi_waitall *prm, uint16_t thread,
wrkld_per_rank.op_type = CODES_WK_WAITALL;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int32_t*)malloc(prm->count * sizeof(int32_t));
wrkld_per_rank.u.waits.req_ids = (int*)malloc(prm->count * sizeof(int));
for( i = 0; i < prm->count; i++ )
wrkld_per_rank.u.waits.req_ids[i] = prm->requests[i];
......
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