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
Caitlin Ross
codes
Commits
5509f22e
Commit
5509f22e
authored
Mar 24, 2015
by
Elsa Gonsiorowski (Uranus)
Browse files
compiling for C++
parent
8dce9c05
Changes
18
Hide whitespace changes
Inline
Side-by-side
codes/CodesIOKernelTypes.h
View file @
5509f22e
...
...
@@ -70,8 +70,8 @@ extern int64_t * var;
extern
int
*
inst_ready
;
extern
int
*
group_rank
;
extern
int
*
group_size
;
int
temp_group_rank
;
int
temp_group_size
;
extern
int
temp_group_rank
;
extern
int
temp_group_size
;
#endif
/*
...
...
codes/quickhash.h
View file @
5509f22e
...
...
@@ -332,7 +332,7 @@ static inline int quickhash_string_hash(void *k, int table_size)
/* used for cases where we the key is already in good shape for hashing */
static
inline
int
quickhash_null32_hash
(
void
*
k
,
int
table_size
)
{
uint32_t
*
tmp
=
k
;
uint32_t
*
tmp
=
(
uint32_t
*
)
k
;
return
(
int
)(
*
tmp
&
(
table_size
-
1
));
}
...
...
src/iokernellang/CodesKernelHelpers.c
View file @
5509f22e
...
...
@@ -223,7 +223,7 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
do
{
c
->
locval
=
CodesIOKernel_get_lloc
(
*
((
yyscan_t
*
)
c
->
scanner_
));
yychar
=
CodesIOKernel_lex
(
c
->
lval
,
c
->
locval
,
c
->
scanner_
);
yychar
=
CodesIOKernel_lex
(
(
codesYYType
*
)
c
->
lval
,
(
YYLTYPE
*
)
c
->
locval
,
c
->
scanner_
);
c
->
locval
=
NULL
;
/* for each instructions */
...
...
@@ -242,14 +242,14 @@ int codes_kernel_helper_parse_input(CodesIOKernel_pstate * ps, CodesIOKernelCont
case
DELETE
:
{
c
->
inst_ready
=
0
;
status
=
CodesIOKernel_push_parse
(
ps
,
yychar
,
c
->
lval
,
c
->
locval
,
c
);
status
=
CodesIOKernel_push_parse
(
ps
,
yychar
,
(
codesYYType
*
)
c
->
lval
,
(
YYLTYPE
*
)
c
->
locval
,
c
);
codes_inst
=
convertKLInstToEvent
(
yychar
);
break
;
}
/* not a simulator event */
default:
{
status
=
CodesIOKernel_push_parse
(
ps
,
yychar
,
c
->
lval
,
c
->
locval
,
c
);
status
=
CodesIOKernel_push_parse
(
ps
,
yychar
,
(
codesYYType
*
)
c
->
lval
,
(
YYLTYPE
*
)
c
->
locval
,
c
);
break
;
}
};
...
...
src/iokernellang/codesparser.c
View file @
5509f22e
...
...
@@ -99,7 +99,8 @@ int64_t * var = NULL;
int
*
inst_ready
=
NULL
;
int
*
group_rank
=
NULL
;
int
*
group_size
=
NULL
;
int
temp_group_rank
=
0
;
int
temp_group_size
=
0
;
/* Line 268 of yacc.c */
#line 106 "src/iokernellang/codesparser.c"
...
...
@@ -2422,7 +2423,7 @@ nodeType * con(int64_t value)
/* allocate node */
nodeSize
=
SIZEOF_NODETYPE
+
sizeof
(
conNodeType
);
if
((
p
=
malloc
(
nodeSize
))
==
NULL
)
if
((
p
=
(
nodeType
*
)
malloc
(
nodeSize
))
==
NULL
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
}
...
...
@@ -2441,7 +2442,7 @@ nodeType * id(int64_t i)
/* allocate node */
nodeSize
=
SIZEOF_NODETYPE
+
sizeof
(
idNodeType
);
if
((
p
=
malloc
(
nodeSize
))
==
NULL
)
if
((
p
=
(
nodeType
*
)
malloc
(
nodeSize
))
==
NULL
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
}
...
...
@@ -2464,7 +2465,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...)
nodeSize
=
SIZEOF_NODETYPE
+
sizeof
(
oprNodeType
)
+
(
nops
-
1
)
*
sizeof
(
nodeType
*
);
if
((
p
=
malloc
(
nodeSize
))
==
NULL
)
if
((
p
=
(
nodeType
*
)
malloc
(
nodeSize
))
==
NULL
)
{
fprintf
(
stderr
,
"out of memory
\n
"
);
}
...
...
src/iokernellang/codesparser.y.in
View file @
5509f22e
...
...
@@ -25,6 +25,8 @@ int64_t * var = NULL;
int * inst_ready = NULL;
int * group_rank = NULL;
int * group_size = NULL;
int temp_group_size = 0;
int temp_group_rank = 0;
%}
/* start autogenerated code from CODES build system */
...
...
@@ -151,7 +153,7 @@ nodeType * con(int64_t value)
/* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType);
if((p = malloc(nodeSize)) == NULL)
if((p =
(nodeType*)
malloc(nodeSize)) == NULL)
{
fprintf(stderr, "out of memory\n");
}
...
...
@@ -170,7 +172,7 @@ nodeType * id(int64_t i)
/* allocate node */
nodeSize = SIZEOF_NODETYPE + sizeof(idNodeType);
if((p = malloc(nodeSize)) == NULL)
if((p =
(nodeType*)
malloc(nodeSize)) == NULL)
{
fprintf(stderr, "out of memory\n");
}
...
...
@@ -193,7 +195,7 @@ nodeType * opr(int64_t oper, int64_t nops, ...)
nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) +
(nops - 1) * sizeof(nodeType*);
if ((p = malloc(nodeSize)) == NULL)
if ((p =
(nodeType*)
malloc(nodeSize)) == NULL)
{
fprintf(stderr, "out of memory\n");
}
...
...
src/modelconfig/configparser.y
View file @
5509f22e
...
...
@@ -124,7 +124,7 @@ multikeyentry : multikeynonzero multikeyentry | ;
multikeyinit : /* empty */ {
param->maxsize = 1000;
param->count = 0;
param->keyvals = malloc (sizeof(char*)*param->maxsize);
param->keyvals =
(char**)
malloc (sizeof(char*)*param->maxsize);
}
multikeystart : LITERAL_STRING {
...
...
src/modelconfig/configstore.c
View file @
5509f22e
...
...
@@ -31,7 +31,7 @@ struct mcs_entry
static
inline
mcs_entry
*
mcs_allocentry
()
{
mcs_entry
*
n
=
malloc
(
sizeof
(
mcs_entry
));
mcs_entry
*
n
=
(
mcs_entry
*
)
malloc
(
sizeof
(
mcs_entry
));
memset
(
n
,
0
,
sizeof
(
mcs_entry
));
return
n
;
}
...
...
src/modelconfig/configstoreadapter.c
View file @
5509f22e
...
...
@@ -86,7 +86,7 @@ static int cfsa_getMultiKey (void * handle, SectionHandle section, const char *n
if
(
count
<
0
)
return
-
2
;
*
buf
=
malloc
(
sizeof
(
char
**
)
*
count
);
*
buf
=
(
char
**
)
malloc
(
sizeof
(
char
**
)
*
count
);
dcount
=
count
;
mcs_getvaluemultiple
(
key
,
*
buf
,
&
dcount
);
*
e
=
dcount
;
...
...
@@ -106,7 +106,7 @@ static int cfsa_listSection (void * handle, SectionHandle section,
section
=
handle
;
count
=
mcs_childcount
(
section
);
count
=
mcs_childcount
(
(
mcs_entry
*
)
section
);
if
(
count
<
0
)
{
*
maxentries
=
0
;
...
...
@@ -122,9 +122,9 @@ static int cfsa_listSection (void * handle, SectionHandle section,
ret
=
count
;
out
=
malloc
(
sizeof
(
mcs_section_entry
)
*
*
maxentries
);
out
=
(
mcs_section_entry
*
)
malloc
(
sizeof
(
mcs_section_entry
)
*
*
maxentries
);
count
=
mcs_listsection
(
section
,
out
,
*
maxentries
);
count
=
mcs_listsection
(
(
mcs_entry
*
)
section
,
(
mcs_section_entry
*
)
out
,
*
maxentries
);
if
(
count
<
0
)
{
*
maxentries
=
0
;
...
...
@@ -217,7 +217,7 @@ static ConfigVTable cfsa_template = {
ConfigHandle
cfsa_create
(
mcs_entry
*
e
)
{
ConfigHandle
newh
=
malloc
(
sizeof
(
ConfigVTable
));
ConfigHandle
newh
=
(
ConfigHandle
)
malloc
(
sizeof
(
ConfigVTable
));
*
newh
=
cfsa_template
;
newh
->
data
=
e
;
return
newh
;
...
...
src/modelconfig/txt_configfile.c
View file @
5509f22e
...
...
@@ -105,7 +105,7 @@ static int dump_section (FILE * f, ConfigHandle h, SectionHandle s, unsigned
count
=
sectionsize
;
entries
=
malloc
(
sizeof
(
SectionEntry
)
*
sectionsize
);
entries
=
(
SectionEntry
*
)
malloc
(
sizeof
(
SectionEntry
)
*
sectionsize
);
ret
=
mymin
(
ret
,
cf_listSection
(
h
,
s
,
&
entries
[
0
],
&
count
));
...
...
@@ -174,7 +174,7 @@ ConfigHandle txtfile_openStream (FILE * f, char ** err)
cfgp_lex_init_extra
(
&
p
,
&
scanner
);
cfgp_set_in
(
f
,
scanner
);
cfgp_initparams
(
&
p
,
cfsa_create
(
mcs_initroot
()));
reject
=
cfgp_parse
(
scanner
,
&
p
);
reject
=
cfgp_parse
(
(
yyscan_t
*
)
scanner
,
&
p
);
cfgp_lex_destroy
(
scanner
);
/* either we have a valid confighandle or we have a parser error... */
...
...
src/util/configuration.c
View file @
5509f22e
...
...
@@ -40,7 +40,7 @@ int configuration_load (const char *filepath,
rc
=
MPI_File_get_size
(
fh
,
&
txtsize
);
if
(
rc
!=
MPI_SUCCESS
)
goto
finalize
;
txtdata
=
malloc
(
txtsize
);
txtdata
=
(
char
*
)
malloc
(
txtsize
);
assert
(
txtdata
);
rc
=
MPI_File_read_all
(
fh
,
txtdata
,
txtsize
,
MPI_BYTE
,
&
status
);
...
...
@@ -122,7 +122,7 @@ int configuration_get_value_relpath(
const
char
*
annotation
,
char
*
value
,
size_t
length
){
char
*
tmp
=
malloc
(
length
);
char
*
tmp
=
(
char
*
)
malloc
(
length
);
int
w
=
configuration_get_value
(
handle
,
section_name
,
key_name
,
annotation
,
tmp
,
length
);
...
...
src/util/local-storage-model.c
View file @
5509f22e
...
...
@@ -313,9 +313,9 @@ tw_event* lsm_event_new(const char* category,
delta
+=
tmp
;
}
e
=
codes_event_new
(
lsm_gid
,
delta
,
sender
);
m
=
tw_event_data
(
e
);
m
=
(
lsm_message_t
*
)
tw_event_data
(
e
);
m
->
magic
=
lsm_magic
;
m
->
event
=
io_type
;
m
->
event
=
(
lsm_event_t
)
io_type
;
m
->
u
.
data
.
object
=
io_object
;
m
->
u
.
data
.
offset
=
io_offset
;
m
->
u
.
data
.
size
=
io_size_bytes
;
...
...
@@ -540,7 +540,7 @@ static void handle_io_request(lsm_state_t *ns,
ns
->
current_object
=
m_in
->
u
.
data
.
object
;
e
=
codes_event_new
(
lp
->
gid
,
queue_time
,
lp
);
m_out
=
tw_event_data
(
e
);
m_out
=
(
lsm_message_t
*
)
tw_event_data
(
e
);
memcpy
(
m_out
,
m_in
,
sizeof
(
*
m_in
)
+
m_in
->
wrap
.
size
);
if
(
m_out
->
event
==
LSM_WRITE_REQUEST
)
...
...
@@ -693,7 +693,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"request_sizes"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
request_sizes
=
malloc
(
sizeof
(
int
)
*
length
);
model
->
request_sizes
=
(
unsigned
int
*
)
malloc
(
sizeof
(
int
)
*
length
);
assert
(
model
->
request_sizes
);
model
->
bins
=
length
;
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -706,7 +706,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"write_rates"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
write_rates
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
write_rates
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
write_rates
);
assert
(
length
==
model
->
bins
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -719,7 +719,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"read_rates"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
read_rates
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
read_rates
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
read_rates
);
assert
(
model
->
bins
==
length
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -732,7 +732,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"write_overheads"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
write_overheads
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
write_overheads
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
write_overheads
);
assert
(
model
->
bins
==
length
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -745,7 +745,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"read_overheads"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
read_overheads
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
read_overheads
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
read_overheads
);
assert
(
model
->
bins
==
length
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -758,7 +758,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"write_seeks"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
write_seeks
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
write_seeks
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
write_seeks
);
assert
(
model
->
bins
==
length
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -771,7 +771,7 @@ static void read_config(ConfigHandle *ch, char * anno, disk_model_t *model)
rc
=
configuration_get_multivalue
(
ch
,
LSM_NAME
,
"read_seeks"
,
anno
,
&
values
,
&
length
);
assert
(
rc
==
1
);
model
->
read_seeks
=
malloc
(
sizeof
(
double
)
*
length
);
model
->
read_seeks
=
(
double
*
)
malloc
(
sizeof
(
double
)
*
length
);
assert
(
model
->
read_seeks
);
assert
(
model
->
bins
==
length
);
for
(
int
i
=
0
;
i
<
length
;
i
++
)
...
...
@@ -790,7 +790,7 @@ void lsm_configure(void)
anno_map
=
codes_mapping_get_lp_anno_map
(
LSM_NAME
);
assert
(
anno_map
);
models_anno
=
malloc
(
anno_map
->
num_annos
*
sizeof
(
*
models_anno
));
models_anno
=
(
disk_model_t
*
)
malloc
(
anno_map
->
num_annos
*
sizeof
(
*
models_anno
));
// read the configuration for unannotated entries
if
(
anno_map
->
has_unanno_lp
>
0
){
...
...
src/util/lp-io.c
View file @
5509f22e
...
...
@@ -48,7 +48,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
return
(
-
1
);
}
buf
=
malloc
(
sizeof
(
*
buf
));
buf
=
(
io_buffer
*
)
malloc
(
sizeof
(
*
buf
));
if
(
!
buf
)
return
(
-
1
);
...
...
@@ -80,7 +80,7 @@ int lp_io_write(tw_lpid gid, char* identifier, int size, void* buffer)
else
{
/* new identifier */
id
=
malloc
(
sizeof
(
*
id
));
id
=
(
struct
identifier
*
)
malloc
(
sizeof
(
*
id
));
if
(
!
id
)
{
free
(
buf
->
buffer
);
...
...
@@ -172,7 +172,7 @@ int lp_io_prepare(char *directory, int flags, lp_io_handle* handle, MPI_Comm com
if
(
flags
&
LP_IO_UNIQ_SUFFIX
)
{
*
handle
=
malloc
(
256
);
*
handle
=
(
lp_io_handle
)
malloc
(
256
);
if
(
!
(
*
handle
))
{
return
(
-
1
);
...
...
@@ -352,9 +352,9 @@ static int write_id(char* directory, char* identifier, MPI_Comm comm)
/* build datatype for our buffers */
if
(
id
)
{
lengths
=
malloc
(
id
->
buffers_count
*
sizeof
(
int
));
lengths
=
(
int
*
)
malloc
(
id
->
buffers_count
*
sizeof
(
int
));
assert
(
lengths
);
displacements
=
malloc
(
id
->
buffers_count
*
sizeof
(
MPI_Aint
));
displacements
=
(
MPI_Aint
*
)
malloc
(
id
->
buffers_count
*
sizeof
(
MPI_Aint
));
assert
(
displacements
);
/* NOTE: some versions of MPI-IO have a bug related to using
...
...
src/util/rc-stack.c
View file @
5509f22e
...
...
@@ -21,7 +21,7 @@ struct rc_stack {
};
void
rc_stack_create
(
struct
rc_stack
**
s
){
struct
rc_stack
*
ss
=
malloc
(
sizeof
(
*
ss
));
struct
rc_stack
*
ss
=
(
struct
rc_stack
*
)
malloc
(
sizeof
(
*
ss
));
if
(
ss
)
{
INIT_QLIST_HEAD
(
&
ss
->
head
);
ss
->
count
=
0
;
...
...
@@ -54,7 +54,7 @@ void rc_stack_push(
tw_lp
*
lp
,
void
*
data
,
struct
rc_stack
*
s
){
rc_entry
*
ent
=
malloc
(
sizeof
(
*
ent
));
rc_entry
*
ent
=
(
rc_entry
*
)
malloc
(
sizeof
(
*
ent
));
assert
(
ent
);
ent
->
time
=
tw_now
(
lp
);
ent
->
data
=
data
;
...
...
src/util/resource-lp.c
View file @
5509f22e
...
...
@@ -212,7 +212,7 @@ static void handle_resource_get(
if
(
m
->
i
.
block_on_unavail
){
/* queue up operation, save til later */
b
->
c0
=
1
;
pending_op
*
op
=
malloc
(
sizeof
(
pending_op
));
pending_op
*
op
=
(
pending_op
*
)
malloc
(
sizeof
(
pending_op
));
op
->
m
=
m
->
i
;
/* no need to set rc msg here */
qlist_add_tail
(
&
op
->
ql
,
&
ns
->
pending
[
m
->
i
.
tok
]);
send_ack
=
0
;
...
...
@@ -258,7 +258,7 @@ static void handle_resource_free(
assert
(
!
resource_free
(
m
->
i
.
req
,
m
->
i
.
tok
,
&
ns
->
r
));
/* create an event to pop the next queue item */
tw_event
*
e
=
codes_event_new
(
lp
->
gid
,
codes_local_latency
(
lp
),
lp
);
resource_msg
*
m_deq
=
tw_event_data
(
e
);
resource_msg
*
m_deq
=
(
resource_msg
*
)
tw_event_data
(
e
);
msg_set_header
(
resource_magic
,
RESOURCE_DEQ
,
lp
->
gid
,
&
m_deq
->
i
.
h
);
m_deq
->
i
.
tok
=
m
->
i
.
tok
;
/* only tok is needed, all others grabbed from q */
tw_event_send
(
e
);
...
...
@@ -300,7 +300,7 @@ static void handle_resource_deq(
free
(
p
);
/* additionally attempt to dequeue next one down */
tw_event
*
e
=
codes_event_new
(
lp
->
gid
,
codes_local_latency
(
lp
),
lp
);
resource_msg
*
m_deq
=
tw_event_data
(
e
);
resource_msg
*
m_deq
=
(
resource_msg
*
)
tw_event_data
(
e
);
msg_set_header
(
resource_magic
,
RESOURCE_DEQ
,
lp
->
gid
,
&
m_deq
->
i
.
h
);
/* only tok is needed, all others grabbed from q */
m_deq
->
i
.
tok
=
m
->
i
.
tok
;
...
...
@@ -322,7 +322,7 @@ static void handle_resource_deq_rc(
if
(
b
->
c1
){
/* add operation back to the front of the queue */
pending_op
*
op
=
malloc
(
sizeof
(
pending_op
));
pending_op
*
op
=
(
pending_op
*
)
malloc
(
sizeof
(
pending_op
));
op
->
m
=
m
->
i_rc
;
qlist_add
(
&
op
->
ql
,
&
ns
->
pending
[
m
->
i
.
tok
]);
resource_response_rc
(
lp
);
...
...
@@ -414,7 +414,7 @@ void resource_finalize(
}
}
char
*
out_buf
=
malloc
(
1
<<
12
);
char
*
out_buf
=
(
char
*
)
malloc
(
1
<<
12
);
int
written
;
// see if I'm the "first" resource (currently doing it globally)
if
(
codes_mapping_get_lp_relative_id
(
lp
->
gid
,
0
,
0
)
==
0
){
...
...
@@ -449,7 +449,7 @@ void resource_lp_configure(){
anno_map
=
codes_mapping_get_lp_anno_map
(
RESOURCE_LP_NM
);
avail_per_anno
=
(
anno_map
->
num_annos
>
0
)
?
malloc
(
anno_map
->
num_annos
*
sizeof
(
*
avail_per_anno
))
:
(
uint64_t
*
)
malloc
(
anno_map
->
num_annos
*
sizeof
(
*
avail_per_anno
))
:
NULL
;
// get the unannotated version
long
int
avail
;
...
...
@@ -511,7 +511,7 @@ static void resource_lp_issue_event(
sender
);
/* set message info */
resource_msg
*
m
=
tw_event_data
(
e
);
resource_msg
*
m
=
(
resource_msg
*
)
tw_event_data
(
e
);
msg_set_header
(
resource_magic
,
type
,
sender
->
gid
,
&
m
->
i
.
h
);
m
->
i
.
req
=
req
;
m
->
i
.
tok
=
tok
;
...
...
src/workload/codes-workload.c
View file @
5509f22e
...
...
@@ -96,7 +96,7 @@ int codes_workload_load(const char* type, const char* params, int rank)
}
if
(
tmp
==
NULL
)
{
tmp
=
malloc
(
sizeof
(
*
tmp
));
tmp
=
(
rank_queue
*
)
malloc
(
sizeof
(
*
tmp
));
assert
(
tmp
);
tmp
->
rank
=
rank
;
tmp
->
lifo
=
NULL
;
...
...
@@ -160,7 +160,7 @@ void codes_workload_get_next_rc(int wkld_id, int rank, const struct codes_worklo
}
assert
(
tmp
);
tmp_op
=
malloc
(
sizeof
(
*
tmp_op
));
tmp_op
=
(
struct
rc_op
*
)
malloc
(
sizeof
(
*
tmp_op
));
assert
(
tmp_op
);
tmp_op
->
op
=
*
op
;
tmp_op
->
next
=
tmp
->
lifo
;
...
...
src/workload/methods/codes-bgp-io-wrkld.c
View file @
5509f22e
...
...
@@ -75,7 +75,7 @@ int bgp_io_workload_load(const char* params, int rank)
return
-
1
;
}
}
wrkld_per_rank
=
malloc
(
sizeof
(
*
wrkld_per_rank
));
wrkld_per_rank
=
(
codes_bgp_wrkld_state_per_rank
*
)
malloc
(
sizeof
(
*
wrkld_per_rank
));
if
(
!
wrkld_per_rank
)
return
-
1
;
...
...
@@ -142,7 +142,7 @@ void bgp_io_workload_get_next(int rank, struct codes_workload_op *op)
next_wrkld
=
qhash_entry
(
hash_link
,
struct
codes_bgp_wrkld_state_per_rank
,
hash_link
);
int
type
=
codes_kernel_helper_parse_input
(
next_wrkld
->
codes_pstate
,
&
(
next_wrkld
->
codes_context
),
&
(
next_wrkld
->
next_event
));
op
->
op_type
=
convertTypes
(
type
);
op
->
op_type
=
(
codes_workload_op_type
)
convertTypes
(
type
);
switch
(
op
->
op_type
)
{
case
CODES_WK_WRITE
:
...
...
src/workload/methods/codes-recorder-io-wrkld.c
View file @
5509f22e
...
...
@@ -76,7 +76,7 @@ static int rank_tbl_pop = 0;
static
int
recorder_io_workload_load
(
const
char
*
params
,
int
rank
)
{
recorder_params
*
r_params
=
(
recorder_params
*
)
params
;
struct
rank_traces_context
*
new
=
NULL
;
struct
rank_traces_context
*
new
v
=
NULL
;
struct
qhash_table
*
file_id_tbl
=
NULL
;
struct
qhash_head
*
link
=
NULL
;
struct
file_entry
*
file
;
...
...
@@ -87,13 +87,13 @@ static int recorder_io_workload_load(const char *params, int rank)
return
-
1
;
/* allocate a new trace context for this rank */
new
=
malloc
(
sizeof
(
*
new
));
if
(
!
new
)
new
v
=
(
struct
rank_traces_context
*
)
malloc
(
sizeof
(
*
new
v
));
if
(
!
new
v
)
return
-
1
;
new
->
rank
=
rank
;
new
->
trace_list_ndx
=
0
;
new
->
trace_list_max
=
0
;
new
v
->
rank
=
rank
;
new
v
->
trace_list_ndx
=
0
;
new
v
->
trace_list_max
=
0
;
#if 0
DIR *dirp;
...
...
@@ -149,8 +149,8 @@ static int recorder_io_workload_load(const char *params, int rank)
r_op
.
codes_op
.
u
.
barrier
.
count
=
nprocs
;
r_op
.
codes_op
.
u
.
barrier
.
root
=
0
;
new
->
trace_ops
[
new
->
trace_list_ndx
++
]
=
r_op
;
if
(
new
->
trace_list_ndx
==
2048
)
break
;
new
v
->
trace_ops
[
new
v
->
trace_list_ndx
++
]
=
r_op
;
if
(
new
v
->
trace_list_ndx
==
2048
)
break
;
}
token
=
strtok
(
NULL
,
", )"
);
...
...
@@ -165,15 +165,15 @@ static int recorder_io_workload_load(const char *params, int rank)
file_id_tbl
=
qhash_init
(
hash_file_compare
,
quickhash_32bit_hash
,
11
);
if
(
!
file_id_tbl
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
}
file
=
malloc
(
sizeof
(
struct
file_entry
));
file
=
(
struct
file_entry
*
)
malloc
(
sizeof
(
struct
file_entry
));
if
(
!
file
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
...
...
@@ -200,7 +200,7 @@ static int recorder_io_workload_load(const char *params, int rank)
link
=
qhash_search
(
file_id_tbl
,
&
fd
);
if
(
!
link
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
...
...
@@ -240,7 +240,7 @@ static int recorder_io_workload_load(const char *params, int rank)
link
=
qhash_search
(
file_id_tbl
,
&
fd
);
if
(
!
link
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
...
...
@@ -277,7 +277,7 @@ static int recorder_io_workload_load(const char *params, int rank)
link
=
qhash_search
(
file_id_tbl
,
&
fd
);
if
(
!
link
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
...
...
@@ -293,7 +293,7 @@ static int recorder_io_workload_load(const char *params, int rank)
}
else
if
(
!
strcmp
(
function_name
,
"0"
))
{
token
=
strtok
(
NULL
,
",
\n
"
);
new
->
trace_ops
[
new
->
trace_list_ndx
-
1
].
end_time
+=
atof
(
token
);
new
v
->
trace_ops
[
new
v
->
trace_list_ndx
-
1
].
end_time
+=
atof
(
token
);
io_start_time
=
0
.
0
;
continue
;
...
...
@@ -306,8 +306,8 @@ static int recorder_io_workload_load(const char *params, int rank)
continue
;
}
new
->
trace_ops
[
new
->
trace_list_ndx
++
]
=
r_op
;
if
(
new
->
trace_list_ndx
==
2048
)
break
;
new
v
->
trace_ops
[
new
v
->
trace_list_ndx
++
]
=
r_op
;
if
(
new
v
->
trace_list_ndx
==
2048
)
break
;
}
fclose
(
trace_file
);
...
...
@@ -315,22 +315,22 @@ static int recorder_io_workload_load(const char *params, int rank)
/* reset ndx to 0 and set max to event count */
/* now we can read all events by counting through array from 0 - max */
new
->
trace_list_max
=
new
->
trace_list_ndx
;
new
->
trace_list_ndx
=
0
;
new
->
last_op_time
=
0
.
0
;
new
v
->
trace_list_max
=
new
v
->
trace_list_ndx
;
new
v
->
trace_list_ndx
=
0
;
new
v
->
last_op_time
=
0
.
0
;
/* initialize the hash table of rank contexts, if it has not been initialized */
if
(
!
rank_tbl
)
{
rank_tbl
=
qhash_init
(
hash_rank_compare
,
quickhash_32bit_hash
,
RANK_HASH_TABLE_SIZE
);
if
(
!
rank_tbl
)
{
free
(
new
);
free
(
new
v
);
return
-
1
;
}
}
/* add this rank context to the hash table */
qhash_add
(
rank_tbl
,
&
(
new
->
rank
),
&
(
new
->
hash_link
));
qhash_add
(
rank_tbl
,
&
(
new
v
->
rank
),
&
(
new
v
->
hash_link
));
rank_tbl_pop
++
;
return
0
;
...
...
src/workload/methods/test-workload-method.c
View file @
5509f22e
...
...
@@ -43,13 +43,13 @@ static int test_workload_load(const char* params, int rank)
/* no params in this case; this example will work with any number of
* ranks
*/
struct
wkload_stream_state
*
new
;
struct
wkload_stream_state
*
new
v
;
new
=
malloc
(
sizeof
(
*
new
));
if
(
!
new
)
new
v
=
(
wkload_stream_state
*
)
malloc
(
sizeof
(
*
new
v
));
if
(
!
new
v
)
return
(
-
1
);
new
->
rank
=
rank
;