Commit 241264b9 authored by Misbah Mubarak's avatar Misbah Mubarak

removing duplicate files, fixing minor merge bug

parent 59db60d9
/*
* Copyright (C) 2013 University of Chicago.
* See COPYRIGHT notice in top-level directory.
*
*/
#ifndef CODES_NW_WORKLOAD_H
#define CODES_NW_WORKLOAD_H
#include "ross.h"
#define MAX_LENGTH 512
#define MAX_REQUESTS 128
/* struct to hold the actual data from a single MPI event*/
typedef struct mpi_event_list mpi_event_list;
typedef struct scala_trace_params scala_trace_params;
typedef struct dumpi_trace_params dumpi_trace_params;
struct scala_trace_params
{
char offset_file_name[MAX_LENGTH];
char nw_wrkld_file_name[MAX_LENGTH];
};
struct dumpi_trace_params
{
int num_net_traces;
char file_name[MAX_LENGTH];
};
enum NW_WORKLOADS
{
SCALA_TRACE = 1,
#ifdef USE_DUMPI
DUMPI,
#endif
OTHERS, /* add the names of other workload generators here */
};
enum mpi_workload_type
{
/* sleep/delay to simulate computation or other activity */
CODES_NW_DELAY = 1,
/* MPI wait all operation */
CODES_NW_WAITALL,
/* MPI Wait operation */
CODES_NW_WAIT,
/* MPI Waitsome operation */
CODES_NW_WAITSOME,
/* MPI Waitany operation */
CODES_NW_WAITANY,
/* terminator; there are no more operations for this rank */
CODES_NW_END,
/* MPI blocking send operation */
CODES_NW_SEND,
/* MPI blocking recv operation */
CODES_NW_RECV,
/* MPI non-blocking send operation */
CODES_NW_ISEND,
/* MPI non-blocking receive operation */
CODES_NW_IRECV,
/* MPI broadcast operation */
CODES_NW_BCAST,
/* MPI Allgather operation */
CODES_NW_ALLGATHER,
/* MPI Allgatherv operation */
CODES_NW_ALLGATHERV,
/* MPI Alltoall operation */
CODES_NW_ALLTOALL,
/* MPI Alltoallv operation */
CODES_NW_ALLTOALLV,
/* MPI Reduce operation */
CODES_NW_REDUCE,
/* MPI Allreduce operation */
CODES_NW_ALLREDUCE,
/* MPI test all operation */
CODES_NW_TESTALL,
/* MPI test operation */
CODES_NW_TEST,
/* Generic collective operation */
CODES_NW_COL,
};
/* data structure for holding data from a MPI event (coming through scala-trace)
* can be a delay, isend, irecv or a collective call */
struct mpi_event_list
{
/* what type of operation this is */
enum mpi_workload_type op_type;
double start_time;
double end_time;
double sim_start_time;
/* parameters for each operation type */
union
{
struct
{
double nsecs;
double seconds;
} delay;
struct
{
int source_rank;/* source rank of MPI send message */
int dest_rank; /* dest rank of MPI send message */
int num_bytes; /* number of bytes to be transferred over the network */
short 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 */
int16_t req_id;
} send;
struct
{
int source_rank;/* source rank of MPI recv message */
int dest_rank;/* dest rank of MPI recv message */
int num_bytes; /* number of bytes to be transferred over the network */
short 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 */
int16_t req_id;
} recv;
struct
{
int num_bytes;
} collective;
struct
{
int count;
int16_t* req_ids;
} waits;
struct
{
int16_t req_id;
} wait;
}u;
};
/* read in the metadata file about the MPI event information
and populate the MPI events array */
int codes_nw_workload_load(const char* type_name, const char* params, int rank);
/* retrieves the next network operation to execute. the wkld_id is the
identifier returned by the init() function. The op argument is a pointer
to a structure to be filled in with network operation information */
void codes_nw_workload_get_next(int wkld_id, int rank, struct mpi_event_list *op);
/* Reverse of the above function */
void codes_nw_workload_get_next_rc(int wkld_id, int rank, const struct mpi_event_list* op);
void codes_nw_workload_print_op(FILE* f, struct mpi_event_list* op, int rank);
#endif /* CODES_NW_WORKLOAD_H */
/*
* Local variables:
* c-indent-level: 4
* c-basic-offset: 4
* End:
*
* vim: ft=c ts=8 sts=4 sw=4 expandtab
*/
......@@ -17,10 +17,10 @@
#include "src/workload/codes-workload-method.h"
#include "codes/quickhash.h"
#define RANK_HASH_TABLE_SIZE 400
#define MAX_LENGTH 512
#define MAX_OPERATIONS 32768
#define DUMPI_IGNORE_DELAY 100
#define RANK_HASH_TABLE_SIZE 400
static struct qhash_table *rank_tbl = NULL;
static int rank_tbl_pop = 0;
......@@ -171,7 +171,7 @@ int handleDUMPIWait(const dumpi_wait *prm, uint16_t thread,
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct codes_workload_op wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_WAIT;
wrkld_per_rank.op_type = CODES_WK_WAIT;
wrkld_per_rank.u.wait.req_id = prm->request;
wrkld_per_rank.start_time = cpu->start.nsec;
wrkld_per_rank.end_time = cpu->stop.nsec;
......@@ -189,7 +189,7 @@ int handleDUMPIWaitsome(const dumpi_waitsome *prm, uint16_t thread,
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct codes_workload_op wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_WAITSOME;
wrkld_per_rank.op_type = CODES_WK_WAITSOME;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int16_t*)malloc(prm->count * sizeof(int16_t));
......@@ -213,7 +213,7 @@ int handleDUMPIWaitany(const dumpi_waitany *prm, uint16_t thread,
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct codes_workload_op wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_WAITANY;
wrkld_per_rank.op_type = CODES_WK_WAITANY;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int16_t*)malloc(prm->count * sizeof(int16_t));
......@@ -236,7 +236,7 @@ int handleDUMPIWaitall(const dumpi_waitall *prm, uint16_t thread,
rank_mpi_context* myctx = (rank_mpi_context*)userarg;
struct codes_workload_op wrkld_per_rank;
wrkld_per_rank.op_type = CODES_NW_WAITALL;
wrkld_per_rank.op_type = CODES_WK_WAITALL;
wrkld_per_rank.u.waits.count = prm->count;
wrkld_per_rank.u.waits.req_ids = (int16_t*)malloc(prm->count * sizeof(int16_t));
......@@ -512,7 +512,7 @@ int dumpi_trace_nw_workload_load(const char* params, int rank)
if(!rank_tbl)
{
rank_tbl = qhash_init(hash_rank_compare, quickhash_64bit_hash, RANK_HASH_TABLE_SIZE);
rank_tbl = qhash_init(hash_rank_compare, quickhash_32bit_hash, RANK_HASH_TABLE_SIZE);
if(!rank_tbl)
return -1;
}
......@@ -689,6 +689,7 @@ void dumpi_trace_nw_workload_get_next(int rank, struct codes_workload_op *op)
hash_link = qhash_search(rank_tbl, &rank);
if(!hash_link)
{
printf("\n not found for rank id %d ", rank);
op->op_type = CODES_WK_END;
return;
}
......
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