Commit a43291d4 authored by Cédric VALENSI's avatar Cédric VALENSI

Sync

parent 27fa6302
##
# Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......@@ -80,6 +80,58 @@ IF (NOT "X${EXCLUDE_UARCHS}" STREQUAL "X")
ENDIF (NOT "X${EXCLUDE_UARCHS}" STREQUAL "X")
## ------------------------------------------------------------------##
## Handling modules exclusions ##
## ------------------------------------------------------------------##
# List the source plugins
FILE(GLOB
plugins_sources
${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/*
)
FOREACH(file ${plugins_sources})
IF(NOT "${file}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/src/plugins/built_in"
AND IS_DIRECTORY "${file}"
AND EXISTS "${file}/CMakeLists.txt")
# Get the last part of "file"
GET_FILENAME_COMPONENT(file ${file} NAME)
# If EXCLUDE_MODULES is not empty
IF (NOT "x${EXCLUDE_MODULES}" STREQUAL "x")
# Check if the module is excluded or not
IF ("${EXCLUDE_MODULES}" MATCHES "^${file}$"
OR "${EXCLUDE_MODULES}" MATCHES "^${file};"
OR "${EXCLUDE_MODULES}" MATCHES ";${file}$"
OR "${EXCLUDE_MODULES}" MATCHES ";${file};")
# Here the module is excluded
ELSE ()
# Here the module is included
SET(${file}_enabled true)
ENDIF ()
# EXCLUDE_MODULES is empty, but INCLUDE_MODULES is not empty
ELSEIF (NOT "${INCLUDE_MODULES}" STREQUAL "")
# Check if the module is included or not
IF ("${INCLUDE_MODULES}" MATCHES "^${file}$"
OR "${INCLUDE_MODULES}" MATCHES "^${file};"
OR "${INCLUDE_MODULES}" MATCHES ";${file}$"
OR "${INCLUDE_MODULES}" MATCHES ";${file};")
# Here the module is included
SET(${file}_enabled true)
ENDIF ()
# No rule specified, include the module
ELSE ()
# Here the module is included
SET(${file}_enabled true)
ENDIF()
ENDIF()
ENDFOREACH(file)
## ------------------------------------------------------------------##
## Compilation flags ##
## ------------------------------------------------------------------##
......@@ -187,58 +239,6 @@ ELSE ()
SET(C_DYNAMIC_FLAGS "${C_DYNAMIC_FLAGS} ${C_DYNAMIC_FLAGS_RELEASE}")
ENDIF ()
## ------------------------------------------------------------------##
## Modules ##
## ------------------------------------------------------------------##
# List the source plugins
FILE(GLOB
plugins_sources
${CMAKE_SOURCE_DIR}/src/plugins/*
)
FOREACH(file ${plugins_sources})
IF(NOT "${file}" STREQUAL "${CMAKE_SOURCE_DIR}/src/plugins/built_in"
AND IS_DIRECTORY "${file}"
AND EXISTS "${file}/CMakeLists.txt")
# Get the last part of "file"
GET_FILENAME_COMPONENT(file ${file} NAME)
# If EXCLUDE_MODULES is not empty
IF (NOT "x${EXCLUDE_MODULES}" STREQUAL "x")
# Check if the module is excluded or not
IF ("${EXCLUDE_MODULES}" MATCHES "^${file}$"
OR "${EXCLUDE_MODULES}" MATCHES "^${file};"
OR "${EXCLUDE_MODULES}" MATCHES ";${file}$"
OR "${EXCLUDE_MODULES}" MATCHES ";${file};")
# Here the module is excluded
ELSE ()
# Here the module is included
SET(${file}_enabled true)
ENDIF ()
# EXCLUDE_MODULES is empty, but INCLUDE_MODULES is not empty
ELSEIF (NOT "${INCLUDE_MODULES}" STREQUAL "")
# Check if the module is included or not
IF ("${INCLUDE_MODULES}" MATCHES "^${file}$"
OR "${INCLUDE_MODULES}" MATCHES "^${file};"
OR "${INCLUDE_MODULES}" MATCHES ";${file}$"
OR "${INCLUDE_MODULES}" MATCHES ";${file};")
# Here the module is included
SET(${file}_enabled true)
ENDIF ()
# No rule specified, include the module
ELSE ()
# Here the module is included
SET(${file}_enabled true)
ENDIF()
ENDIF()
ENDFOREACH(file)
## ------------------------------------------------------------------##
## Strip ##
## ------------------------------------------------------------------##
......@@ -317,7 +317,7 @@ find_path(RPMBUILD_PATH NAMES rpmbuild) # look for rpmbuild
find_path(DPKG_DEB_PATH NAMES dpkg-deb) # look for dpkg-deb
SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "3")
SET(CPACK_PACKAGE_VERSION_MINOR "4")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
# ---- Check if at least one package generator has been found
......@@ -379,7 +379,7 @@ ENDIF ()
# ---- Static libraries needed by MAQAO
IF (is_UNIX)
# Create a copy of a CMake variable before modifying it
SET(CPY_CMAKE_FIND_LIBRARY_SUFFIXES CMAKE_FIND_LIBRARY_SUFFIXES)
SET(CPY_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
SET(CMAKE_FIND_LIBRARY_SUFFIXES .a)
# Get libraries
......@@ -402,7 +402,7 @@ IF (is_UNIX)
ENDIF ()
# Restore the CMake variable
SET(CMAKE_FIND_LIBRARY_SUFFIXES CPY_CMAKE_FIND_LIBRARY_SUFFIXES)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CPY_CMAKE_FIND_LIBRARY_SUFFIXES})
ENDIF ()
......@@ -436,12 +436,7 @@ ADD_SUBDIRECTORY(${CMAKE_SOURCE_DIR}/src)
# ---- Select files to install
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao.1" DESTINATION man/man1)
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-analyze.1" DESTINATION man/man1)
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-analyze-stan.1" DESTINATION man/man1)
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-analyze-grouping.1" DESTINATION man/man1)
#INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-instrument.1" DESTINATION man/man1)
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-madras.1" DESTINATION man/man1)
INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-perfeval.1" DESTINATION man/man1)
#INSTALL( FILES "${CMAKE_CURRENT_SOURCE_DIR}/doc/man/maqao-memory.1" DESTINATION man/man1)
INSTALL( PROGRAMS maqao
DESTINATION bin
PERMISSIONS OWNER_READ OWNER_EXECUTE
......
===============================================================================
Copyright (C) 2004 - 2012 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
MAQAO is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
......
##
# Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
.\" File generated using by MAQAO.
.TH MAQAO-ANALYZE "1" "07/19/2017" "MAQAO-ANALYZE 2.3.0" "User Commands"
.TH MAQAO-ANALYZE "1" "04/20/2018" "MAQAO-ANALYZE 2.4.0" "User Commands"
.SH NAME
maqao-analyze \- manual page for maqao analyze module.
.SH SYNOPSIS
......@@ -13,35 +13,41 @@ Run grouping analysis.
.SH " LIST FUNCTIONS"
.TP
\fB\-lf\fR, \fB\-\-list-functions\fR
List all functions in the binary, then exit.
List all functions in the binary.
.TP
\fB\-\-fct\fR\=<function>
Filter results of --list-functions using a regular expression passed with fct=<function>. The regular expression format in available in lua5.1 documentation.
Filter results of --list-functions using a regular expression passed with fct=<function>. The regular expression format is available in the Lua 5.1 documentation.
.SH " LIST LOOPS"
.TP
\fB\-ll\fR, \fB\-\-list-loops\fR
List all loops per function in the binary, then exit.
List all loops per function in the binary.
.TP
\fB\-\-fct\fR\=<function>
Filter results of --list-loops using a regular expression passed with fct=<function> to display loops only for matching function. The regular expression format in available in lua5.1 documentation.
Filter results of --list-loops using a regular expression passed with fct=<function> to only display the loops that match. The regular expression format is available in the Lua 5.1 documentation.
.TP
\fB\-\-loop\fR\=<val>
Filter results of --list-loops to get only loops matching a property.
Filter results of --list-loops to only get loops matching a certain property.
.br
If <val> is an integer, only loops whose depth is <val> are displayed.
If <val> is an integer, only loops with a depth of <val> are displayed.
.br
If <val> is in "innermost", "in-between", "outermost", only loops matching with the selected property are displayed.
If <val> is "innermost", "in-between", or "outermost", only <val> loops will be displayed.
.TP
\fB\-\-show-hierarchy\fR
Display the loops by hierarchy instead of a flat list. This option is ignored if the loop argument is set.
.TP
\fB\-\-show-extra-info\fR
Display extra info (start-end source lines and addresses).
.SH " MAN PAGE"
.TP
\fB\-\-generate-man\fR
Generate the man page of the module based on the module help in current directory. The generated file is called maqao-<module>.1. Once the man page is generated, the program exits.
Generate the man page of the module based on the module help in the current directory. The generated file is called maqao-<module>.1. Once the man page is generated, the program exits.
.TP
\fB\-\-output\fR\=<path>
Specify the path where the man page is generated.
.SH " OPTIONAL FLAGS COMMON TO ALL MODULES"
.TP
\fB\-\-disable-debug\fR
Disable debug data loading. WARNING, this option may decrease results accuracy.
Disable debug data loading. WARNING, this option may alter the tool's accuracy.
.TP
\fB\-\-compiler\fR\=<compiler>
Select the compiler used to create the binary. Available values are:
......@@ -59,8 +65,8 @@ Analyze all instructions returned by MADRAS. Default behaviour is to analyze ins
\fB\-\-uarch\fR\=<uarch>
Select the micro architecture used for analysis. Available values are:
.TP 20
\fB For architecture x86_64:\fR
CORE (CORE2_65), ENHANCED_CORE (CORE2_45), NEHALEM (NHM), WESTMERE, SANDY_BRIDGE (SNB), IVY_BRIDGE (IVB), IVY_BRIDGE_E (IVBE), HASWELL (HWL), BROADWELL (BWL), HASWELL_E (HWLE)
\fB For x86_64 architecture:\fR
CORE (CORE2_65), ENHANCED_CORE (CORE2_45), NEHALEM (NHM), WESTMERE, SANDY_BRIDGE (SNB), IVY_BRIDGE (IVB), IVY_BRIDGE_E (IVBE), HASWELL (HWL), BROADWELL (BWL), HASWELL_E (HWLE), KNIGHTS_LANDING (KNL)
.
.SH ""
.TP
......@@ -74,10 +80,10 @@ Select the mode of interleaved functions recognition. Available values are:
Functions are not extracted from connected components.
.TP 20
\fB debug_based\fR (default)
Fonctions are extracted from connected components matching with debug data.
Functions are extracted from connected components matching with debug data.
.TP 20
\fB all\fR
All connected components are extracted into new functions whatever there are corresponding debug data or not
All connected components are extracted into new functions whether they correspond to the debug information or not.
.
.SH ""
.TP
......@@ -99,7 +105,7 @@ Written by The MAQAO Team.
.SH "REPORTING BUGS"
Report bugs to <support@maqao.org>.
.SH COPYRIGHT
MAQAO (C), 2004-2017 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
MAQAO (C), 2004-2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
is distributed under the GNU Lesser General Public License (GNU LGPL). MAQAO is
free software; you can use it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 2.1
......
.\" File generated using by MAQAO.
.TH MAQAO-MADRAS "1" "" "MAQAO-MADRAS 2.3.0" "User Commands"
.TH MAQAO-MADRAS "1" "" "MAQAO-MADRAS 2.4.0" "User Commands"
.SH NAME
maqao-madras \- manual page for maqao madras module.
.SH SYNOPSIS
......@@ -162,7 +162,7 @@ Written by The MAQAO team.
.SH "REPORTING BUGS"
Report bugs to <support@maqao.org>.
.SH COPYRIGHT
Copyright (C) 2004 - 2017 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
......
.\" File generated using by MAQAO.
.TH MAQAO "1" "07/19/2017" "MAQAO 2.3.0" "User Commands"
.TH MAQAO "1" "04/20/2018" "MAQAO 2.4.0" "User Commands"
.SH NAME
maqao \- manual page for maqao module.
.SH SYNOPSIS
maqao <command>|<script.lua> [...]
.SH DESCRIPTION
MAQAO (Modular Assembly Quality Analyzer and Optimizer) is a tool to analyze the performance of applications. The main originality of MAQAO is its abilities to deal directly with the binary code of the application.
MAQAO (Modular Assembly Quality Analyzer and Optimizer) is a tool for application performance analysis that deals directly with the target code's binary file. The current version handles the following architectures: - x86_64
.SH OPTIONS
.TP
\fB<command>\fR
<command> can be a built-in module or a user module. Each module has its own options described using maqao <command> --help. Only built-in modules are described here. The list of available modules can be get using maqao --list-modules. Available values are:
<command> can be a built-in module or a user module. Modules can also have their own options, listed through <command> --help. This printout covers only built-in modules. The list of available modules can be obtained using maqao --list-modules. Available values are:
.TP 20
\fB analyze\fR
Displays results of static analysis on a binary.
Displays the results of the static analysis of a binary.
.TP 20
\fB madras\fR
Disassemble, patch or display data on a binary.
MAQAO's disassembler, patcher and binary operations handler.
.
.SH ""
.TP
\fB<script.lua>\fR
A user LUA script. The script name must be finished by the ".lua" extension
A user LUA script. The script file name must end with the extension ".lua"
.TP
\fB\-\-list-modules\fR
List all available modules and alias.
List all available modules and aliases.
.TP
\fB\-\-list-procs\fR
List all available processor models to use in proc=<proc>.
List all available processor models to use with the proc=<proc> parameter.
.SH " CREATE A MODULE"
.TP
\fB\-\-module-skeleton\fR
......@@ -40,24 +40,24 @@ Path where the skeleton must be created. Default path is $PWD.
.SH " HANDLE COMPLETION"
.TP
\fB\-\-generate-complete\fR
Create a bash script containing functions for completion and update .bashrc file to load it (if possible).
Create a bash script containing functions for completion and update the .bashrc file to load it (if possible).
.TP
\fB\-\-no-bashrc\fR
Make the option --generate-complete to not update .bashrc file. Instead, the bash code is displayed.
Discards --generate-complete .bashrc file update. Instead, the bash code is displayed on the standard output.
.TP
\fB\-\-unload-complete\fR
Remove code used to handle completion for MAQAO from .bashrc and remove $HOME/.maqao_complete.sh.
Remove code used to handle completion for MAQAO from the .bashrc and remove $HOME/.maqao_complete.sh.
.SH " MAN PAGE"
.TP
\fB\-\-generate-man\fR
Generate the man page of the module based on the module help in current directory. The generated file is called maqao-<module>.1. Once the man page is generated, the program exits.
Generate the man page of the module based on the module help in the current directory. The generated file is called maqao-<module>.1. Once the man page is generated, the program exits.
.TP
\fB\-\-output\fR\=<path>
Specify the path where the man page is generated.
.SH " OPTIONAL FLAGS COMMON TO ALL MODULES"
.TP
\fB\-\-disable-debug\fR
Disable debug data loading. WARNING, this option may decrease results accuracy.
Disable debug data loading. WARNING, this option may alter the tool's accuracy.
.TP
\fB\-\-compiler\fR\=<compiler>
Select the compiler used to create the binary. Available values are:
......@@ -75,8 +75,8 @@ Analyze all instructions returned by MADRAS. Default behaviour is to analyze ins
\fB\-\-uarch\fR\=<uarch>
Select the micro architecture used for analysis. Available values are:
.TP 20
\fB For architecture x86_64:\fR
CORE (CORE2_65), ENHANCED_CORE (CORE2_45), NEHALEM (NHM), WESTMERE, SANDY_BRIDGE (SNB), IVY_BRIDGE (IVB), IVY_BRIDGE_E (IVBE), HASWELL (HWL), BROADWELL (BWL), HASWELL_E (HWLE)
\fB For x86_64 architecture:\fR
CORE (CORE2_65), ENHANCED_CORE (CORE2_45), NEHALEM (NHM), WESTMERE, SANDY_BRIDGE (SNB), IVY_BRIDGE (IVB), IVY_BRIDGE_E (IVBE), HASWELL (HWL), BROADWELL (BWL), HASWELL_E (HWLE), KNIGHTS_LANDING (KNL)
.
.SH ""
.TP
......@@ -90,10 +90,10 @@ Select the mode of interleaved functions recognition. Available values are:
Functions are not extracted from connected components.
.TP 20
\fB debug_based\fR (default)
Fonctions are extracted from connected components matching with debug data.
Functions are extracted from connected components matching with debug data.
.TP 20
\fB all\fR
All connected components are extracted into new functions whatever there are corresponding debug data or not
All connected components are extracted into new functions whether they correspond to the debug information or not.
.
.SH ""
.TP
......@@ -113,13 +113,13 @@ Print the current version.
.SH EXAMPLES
.TP
$ maqao script.lua
Run a lua script through MAQAO
Run a lua script through MAQAO's embedded Lua interpreter
.SH AUTHOR
Written by The MAQAO Team.
.SH "REPORTING BUGS"
Report bugs to <support@maqao.org>.
.SH COPYRIGHT
MAQAO (C), 2004-2017 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
MAQAO (C), 2004-2018 Universite de Versailles Saint-Quentin-en-Yvelines (UVSQ),
is distributed under the GNU Lesser General Public License (GNU LGPL). MAQAO is
free software; you can use it under the terms of the GNU Lesser General
Public License as published by the Free Software Foundation; either version 2.1
......
This diff is collapsed.
##
# Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......@@ -30,14 +30,14 @@ IF (${CROSS_COMPILATION})
SET (CC_DEVICE "${CC_DEVICE} ${CMAKE_C_COMPILER_ARG${i}}")
MATH(EXPR i "${i} + 1")
ENDWHILE()
# (2017-07-25) Note: I have no idea why we need to add -fPIC to STATIC_CC, but there is a linker error otherwise.
ADD_CUSTOM_COMMAND(
OUTPUT ${LUA_LIB_DYN}
OUTPUT ${LUA_BIN}
# Create device version of LuaJIT and copy it
COMMAND ${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR} make
CC=${CC_DEVICE} HOST_CC=${CMAKE_C_COMPILER} XCFLAGS=-DLUAJIT_DISABLE_JIT
CC=${CC_DEVICE} HOST_CC=${CMAKE_C_COMPILER} XCFLAGS=-DLUAJIT_DISABLE_JIT STATIC_CC=${CC_DEVICE}\ -fPIC
COMMAND ${CMAKE_COMMAND} -E copy ${LOCAL_LUA_LIB} ${LIBRARY_OUTPUT_PATH}
COMMAND ${CMAKE_COMMAND} -E copy ${LOCAL_LUA_BIN} ${EXECUTABLE_OUTPUT_PATH}
......
##
# Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
# Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
#
# This file is part of MAQAO.
#
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -31,6 +31,7 @@
static int maqao_insn_is_unconditional_branch(insn_t *in)
{
return (insn_check_annotate(in, A_RTRN)
|| insn_check_annotate(in, A_HANDLER_EX)
|| (insn_check_annotate(in, A_JUMP)
&& !insn_check_annotate(in, A_CONDITIONAL)));
}
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -96,7 +96,7 @@ static list_t *lcore_dfs_mark(block_t *root, int *cinfo, block_t *defaulthead,
/*
* \brief Creates the list of initial heads of connected components. As a function may
* contain more than just one component(especially in the case of openMP programs).
* Hence, component headers are mendatory to cover all the function's elements within
* Hence, component headers are mandatory to cover all the function's elements within
* the different analyses such as loop analysis.
* \param fct_t* the target function
* \return list_t* the list of initial heads of components
......@@ -104,7 +104,7 @@ static list_t *lcore_dfs_mark(block_t *root, int *cinfo, block_t *defaulthead,
list_t *lcore_collect_init_heads(fct_t *f)
{
fct_upd_blocks_id(f);
DBGMSG("Collecting connected components head in function %s\n", fct_get_name(f));
int i;
list_t* initheads = NULL;
int *cinfos = (int *) lc_malloc(sizeof(int) * f->blocks->length);
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......
/*
Copyright (C) 2004 - 2017 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
Copyright (C) 2004 - 2018 Université de Versailles Saint-Quentin-en-Yvelines (UVSQ)
This file is part of MAQAO.
......@@ -802,100 +802,45 @@ void lcore_set_ddg_latency(graph_t *DDG, get_DDG_latency_t get_latency)
/* FUNCTIONS RELATED TO get_RecMII */
/**************************************************************************************/
/*
* Returns RecMII (latency of the longest latency chain) for a cycle
*/
static void get_cycle_RecMII(queue_t *cycle, float *min, float *max)
static boolean_t ignore_non_RAW (const graph_edge_t *edge)
{
/* Considering only RAW dependencies */
data_dependence_t *data_dep = edge->data;
return strcmp(data_dep->kind, "RAW") ? TRUE : FALSE;
}
typedef struct {
float min; // maximum of minimum (best -case) latency values
float max; // maximum of maximum (worst-case) latency values
} _upd_cycle_data_t;
static void _upd_cycle (queue_t *cycle, void *_data)
{
int sum_min_latency = 0;
int sum_max_latency = 0;
int sum_distance = 0;
/* For each RAW dependency in the cycle, accumulate distance and latency */
FOREACH_INQUEUE(cycle, cycle_iter) { /* For each node in the cycle */
graph_node_t *cur_node = GET_DATA_T(graph_node_t*, cycle_iter);
graph_node_t *nxt_node =
list_getnext(cycle_iter) ?
GET_DATA_T(graph_node_t*, list_getnext(cycle_iter)) :
queue_peek_head(cycle);
/* Looking for the first (supposed unique) RAW dependency */
FOREACH_INLIST(cur_node->out, out_iter)
{ /* For each edge exiting cur_node */
graph_edge_t *edge = GET_DATA_T(graph_edge_t*, out_iter);
if (edge->to != nxt_node)
continue; /* not in the cycle */
/* Considering only RAW dependencies */
data_dependence_t *data_dep = edge->data;
if (strcmp(data_dep->kind, "RAW") != 0)
continue;
sum_min_latency += data_dep->latency.min;
sum_max_latency += data_dep->latency.max;
sum_distance += data_dep->distance;
break;
}
}
*min = (sum_distance > 0) ? (float) sum_min_latency / sum_distance : 0.0f;