Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Elsa Gonsiorowski
codes
Commits
b758f3bf
Commit
b758f3bf
authored
Nov 15, 2013
by
Misbah Mubarak
Browse files
update to codes-base: adding support for read operations
parent
4c8ccf14
Changes
3
Hide whitespace changes
Inline
Side-by-side
codes/CodesKernelHelpers.h
View file @
b758f3bf
...
...
@@ -29,6 +29,7 @@ enum cl_event_t
CL_GETSIZE
=
1
,
CL_GETRANK
,
CL_WRITEAT
,
CL_READAT
,
CL_OPEN
,
CL_CLOSE
,
CL_SYNC
,
...
...
src/iokernellang/CodesKernelHelpers.c
View file @
b758f3bf
...
...
@@ -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
:
...
...
src/workload/codes-bgp-io-wrkld.c
View file @
b758f3bf
...
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment