Commit b758f3bf authored by Misbah Mubarak's avatar Misbah Mubarak

update to codes-base: adding support for read operations

parent 4c8ccf14
......@@ -29,6 +29,7 @@ enum cl_event_t
CL_GETSIZE=1,
CL_GETRANK,
CL_WRITEAT,
CL_READAT,
CL_OPEN,
CL_CLOSE,
CL_SYNC,
......
......@@ -22,6 +22,8 @@ char * code_kernel_helpers_kinstToStr(int inst)
{
case WRITEAT:
return "WRITEAT";
case READAT:
return "READAT";
case GETGROUPRANK:
return "GETGROUPRANK";
case GETGROUPSIZE:
......@@ -51,6 +53,8 @@ char * code_kernel_helpers_cleventToStr(int inst)
{
case CL_WRITEAT:
return "CL_WRITEAT";
case CL_READAT:
return "CL_READAT";
case CL_GETRANK:
return "CL_GETRANK";
case CL_GETSIZE:
......@@ -80,6 +84,8 @@ static int convertKLInstToEvent(int inst)
{
case WRITEAT:
return CL_WRITEAT;
case READAT:
return CL_READAT;
case GETGROUPRANK:
return CL_GETRANK;
case GETGROUPSIZE:
......@@ -214,6 +220,7 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
{
/* for each instrunction that triggers a simulator event */
case WRITEAT:
case READAT:
case GETGROUPRANK:
case GETGROUPSIZE:
case CLOSE:
......@@ -247,6 +254,7 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
case CL_GETRANK:
case CL_GETSIZE:
case CL_WRITEAT:
case CL_READAT:
case CL_OPEN:
case CL_CLOSE:
case CL_SYNC:
......
......@@ -90,61 +90,31 @@ int bgp_io_workload_load(const char* params, int rank)
/* Maps the enum types from I/O language to the CODES workload API */
static int convertTypes(int inst)
{
int op_type = -1;
switch(inst)
{
case CL_WRITEAT: /* write to file */
{
op_type = CODES_WK_WRITE;
}
break;
return CODES_WK_WRITE;
case CL_READAT:
return CODES_WK_READ;
case CL_CLOSE:
{
op_type = CODES_WK_CLOSE; /* close the file */
}
break;
return CODES_WK_CLOSE; /* close the file */
case CL_OPEN:
{
op_type = CODES_WK_OPEN; /* open file */
}
break;
return CODES_WK_OPEN; /* open file */
case CL_SYNC:
{
op_type = CODES_WK_BARRIER; /* barrier in CODES workload is similar to sync in I/O lang? */
}
break;
return CODES_WK_BARRIER; /* barrier in CODES workload is similar to sync in I/O lang? */
case CL_SLEEP:
{
op_type = CODES_WK_DELAY; /* sleep or delay */
}
break;
return CODES_WK_DELAY; /* sleep or delay */
case CL_EXIT:
{
op_type = CODES_WK_END; /* end of the operations/ no more operations in file */
}
break;
return CODES_WK_END; /* end of the operations/ no more operations in file */
case CL_DELETE:
{
op_type = -2;
}
break;
return -2;
case CL_GETRANK:
{
op_type = -3; /* defined in I/O lang but not in workloads API*/
}
break;
return -3; /* defined in I/O lang but not in workloads API*/
case CL_GETSIZE:
{
op_type = -4; /* defined in I/O lang but not in workload API */
}
break;
return -4; /* defined in I/O lang but not in workload API */
default:
{
//printf("\n convert type undefined %d ", inst);
op_type = -1;
}
}
return op_type;
return -1;
}
}
/* Gets the next operation specified in the workload file for the simulated MPI rank
......@@ -196,7 +166,9 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
break;
case CODES_WK_READ:
{
/* to be added (the BG/P model does not supports read operations right now) */
op->u.read.file_id = (wrkld_arr[local_rank].next_event).var[0];
op->u.read.offset = (wrkld_arr[local_rank].next_event).var[2];
op->u.read.size = (wrkld_arr[local_rank].next_event).var[1];
}
break;
default:
......
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