diff --git a/codes/codes-workload.h b/codes/codes-workload.h index acba269c1aad654eaf0ce86b0aca10535a5d1102..3620e15cb485b022193f9d554dbf83eff70ac648 100644 --- a/codes/codes-workload.h +++ b/codes/codes-workload.h @@ -72,6 +72,7 @@ struct dumpi_trace_params { #ifdef ENABLE_CORTEX_PYTHON char cortex_script[MAX_NAME_LENGTH_WKLD]; char cortex_class[MAX_NAME_LENGTH_WKLD]; + char cortex_gen[MAX_NAME_LENGTH_WKLD]; #endif }; diff --git a/configure.ac b/configure.ac index 6b9a0b9bb0286143b6c415e53127d2cbf1e72567..f54a3587dbd46c324e07046b1c1ee0319abbe12c 100755 --- a/configure.ac +++ b/configure.ac @@ -140,7 +140,7 @@ 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], + AC_CHECK_FILES([${with_python}/lib/libpython2.7.so ${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" diff --git a/src/network-workloads/model-net-mpi-replay.c b/src/network-workloads/model-net-mpi-replay.c index 018d619437a2f10146d42c2975fd0a1baac33c6d..bacfbb55a307fb3e1e0fcddbf2d78f2af9bc256a 100644 --- a/src/network-workloads/model-net-mpi-replay.c +++ b/src/network-workloads/model-net-mpi-replay.c @@ -54,8 +54,9 @@ struct codes_jobmap_params_list jobmap_p; /* Variables for Cortex Support */ /* Matthieu's additions start */ #ifdef ENABLE_CORTEX_PYTHON -static char cortex_file[512]; -static char cortex_class[512]; +static char cortex_file[512] = "\0"; +static char cortex_class[512] = "\0"; +static char cortex_gen[512] = "\0"; #endif /* Matthieu's additions end */ @@ -1158,6 +1159,7 @@ void nw_test_init(nw_state* s, tw_lp* lp) #ifdef ENABLE_CORTEX_PYTHON strcpy(params_d.cortex_script, cortex_file); strcpy(params_d.cortex_class, cortex_class); + strcpy(params_d.cortex_gen, cortex_gen); #endif } @@ -1534,6 +1536,7 @@ const tw_optdef app_opt [] = #ifdef ENABLE_CORTEX_PYTHON 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-gen", cortex_gen, "Python function to pre-generate MPI events"), #endif TWOPT_END() }; diff --git a/src/workload/methods/codes-dumpi-trace-nw-wrkld.c b/src/workload/methods/codes-dumpi-trace-nw-wrkld.c index c90898d4e9b81f4f2755044639901d1a2de79bf8..dfa2315fd525557fa374ee4384f1c00d298b3ff7 100644 --- a/src/workload/methods/codes-dumpi-trace-nw-wrkld.c +++ b/src/workload/methods/codes-dumpi-trace-nw-wrkld.c @@ -23,12 +23,12 @@ #include #endif #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 UNDUMPI_CLOSE cortex_undumpi_close #else #define PROFILE_TYPE dumpi_profile* -#define UNDUMPI_OPEN undumpi_open +//#define UNDUMPI_OPEN undumpi_open #define DUMPI_START_STREAM_READ dumpi_start_stream_read #define UNDUMPI_CLOSE undumpi_close #endif @@ -646,7 +646,11 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) else sprintf(file_name, "%s%d.bin", dumpi_params->file_name, rank); #ifdef ENABLE_CORTEX - profile = cortex_undumpi_open(file_name, app_id, dumpi_params->num_net_traces, rank); + if(strcmp(dumpi_params->file_name,"none") == 0) { + profile = cortex_undumpi_open(NULL, app_id, dumpi_params->num_net_traces, rank); + } else { + profile = cortex_undumpi_open(file_name, app_id, dumpi_params->num_net_traces, rank); + } #else profile = undumpi_open(file_name); #endif @@ -728,7 +732,11 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) #ifdef ENABLE_CORTEX #ifdef ENABLE_CORTEX_PYTHON - libundumpi_populate_callbacks(CORTEX_PYTHON_TRANSLATION, transarr); + if(dumpi_params->cortex_script[0] != 0) { + libundumpi_populate_callbacks(CORTEX_PYTHON_TRANSLATION, transarr); + } else { + libundumpi_populate_callbacks(CORTEX_MPICH_TRANSLATION, transarr); + } #else libundumpi_populate_callbacks(CORTEX_MPICH_TRANSLATION, transarr); #endif @@ -738,7 +746,16 @@ int dumpi_trace_nw_workload_load(const char* params, int app_id, int rank) //dumpi_free_header(trace_header); #ifdef ENABLE_CORTEX_PYTHON - cortex_python_set_module(dumpi_params->cortex_script,dumpi_params->cortex_class); + if(dumpi_params->cortex_script[0] != 0) { + if(dumpi_params->cortex_class[0] != 0) { + cortex_python_set_module(dumpi_params->cortex_script, dumpi_params->cortex_class); + } else { + cortex_python_set_module(dumpi_params->cortex_script, NULL); + } + if(dumpi_params->cortex_gen[0] != 0) { + cortex_python_call_generator(profile, dumpi_params->cortex_gen); + } + } #endif int finalize_reached = 0;