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
6b53da93
Commit
6b53da93
authored
Nov 21, 2016
by
Matthieu Dorier
Browse files
enabling cortex-mpich when python is not enabled
parent
b2299708
Changes
5
Hide whitespace changes
Inline
Side-by-side
Makefile.am
View file @
6b53da93
...
@@ -63,15 +63,15 @@ src_libcodes_la_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c
...
@@ -63,15 +63,15 @@ src_libcodes_la_SOURCES += src/workload/methods/codes-dumpi-trace-nw-wrkld.c
LDADD
+=
${DUMPI_LIBS}
LDADD
+=
${DUMPI_LIBS}
if
USE_CORTEX
if
USE_CORTEX
if
USE_PYTHON
if
USE_PYTHON
if
USE_
BOOST
if
USE_
CORTEX_PYTHON
AM_CPPFLAGS
+=
${CORTEX_CFLAGS}
-DENABLE_CORTEX
=
1
AM_CPPFLAGS
+=
${CORTEX_
PYTHON_
CFLAGS}
-DENABLE_CORTEX
_PYTHON
=
1
LDADD
+=
${CORTEX_LIBS}
LDADD
+=
${CORTEX_
PYTHON_
LIBS}
AM_CPPFLAGS
+=
${PYTHON_CFLAGS}
AM_CPPFLAGS
+=
${PYTHON_CFLAGS}
LDADD
+=
${PYTHON_LIBS}
LDADD
+=
${PYTHON_LIBS}
AM_CPPFLAGS
+=
${BOOST_CFLAGS}
LDADD
+=
${BOOST_LIBS}
endif
endif
endif
endif
AM_CPPFLAGS
+=
${CORTEX_CFLAGS}
-DENABLE_CORTEX
=
1
LDADD
+=
${CORTEX_LIBS}
endif
endif
endif
endif
codes/codes-workload.h
View file @
6b53da93
...
@@ -69,7 +69,7 @@ struct recorder_params
...
@@ -69,7 +69,7 @@ struct recorder_params
struct
dumpi_trace_params
{
struct
dumpi_trace_params
{
char
file_name
[
MAX_NAME_LENGTH_WKLD
];
char
file_name
[
MAX_NAME_LENGTH_WKLD
];
int
num_net_traces
;
int
num_net_traces
;
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
_PYTHON
char
cortex_script
[
MAX_NAME_LENGTH_WKLD
];
char
cortex_script
[
MAX_NAME_LENGTH_WKLD
];
char
cortex_class
[
MAX_NAME_LENGTH_WKLD
];
char
cortex_class
[
MAX_NAME_LENGTH_WKLD
];
#endif
#endif
...
...
configure.ac
View file @
6b53da93
...
@@ -88,7 +88,7 @@ PKG_CHECK_MODULES_STATIC([ROSS], [ross], [],
...
@@ -88,7 +88,7 @@ PKG_CHECK_MODULES_STATIC([ROSS], [ross], [],
AC_ARG_ENABLE([g],[AS_HELP_STRING([--enable-g],
AC_ARG_ENABLE([g],[AS_HELP_STRING([--enable-g],
[Build with GDB symbols])],
[Build with GDB symbols])],
[use_debug=yes],[use_debug=no])
[use_debug=yes],[use_debug=no])
AM_CONDITIONAL(USE_DEBUG, ["x${use_debug}" = xyes])
AM_CONDITIONAL(USE_DEBUG, [
test
"x${use_debug}" = xyes])
# check for Darshan
# check for Darshan
AC_ARG_WITH([darshan],[AS_HELP_STRING([--with-darshan],
AC_ARG_WITH([darshan],[AS_HELP_STRING([--with-darshan],
...
@@ -130,46 +130,49 @@ fi
...
@@ -130,46 +130,49 @@ fi
# check for Cortex
# check for Cortex
AC_ARG_WITH([cortex],[AS_HELP_STRING([--with-cortex@<:@=DIR@:>@],
AC_ARG_WITH([cortex],[AS_HELP_STRING([--with-cortex@<:@=DIR@:>@],
[location of Cortex installation])])
[location of Cortex installation])])
# check for Python
AC_ARG_WITH([python],[AS_HELP_STRING([--with-python@<:@=DIR@:>@],
[location of Python 2.7 installation])])
# check for Boost Python
AC_ARG_WITH([boost],[AS_HELP_STRING([--with-boost@<:@=DIR@:>@],
[location of Boost Python installation])])
if [ test "x${with_python}" != "x" -a "x${with_boost}" != "x"] ; then
AC_CHECK_FILES([${with_python}/lib/libpython2.7.a ${with_boost}/lib/libboost_python.a],
AM_CONDITIONAL(USE_PYTHON, true),
AC_MSG_ERROR(Could not find Python and/or Boost-Python libraries))
PYTHON_CFLAGS="-I${with_python}/include -I${with_boost}/include"
PYTHON_LIBS="-L${with_boost}/lib -lboost_python -L${with_python}/lib/ -lpython2.7"
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_CFLAGS)
else
AM_CONDITIONAL(USE_PYTHON, false)
fi
if test "x${with_cortex}" != "x" ; then
if test "x${with_cortex}" != "x" ; then
AC_CHECK_FILES([${with_cortex}/lib/libcortex.a ${with_cortex}/lib/libcortex-
python
.a],
AC_CHECK_FILES([${with_cortex}/lib/libcortex.a ${with_cortex}/lib/libcortex-
mpich
.a],
AM_CONDITIONAL(USE_CORTEX, true),
AM_CONDITIONAL(USE_CORTEX, true),
AC_MSG_ERROR(Could not find Cortex libraries libcortex.a and/or libcortex-
python
.a))
AC_MSG_ERROR(Could not find Cortex libraries libcortex.a and/or libcortex-
mpich
.a))
CORTEX_CFLAGS="-I${with_cortex}/include"
CORTEX_CFLAGS="-I${with_cortex}/include"
CORTEX_LIBS="-L${with_cortex}/lib/ -lcortex-
python
-lcortex -lstdc++"
CORTEX_LIBS="-L${with_cortex}/lib/ -lcortex-
mpich
-lcortex -lstdc++"
AC_SUBST(CORTEX_LIBS)
AC_SUBST(CORTEX_LIBS)
AC_SUBST(CORTEX_CFLAGS)
AC_SUBST(CORTEX_CFLAGS)
else
else
AM_CONDITIONAL(USE_CORTEX, false)
AM_CONDITIONAL(USE_CORTEX, false)
fi
fi
# check for Python
if [ test "x${with_cortex}" != "x" -a "x${with_python}" != "x" -a "x${with_boost}" != "x"] ; then
AC_ARG_WITH([python],[AS_HELP_STRING([--with-python@<:@=DIR@:>@],
AC_CHECK_FILE([${with_cortex}/lib/libcortex-python.a],
[location of Python 2.7 installation])])
AM_CONDITIONAL(USE_CORTEX_PYTHON, true),
if test "x${with_python}" != "x" ; then
AC_MSG_ERROR(Could not find library libcortex-python.a))
AC_CHECK_FILE([${with_python}/lib/libpython2.7.a],
CORTEX_PYTHON_CFLAGS="-I${with_cortex}/include"
AM_CONDITIONAL(USE_PYTHON, true),
CORTEX_PYTHON_LIBS="-L${with_cortex}/lib/ -lcortex-python"
AC_MSG_ERROR(Could not find Python library))
AC_SUBST(CORTEX_PYTHON_LIBS)
PYTHON_CFLAGS="-I${with_python}/include"
AC_SUBST(CORTEX_PYTHON_CFLAGS)
PYTHON_LIBS="-L${with_python}/lib/ -lpython2.7"
AC_SUBST(PYTHON_LIBS)
AC_SUBST(PYTHON_CFLAGS)
else
AM_CONDITIONAL(USE_PYTHON, false)
fi
# check for Boost Python
AC_ARG_WITH([boost],[AS_HELP_STRING([--with-boost@<:@=DIR@:>@],
[location of Boost Python installation])])
if test "x${with_boost}" != "x" ; then
AC_CHECK_FILE([${with_boost}/lib/libboost_python.a],
AM_CONDITIONAL(USE_BOOST, true),
AC_MSG_ERROR(Could not find Boost Python library libboost_python.a))
BOOST_CFLAGS="-I${with_boost}/include"
BOOST_LIBS="-L${with_boost}/lib -lboost_python"
AC_SUBST(BOOST_LIBS)
AC_SUBST(BOOST_CFLAGS)
else
else
AM_CONDITIONAL(USE_
BOOST
, false)
AM_CONDITIONAL(USE_
CORTEX_PYTHON
, false)
fi
fi
dnl ======================================================================
dnl ======================================================================
...
...
src/network-workloads/model-net-mpi-replay.c
View file @
6b53da93
...
@@ -53,8 +53,10 @@ struct codes_jobmap_params_list jobmap_p;
...
@@ -53,8 +53,10 @@ struct codes_jobmap_params_list jobmap_p;
/* Variables for Cortex Support */
/* Variables for Cortex Support */
/* Matthieu's additions start */
/* Matthieu's additions start */
#ifdef ENABLE_CORTEX_PYTHON
static
char
cortex_file
[
512
];
static
char
cortex_file
[
512
];
static
char
cortex_class
[
512
];
static
char
cortex_class
[
512
];
#endif
/* Matthieu's additions end */
/* Matthieu's additions end */
typedef
struct
nw_state
nw_state
;
typedef
struct
nw_state
nw_state
;
...
@@ -1151,7 +1153,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
...
@@ -1151,7 +1153,7 @@ void nw_test_init(nw_state* s, tw_lp* lp)
s
->
local_rank
=
lid
.
rank
;
s
->
local_rank
=
lid
.
rank
;
// printf("network LP nw id %d app id %d local rank %d generating events, lp gid is %ld \n", s->nw_id,
// printf("network LP nw id %d app id %d local rank %d generating events, lp gid is %ld \n", s->nw_id,
// s->app_id, s->local_rank, lp->gid);
// s->app_id, s->local_rank, lp->gid);
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
_PYTHON
strcpy
(
params_d
.
cortex_script
,
cortex_file
);
strcpy
(
params_d
.
cortex_script
,
cortex_file
);
strcpy
(
params_d
.
cortex_class
,
cortex_class
);
strcpy
(
params_d
.
cortex_class
,
cortex_class
);
#endif
#endif
...
@@ -1525,7 +1527,7 @@ const tw_optdef app_opt [] =
...
@@ -1525,7 +1527,7 @@ const tw_optdef app_opt [] =
TWOPT_CHAR
(
"lp-io-dir"
,
lp_io_dir
,
"Where to place io output (unspecified -> no output"
),
TWOPT_CHAR
(
"lp-io-dir"
,
lp_io_dir
,
"Where to place io output (unspecified -> no output"
),
TWOPT_UINT
(
"lp-io-use-suffix"
,
lp_io_use_suffix
,
"Whether to append uniq suffix to lp-io directory (default 0)"
),
TWOPT_UINT
(
"lp-io-use-suffix"
,
lp_io_use_suffix
,
"Whether to append uniq suffix to lp-io directory (default 0)"
),
TWOPT_CHAR
(
"offset_file"
,
offset_file
,
"offset file name"
),
TWOPT_CHAR
(
"offset_file"
,
offset_file
,
"offset file name"
),
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
_PYTHON
TWOPT_CHAR
(
"cortex-file"
,
cortex_file
,
"Python file (without .py) containing the CoRtEx translation class"
),
TWOPT_CHAR
(
"cortex-file"
,
cortex_file
,
"Python file (without .py) containing the CoRtEx translation class"
),
TWOPT_CHAR
(
"cortex-class"
,
cortex_class
,
"Python class implementing the CoRtEx translator"
),
TWOPT_CHAR
(
"cortex-class"
,
cortex_class
,
"Python class implementing the CoRtEx translator"
),
#endif
#endif
...
@@ -1572,7 +1574,7 @@ int main( int argc, char** argv )
...
@@ -1572,7 +1574,7 @@ int main( int argc, char** argv )
" --workload_type=dumpi"
" --workload_type=dumpi"
" --workload_conf_file=prefix-workload-file-name"
" --workload_conf_file=prefix-workload-file-name"
" --alloc_file=alloc-file-name"
" --alloc_file=alloc-file-name"
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
_PYTHON
" --cortex-file=cortex-file-name"
" --cortex-file=cortex-file-name"
" --cortex-class=cortex-class-name"
" --cortex-class=cortex-class-name"
#endif
#endif
...
...
src/workload/methods/codes-dumpi-trace-nw-wrkld.c
View file @
6b53da93
...
@@ -18,7 +18,10 @@
...
@@ -18,7 +18,10 @@
#if ENABLE_CORTEX
#if ENABLE_CORTEX
#include <cortex/cortex.h>
#include <cortex/cortex.h>
#include <cortex/datatype.h>
#include <cortex/datatype.h>
#include <cortex/cortex-mpich.h>
#ifdef ENABLE_CORTEX_PYTHON
#include <cortex/cortex-python.h>
#include <cortex/cortex-python.h>
#endif
#define PROFILE_TYPE cortex_dumpi_profile*
#define PROFILE_TYPE cortex_dumpi_profile*
#define UNDUMPI_OPEN cortex_undumpi_open
#define UNDUMPI_OPEN cortex_undumpi_open
#define DUMPI_START_STREAM_READ cortex_dumpi_start_stream_read
#define DUMPI_START_STREAM_READ cortex_dumpi_start_stream_read
...
@@ -689,14 +692,17 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank)
...
@@ -689,14 +692,17 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank)
libundumpi_populate_callbacks
(
&
callbacks
,
callarr
);
libundumpi_populate_callbacks
(
&
callbacks
,
callarr
);
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX_PYTHON
libundumpi_populate_callbacks
(
CORTEX_PYTHON_TRANSLATION
,
transarr
);
libundumpi_populate_callbacks
(
CORTEX_PYTHON_TRANSLATION
,
transarr
);
#else
libundumpi_populate_callbacks
(
CORTEX_MPICH_TRANSLATION
,
transarr
);
#endif
#endif
#endif
DUMPI_START_STREAM_READ
(
profile
);
DUMPI_START_STREAM_READ
(
profile
);
//dumpi_header* trace_header = undumpi_read_header(profile);
//dumpi_header* trace_header = undumpi_read_header(profile);
//dumpi_free_header(trace_header);
//dumpi_free_header(trace_header);
#ifdef ENABLE_CORTEX
#ifdef ENABLE_CORTEX
_PYTHON
cortex_python_set_module
(
dumpi_params
->
cortex_script
,
dumpi_params
->
cortex_class
);
cortex_python_set_module
(
dumpi_params
->
cortex_script
,
dumpi_params
->
cortex_class
);
#endif
#endif
...
...
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