Skip to content
GitLab
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
87cbb32b
Commit
87cbb32b
authored
Jul 15, 2014
by
mubarak
Browse files
Updating network workloads: adding dumpi reader
parent
c551f247
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
87cbb32b
...
...
@@ -47,3 +47,9 @@ if USE_RECORDER
AM_CPPFLAGS
+=
${RECORDER_CPPFLAGS}
src_libcodes_base_a_SOURCES
+=
src/workload/codes-recorder-io-wrkld.c
endif
if
USE_DUMPI
AM_CPPFLAGS
+=
${DUMPI_CFLAGS}
-DUSE_DUMPI
=
1
src_libcodes_base_a_SOURCES
+=
src/network-workload/codes-dumpi-trace-nw-wrkld.c
AM_LIBS
+=
${DUMPI_LIBS}
endif
codes/codes-nw-workload.h
View file @
87cbb32b
...
...
@@ -9,21 +9,35 @@
#include
"ross.h"
#define MAX_NAME_LENGTH
256
#define MAX_NAME_LENGTH
512
/* 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
;
#ifdef USE_DUMPI
typedef
struct
dumpi_trace_params
dumpi_trace_params
;
#endif
struct
scala_trace_params
{
char
offset_file_name
[
MAX_NAME_LENGTH
];
char
nw_wrkld_file_name
[
MAX_NAME_LENGTH
];
};
#ifdef USE_DUMPI
struct
dumpi_trace_params
{
char
file_name
[
MAX_NAME_LENGTH
];
};
#endif
enum
NW_WORKLOADS
{
SCALA_TRACE
=
1
,
#ifdef USE_DUMPI
DUMPI
,
#endif
OTHERS
,
/* add the names of other workload generators here */
};
enum
mpi_workload_type
...
...
@@ -32,10 +46,30 @@ enum mpi_workload_type
CODES_NW_END
=
1
,
/* sleep/delay to simulate computation or other activity */
CODES_NW_DELAY
,
/* MPI send operation */
/* MPI
blocking
send operation */
CODES_NW_SEND
,
/* MPI recv operation */
CODES_NW_RECV
/* 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
,
/* Generic collective operation */
CODES_NW_COL
};
/* data structure for holding data from a MPI event (coming through scala-trace)
...
...
@@ -44,26 +78,35 @@ struct mpi_event_list
{
/* what type of operation this is */
enum
mpi_workload_type
op_type
;
double
start_time
;
double
end_time
;
/* parameters for each operation type */
union
{
struct
{
long
seconds
;
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
;
int
blocking
;
/* boolean value to indicate if message is blocking or non-blocking*/
}
send
;
}
send
;
struct
{
int
source_rank
;
/* source rank of MPI recv message */
int
dest_rank
;
/* dest rank of MPI recv message */
int
num_bytes
;
int
blocking
;
/* boolean value to indicate if message is blocking or non-blocking*/
}
recv
;
}
recv
;
struct
{
int
num_bytes
;
}
collective
;
}
u
;
};
...
...
configure.ac
View file @
87cbb32b
...
...
@@ -112,6 +112,24 @@ AM_CONDITIONAL(USE_RECORDER, true)
RECORDER_CPPFLAGS="-DUSE_RECORDER=1"
AC_SUBST(RECORDER_CPPFLAGS)
#check for Dumpi
AC_ARG_WITH([dumpi],[AS_HELP_STRING([--with-dumpi@<:@=DIR@:>@],
[location of Dumpi installation])])
if test "x${with_dumpi}" != "x" ; then
AC_CHECK_FILE([${with_dumpi}/lib/libundumpi.la],
AM_CONDITIONAL(USE_DUMPI, true),
AC_MSG_ERROR(Could not find libundumpi.la))
DUMPI_CFLAGS="-I${with_dumpi}/include"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/common"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libdumpi"
# DUMPI_CFLAGS+=" -I${with_dumpi}/include/dumpi/libundumpi"
DUMPI_LIBS="-L${with_dumpi}/lib/ -ldumpi -lundumpi"
AC_SUBST(DUMPI_LIBS)
AC_SUBST(DUMPI_CFLAGS)
else
AM_CONDITIONAL(USE_DUMPI, false)
fi
dnl ======================================================================
dnl Try harder to be valgrind safe
dnl ======================================================================
...
...
src/Makefile.subdir
View file @
87cbb32b
...
...
@@ -108,7 +108,8 @@ src_libcodes_base_a_SOURCES = \
codes/codes-nw-workload.h
\
src/network-workload/codes-nw-workload.c
\
src/network-workload/codes-nw-workload-method.h
\
src/network-workload/codes-scala-trace-nw-wrkld.c
src/network-workload/codes-scala-trace-nw-wrkld.c
\
src/network-workload/codes-dumpi-trace-nw-wrkld.c
# stealth testing of the template code (actual test is not run, just compiled as
# a program - Make error signifies test failure)
...
...
@@ -133,6 +134,13 @@ bin_PROGRAMS += src/network-workload/codes-nw-test
src_network_workload_codes_nw_test_SOURCES
=
\
src/network-workload/codes-nw-test.c
src_network_workload_codes_nw_test_LDADD
=
$(testlib)
${ROSS_LIBS}
src_network_workload_codes_nw_test_LDADD
=
$(testlib)
${ROSS_LIBS}
${DUMPI_LIBS}
src_network_workload_codes_nw_test_LDFLAGS
=
${ROSS_LDFLAGS}
#bin_PROGRAMS += src/network-workload/codes-dumpi-wrkld
#src_network_workload_codes_dumpi_wrkld_SOURCES = \
src/network-workload/codes-dumpi-wrkld.c
#src_network_workload_codes_dumpi_wrkld_LDADD = $(testlib) ${ROSS_LIBS} ${DUMPI_LIBS}
#src_network_workload_codes_dumpi_wrkld_LDFLAGS = ${ROSS_LDFLAGS}
src/network-workload/codes-dumpi-trace-nw-wrkld.c
0 → 100644
View file @
87cbb32b
This diff is collapsed.
Click to expand it.
src/network-workload/codes-nw-test.c
View file @
87cbb32b
...
...
@@ -8,7 +8,7 @@
char
workload_file
[
8192
];
char
offset_file
[
8192
];
static
int
total_nw_lps
=
16
;
static
int
total_nw_lps
=
8
;
static
int
nlp_per_pe
;
static
int
wrkld_id
;
...
...
@@ -36,10 +36,12 @@ tw_peid nw_test_map(tw_lpid gid)
void
nw_test_init
(
nw_state
*
s
,
tw_lp
*
lp
)
{
/* initialize the LP's and load the data */
scala_trace_params
params
;
strcpy
(
params
.
offset_file_name
,
offset_file
);
strcpy
(
params
.
nw_wrkld_file_name
,
workload_file
);
wrkld_id
=
codes_nw_workload_load
(
"scala-trace-workload"
,
(
char
*
)
&
params
,
(
int
)
lp
->
gid
);
//scala_trace_params params;
//strcpy(params.offset_file_name, offset_file);
//strcpy(params.nw_wrkld_file_name, workload_file);
dumpi_trace_params
params
;
strcpy
(
params
.
file_name
,
workload_file
);
wrkld_id
=
codes_nw_workload_load
(
"dumpi-trace-workload"
,
(
char
*
)
&
params
,
(
int
)
lp
->
gid
);
tw_event
*
e
;
tw_stime
kickoff_time
;
...
...
@@ -108,10 +110,10 @@ int main( int argc, char** argv )
tw_opt_add
(
app_opt
);
tw_init
(
&
argc
,
&
argv
);
if
(
strlen
(
offset_file
)
==
0
||
strlen
(
workload_file
)
==
0
||
total_nw_lps
==
0
)
if
(
strlen
(
workload_file
)
==
0
||
total_nw_lps
==
0
)
{
if
(
tw_ismaster
())
printf
(
"
\n
Usage: mpirun -np n ./codes-nw-test --sync=1/2/3 --total_nw_lps=n --workload_file=workload-file-name
--offset_file=offset-file-name
"
);
printf
(
"
\n
Usage: mpirun -np n ./codes-nw-test --sync=1/2/3 --total_nw_lps=n --workload_file=workload-file-name"
);
tw_end
();
return
-
1
;
}
...
...
src/network-workload/codes-nw-workload.c
View file @
87cbb32b
...
...
@@ -14,10 +14,14 @@
* could make generators optional via autoconf tests etc. if needed
*/
extern
struct
codes_nw_workload_method
scala_trace_workload_method
;
extern
struct
codes_nw_workload_method
dumpi_trace_workload_method
;
static
struct
codes_nw_workload_method
*
method_array
[]
=
{
&
scala_trace_workload_method
,
#ifdef USE_DUMPI
&
dumpi_trace_workload_method
,
#endif
NULL
};
/* This shim layer is responsible for queueing up reversed operations and
...
...
@@ -153,21 +157,39 @@ void codes_nw_workload_print_op(FILE *f, struct mpi_event_list *op, int rank){
fprintf
(
f
,
"op: rank:%d type:end
\n
"
,
rank
);
break
;
case
CODES_NW_DELAY
:
fprintf
(
f
,
"op: rank:%d type:delay seconds:%
ld
\n
"
,
rank
,
op
->
u
.
delay
.
sec
ond
s
);
fprintf
(
f
,
"op: rank:%d type:delay seconds:%
f
\n
"
,
rank
,
op
->
u
.
delay
.
n
secs
);
break
;
case
CODES_NW_SEND
:
case
CODES_NW_ISEND
:
fprintf
(
f
,
"op: rank:%d type:send "
"sender: %d receiver: %d blocking: %d
\n
"
,
"sender: %d receiver: %d blocking: %d number of bytes: %d "
"start time: %f end time: %f
\n
"
,
rank
,
op
->
u
.
send
.
source_rank
,
op
->
u
.
send
.
dest_rank
,
op
->
u
.
send
.
blocking
);
op
->
u
.
send
.
blocking
,
op
->
u
.
send
.
num_bytes
,
op
->
start_time
,
op
->
end_time
);
break
;
case
CODES_NW_RECV
:
case
CODES_NW_IRECV
:
fprintf
(
f
,
"op: rank:%d type:recv "
"sender: %d receiver: %d blocking: %d
\n
"
,
"sender: %d receiver: %d blocking: %d number of bytes: %d "
"start time: %f end time: %f
\n
"
,
rank
,
op
->
u
.
recv
.
source_rank
,
op
->
u
.
recv
.
dest_rank
,
op
->
u
.
recv
.
blocking
);
op
->
u
.
recv
.
blocking
,
op
->
u
.
recv
.
num_bytes
,
op
->
start_time
,
op
->
end_time
);
break
;
case
CODES_NW_COL
:
case
CODES_NW_BCAST
:
case
CODES_NW_ALLGATHER
:
case
CODES_NW_ALLGATHERV
:
case
CODES_NW_ALLTOALL
:
case
CODES_NW_ALLTOALLV
:
case
CODES_NW_REDUCE
:
case
CODES_NW_ALLREDUCE
:
fprintf
(
f
,
"op: rank:%d type:collective "
"count: %d
\n
"
,
rank
,
op
->
u
.
collective
.
num_bytes
);
break
;
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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