Commit 1570f448 authored by Samuel Thibault's avatar Samuel Thibault

Imported Upstream version 0.1-2

parents
Francois Rue <francois.rue@inria.fr>
Francois Trahay <francois.trahay@it-sudparis.eu>
Johnny Jazeix
Kevin Coulomb <kevin.coulomb@gmail.com>
Mathieu Faverge
Olivier Lagrasse
Copyright © CNRS, INRIA, Université Bordeaux 1.
This software is governed by the CeCILL-C license under French law and
abiding by the rules of distribution of free software. You can use,
modify and/ or redistribute the software under the terms of the CeCILL-C
license as circulated by CEA, CNRS and INRIA at the following URL
"http://www.cecill.info".
As a counterpart to the access to the source code and rights to copy,
modify and redistribute granted by the license, users are provided only
with a limited warranty and the software's author, the holder of the
economic rights, and the successive licensors have only limited
liability.
In this respect, the user's attention is drawn to the risks associated
with loading, using, modifying and/or developing or reproducing the
software by the user in light of its specific status of free software,
that may mean that it is complicated to manipulate, and that also
therefore means that it is reserved for developers and experienced
professionals having in-depth computer knowledge. Users are therefore
encouraged to load and test the software's suitability as regards their
requirements in conditions enabling the security of their systems and/or
data to be ensured and, more generally, to use and operate it in the
same conditions as regards security.
The fact that you are presently reading this means that you have had
knowledge of the CeCILL-C license and that you accept its terms.
This diff is collapsed.
SUBDIRS = extlib/ inc/ src/ doc/
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gtg.pc
EXTRA_DIST = exm/gtg_color.c \
exm/Makefile \
exm/otf_example.c \
exm/paje_example2.c \
exm/paje_example.c \
exm/paje_example.F90 \
exm/vite_example.c
This diff is collapsed.
==============================================
=== Introduction : ==
==============================================
This directory contains the Generic Trace Generator (GTG) project.
Authors are :
Francois Rue ,
Francois Trahay ,
Johnny Jazeix ,
Kevin Coulomb,
Mathieu Faverge,
Olivier Lagrasse
==============================================
=== Files : ==
==============================================
-- Files
README : This file, presenting the project
AUTHORS : The authors of the project
ChangeLog : The list of the changes by version
configure.ac : Used to create the configure file with autoreconf
COPYING : The copying rule
COPYRIGHT : The licence of the library
INSTALL : How to install the GTG library
Makefile.am : Some hints to generate the Makefile throught configure
NEWS : News about the project
-- Directories
*exm* : Contains examples of programm using the library
*inc* : Contains files to include
*src/C* : Contains the C implementation of the API
*src/FORTRAN* : Contains the Fortran implementation of the API
*test* : Regular developers test
==============================================
=== Building from the SVN repository: ==
==============================================
First, you need to generate the configure files by running autoreconf:
$ autoreconf -vfi
Then, simply run configure && make && make install
==============================================
=== Examples : ==
==============================================
The examples show code using the library.
You can compile them with *make examples*.
Their execution enables the creation of traces :
gtg_color creates the gtg_color.trace trace
cpaje creates the cpaje.trace using the C API
fpaje creates the fpaje.trace using the Fortran API
cpaje2 creates the cpaje2.trace using the C API
cvite creates the cvite_root.ept trace (with cvite_proc*.ept) using the C API <DO NOT USE YET>
The traces can be viewed using the ViTE tool. This API is used by the eztrace
that automatically generate traces for code, without modifying it manually.
==============================================
=== Support : ==
==============================================
If you encounter any problem, please contact the GTG developper
mailing list (gtg-devel@lists.gforge.inria.fr) so that we can fix the feature as soon as possible.
You can also give us some feedback to help us improve the API.
fix fortran compilar detection: f90 is needed, but currently, f77
compilers are accepted
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Copyright CNRS, INRIA, Universit Bordeaux 1
# See COPYING in top-level directory.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.61])
AC_INIT([GTG], [0.1-2], [gtg-devel@lists.gforge.inria.fr])
AM_INIT_AUTOMAKE
# Checks for programs.
AC_PROG_CC
AC_PROG_FC([],90)
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
# Correct install paths
AS_IF([test x"$prefix" = x -o x"$prefix" = "xNONE"], [prefix="/usr/local"])
AS_IF([test x"$exec_prefix" = x -o x"$exec_prefix" = "xNONE"], [exec_prefix="\${prefix}"])
AS_IF([test "$docdir" = "\${datarootdir}/doc/\${PACKAGE_TARNAME}"],
[docdir="\${datarootdir}/doc"])
# Checks for header files.
AC_CHECK_HEADERS([stdio.h string.h stdlib.h])
AC_CHECK_FUNCS([getline], have_getline=yes)
if [ test "x$have_getline" = xyes ]; then
CFLAGS="${CFLAGS} -DHAVE_GETLINE"
fi
# crappy hack: of the macros AC_PROG_{CC,CXX,F77,FC}, only the
# first expanded one will check for object file extension etc,
# and fail if that doesn't work.
### No fortran by default.
# use --with-fortran to build fortran interface
use_fortran=yes
AC_ARG_WITH(fortran,
[AS_HELP_STRING([--with-fortran[=<bool>]], [Enable fortran])],
[
if test x$withval != xno; then
use_fortran=yes
else
use_fortran=no
fi
])
if [ test $use_fortran = yes ]; then
if test x$FC = x; then
AC_MSG_ERROR(A Fortran compiler is required)
fi
fi
AM_CONDITIONAL([FORTRAN], [test "x$use_fortran" = xyes])
# MPI stuff
use_mpi=yes
AC_ARG_WITH(mpi, [AS_HELP_STRING([--with-mpi[=<dir>]], [Use a specific MPI installation])],
[
if test x$withval != xno; then
if test x$withval = xyes; then
AC_MSG_RESULT(yes)
use_mpi_from_system=yes
else
# use specified path
use_mpi_from_system=no
mpidir=$withval
AC_MSG_RESULT(yes using $mpidir)
AC_SUBST(MPIDIR, $mpidir)
fi
else
# either --without-mpi or --with-mpi=no is set
use_mpi=no
fi
])
if test $use_mpi = yes ; then
AC_SUBST(USE_MPIDIR_FROM_USER,$use_mpi_from_system)
if test x$use_mpi_from_system = xno; then
CPPFLAGS="${CPPFLAGS} -I$mpidir/include "
LDFLAGS="${LDFLAGS} -L$mpidir/lib "
fi
# MPI header
AC_CHECK_HEADER([mpi.h],[enable_mpi=yes],)
else
enable_mpi=no
fi
AM_CONDITIONAL([USE_MPI], [test "x$enable_mpi" = xyes])
# OTF stuff
use_internal_otf=yes
otf_asked=no
use_otf=yes
AC_ARG_WITH(otf, [AS_HELP_STRING([--with-otf[=<dir>]], [Use a specific OTF installation])],
[
if test x$withval != xno; then
otf_asked=yes
if test x$withval = xyes; then
AC_MSG_RESULT(yes)
use_internal_otf=yes
else
# use specified path
use_internal_otf=no
otfdir=$withval
AC_MSG_RESULT(yes using $otfdir)
AC_SUBST(OTFDIR, $otfdir)
OTF_INC=$otfdir/include
OTF_LIB=$otfdir/lib
fi
else
# either --without-otf or --with-otf=no is set
use_internal_otf=no
use_otf=no
fi
])
AC_ARG_WITH(otf-include, [AS_HELP_STRING([--with-otf-include[=<dir>]], [Use a specific OTF header directory])],
[
if test x$withval != xno; then
otf_asked=yes
if test x$withval = xyes; then
AC_MSG_RESULT(yes)
use_internal_otf=yes
else
# use specified path
use_internal_otf=no
otf_inc_dir=$withval
AC_MSG_RESULT(yes using $otf_inc_dir)
OTF_INC=$otf_inc_dir
AC_SUBST(OTF_INC, $otf_inc_dir)
fi
fi
])
AC_ARG_WITH(otf-lib, [AS_HELP_STRING([--with-otf-lib[=<dir>]], [Use a specific libotf.so directory])],
[
if test x$withval != xno; then
otf_asked=yes
if test x$withval = xyes; then
AC_MSG_RESULT(yes)
use_internal_otf=yes
else
# use specified path
use_internal_otf=no
otf_lib_dir=$withval
AC_MSG_RESULT(yes using $otf_lib_dir)
OTF_LIB=$otf_lib_dir
AC_SUBST(OTF_LIB, $otf_lib_dir)
fi
fi
])
if test $use_otf = yes ; then
enable_otf=yes
if test x$use_internal_otf = xno; then
CPPFLAGS="${CPPFLAGS} -I$OTF_INC/"
LDFLAGS="${LDFLAGS} -L$OTF_LIB"
# Check for OTF header
AC_CHECK_HEADER([otf.h],[enable_otf=yes], AC_MSG_WARN([Cannot find libOTF.]))
if test $enable_otf = no && test $otf_asked = yes ; then
AC_MSG_ERROR(Cannot find libOTF.)
fi
else
dnl configure otf from extlib
otf_parent_dir=`pwd`
otf_dir="extlib/otf"
AC_MSG_NOTICE([configuring in otf_dir ($otf_parent_dir/$otf_dir)])
AS_IF([test "$srcdir" != "."],
[
test -d "$otf_dir" ||
mkdir -p "$otf_dir" ||
AC_MSG_ERROR([cannot create $otf_dir])
])
cd $otf_dir
case $srcdir in
.)
otf_srcdir="$srcdir"
;;
/*)
otf_srcdir="$srcdir/$otf_dir"
;;
*)
otf_srcdir="../../$srcdir/$otf_dir"
;;
esac
otf_conf_cmd="$otf_srcdir/configure"
otf_conf_args="$otf_conf_args --prefix=\"$prefix\" --exec-prefix=\"$exec_prefix\" --bindir=\"$bindir\" --libdir=\"$libdir\" --includedir=\"$includedir\" --docdir=\"$docdir/otf\" $OTFFLAGS --cache-file=\"/dev/null\" --srcdir=\"$otf_srcdir\""
AC_MSG_NOTICE([running $SHELL $otf_conf_cmd $otf_conf_args])
eval "$SHELL '$otf_conf_cmd' $otf_conf_args"
AS_IF([test $? != "0"], [AC_MSG_ERROR([$otf_conf_cmd failed for $otf_dir])])
cd $otf_parent_dir
AS_IF([test x"$OTFLIB" = x], [OTF_LDFLAGS="-lotf"])
# OTF_CPPFLAGS="$OTF_CPPFLAGS -I${prefix}/include/otf"
# CPPFLAGS="${CPPFLAGS} -I${prefix}/include/otf"
fi
else
enable_otf=no
fi
AM_CONDITIONAL([USE_OTF], [test "x$enable_otf" = xyes])
AC_MSG_WARN([use otf = $use_internal_otf])
AM_CONDITIONAL(DONT_USE_INTERNAL_OTF, test x"$use_internal_otf" != "xyes")
# Checks for programs
AC_CHECK_PROG(HAVE_DOXYGEN, [doxygen], yes, no)
if test x$HAVE_DOXYGEN = xno ; then
AC_MSG_WARN([Cannot find doxygen])
fi
AC_ARG_VAR([PDFLATEX], [Location of the pdflatex program (required for building the hwloc doxygen documentation)])
AC_PATH_TOOL([PDFLATEX], [pdflatex], no)
AM_CONDITIONAL([USE_PDFLATEX], [test "x$PDFLATEX" != xno])
AM_CONDITIONAL([USE_DOXYGEN], [test "x$HAVE_DOXYGEN" = xyes])
AC_OUTPUT([Makefile \
gtg.pc \
extlib/Makefile \
inc/Makefile \
src/Makefile \
doc/Makefile \
doc/Doxyfile])
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Copyright CNRS, INRIA, Universit Bordeaux 1
# See COPYING in top-level directory.
if USE_DOXYGEN
DOX_DIR = .
DOC_DIR = $(builddir)
DOX_CONFIG = $(DOX_DIR)/Doxyfile
DOX_MAN_DIR = $(DOC_DIR)/man
DOX_LATEX_DIR = $(DOC_DIR)/latex
DOX_PDF = $(DOC_DIR)/documentation.pdf
DOX_HTML_DIR = $(DOC_DIR)/html/
DOX_TAG = $(DOC_DIR)/gtg.tag
# TODO: we should add source files so that the documentation is
# regenerated when a file changes
docx_inputs = $(DOX_CONFIG)
$(DOX_TAG): $(docx_inputs)
doxygen $(DOX_CONFIG)
touch $(DOX_TAG)
$(DOX_HTML_DIR): $(DOX_TAG)
$(DOX_PDF): $(DOX_TAG)
cd $(DOX_LATEX_DIR) &&\
rm -f *.aux *.toc *.idx *.ind *.ilg *.log *.out; \
$(PDFLATEX) refman.tex; \
$(MAKEINDEX) refman.idx; \
$(PDFLATEX) refman.tex; \
done=0; repeat=5; \
while test $$done = 0 -a $$repeat -gt 0; do \
if $(EGREP) 'Rerun (LaTeX|to get cross-references right)' refman.log > /dev/null 2>&1; then \
$(PDFLATEX) refman.tex; \
repeat=`expr $$repeat - 1`; \
else \
done=1; \
fi; \
done; \
cd -; \
mv $(DOX_LATEX_DIR)/refman.pdf $(DOX_PDF)
EXTRA_DIST = $(DOX_HTML_DIR)
if USE_PDFLATEX
EXTRA_DIST += $(DOX_PDF)
endif
# Crappy hack: automake cannot copy a directory, so we have to do it by hand.
install_html: $(DOX_TAG) $(DOX_HTML_DIR)/index.html
mkdir -p $(htmldir)
cp -r $(DOX_HTML_DIR) $(htmldir)
install_pdf: $(DOX_PDF)
mkdir -p $(pdfdir)
cp -r $(DOX_PDF) $(pdfdir)
if USE_PDFLATEX
install-data-am: install_pdf install_html
else
install-data-am: install_html
endif
include_HEADERS = Doxyfile
endif
This diff is collapsed.
BIN= paje_example paje_example2 gtg_color otf_example
all: $(BIN)
paje_example: paje_example.c
gcc -Wall -W -o paje_example paje_example.c $(CFLAGS) $(LDFLAGS) -lgtg -lpthread
paje_example2: paje_example2.c
gcc -Wall -W -o paje_example2 paje_example2.c $(CFLAGS) $(LDFLAGS) -lgtg -lpthread
gtg_color: gtg_color.c
gcc -Wall -W -o gtg_color gtg_color.c $(CFLAGS) $(LDFLAGS) -lgtg -lpthread
otf_example: otf_example.c
gcc -Wall -W -o otf_example otf_example.c $(CFLAGS) $(LDFLAGS) -lgtg -lpthread -lotf
clean:
rm -f $(BIN)
cleantraces:
rm -f *def *marker *otf *events *trace *ept
\ No newline at end of file
#include <stdio.h>
#include <stdlib.h>
#include "GTG.h"
int main (int argc, char** argv){
setTraceType (PAJE);
initTrace ("gtg_color", 0, GTG_FLAG_NONE);
addContType ("CT_NET", "0", "Network");
addContType ("CT_NODE", "CT_NET", "Node");
addContType ("CT_PROC", "CT_NODE", "Proc");
addStateType ("ST_NodeState", "CT_NODE", "Node state");
addStateType ("ST_ProcState", "CT_PROC", "Procstate");
addEntityValue ("SN_0", "ST_NodeState", "black", GTG_BLACK);
addEntityValue ("SN_1", "ST_NodeState", "red", GTG_RED);
addEntityValue ("SN_2", "ST_NodeState", "green", GTG_GREEN);
addEntityValue ("SN_3", "ST_NodeState", "blue", GTG_BLUE);
addEntityValue ("SN_4", "ST_NodeState", "white", GTG_WHITE);
addEntityValue ("SN_5", "ST_NodeState", "teal", GTG_TEAL);
addEntityValue ("SN_6", "ST_NodeState", "darkgrey", GTG_DARKGREY);
addEntityValue ("SN_7", "ST_NodeState", "yellow", GTG_YELLOW);
addEntityValue ("SN_8", "ST_NodeState", "purple", GTG_PURPLE);
addEntityValue ("SN_9", "ST_NodeState", "lightbrown", GTG_LIGHTBROWN);
addEntityValue ("SN_10", "ST_NodeState", "lightgrey", GTG_LIGHTGREY);
addEntityValue ("SN_11", "ST_NodeState", "darkblue", GTG_DARKBLUE);
addEntityValue ("SN_12", "ST_NodeState", "pink", GTG_PINK);
addEntityValue ("SN_13", "ST_NodeState", "darkpink", GTG_DARKPINK);
addEntityValue ("SN_14", "ST_NodeState", "seablue", GTG_SEABLUE);
addEntityValue ("SN_15", "ST_NodeState", "kaki", GTG_KAKI);
addEntityValue ("SN_16", "ST_NodeState", "redblood", GTG_REDBLOOD);
addEntityValue ("SN_17", "ST_NodeState", "brown", GTG_BROWN);
addEntityValue ("SN_18", "ST_NodeState", "grenat", GTG_GRENAT);
addEntityValue ("SN_19", "ST_NodeState", "orange", GTG_ORANGE);
addEntityValue ("SN_20", "ST_NodeState", "mauve", GTG_MAUVE);
addEntityValue ("SN_21", "ST_NodeState", "lightpink", GTG_LIGHTPINK);
addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "0");
addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "0");
addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "0");
int i;
for(i=0; i<21;i++) {
char* nodeState = NULL;
asprintf(&nodeState, "SN_%d", i);
setState ((float)i, "ST_NodeState", "C_P0", nodeState);
}
endTrace ();
return EXIT_SUCCESS;
}
/*
* Small example to generate a trace in the otf format
* Author Kevin Coulomb and Johnny Jazeix
*/
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include "../inc/GTGBasic1.h"
#include "../inc/pajeColor.h"
/* Size of the buffer used */
#define TXTSIZE 200
/* Small function to clean the buffer */
void clear (char* buf, int size){
int i;
for (i=0;i<size;i++)
buf[i]='\0';
}
/* Small macro to test the return value */
#define CHECK_RETURN(val) {if (val!=TRACE_SUCCESS){fprintf (stderr, "Function failed line %d. Leaving \n", __LINE__);exit (-1);}}
/* Main function to generate a trace in the Paje format called cpaje2.trace */
int main (int argc, char** argv){
double time;
int i;
char txt [TXTSIZE];
char proc[TXTSIZE];
char name[TXTSIZE];
char src [TXTSIZE];
char dest[TXTSIZE];
char key [TXTSIZE];
/* Initialisation */
setTraceType (OTF);
CHECK_RETURN (initTrace ("cotf", 0, GTG_FLAG_NONE));
/* Creating types used */
CHECK_RETURN (addContType ("CT_NET", "0", "Network"));
CHECK_RETURN (addContType ("CT_NODE", "CT_NET", "Node"));
CHECK_RETURN (addContType ("CT_PROC", "CT_NODE", "Proc"));
CHECK_RETURN (addStateType ("ST_NodeState", "CT_NODE", "Node state"));
CHECK_RETURN (addStateType ("ST_ProcState", "CT_PROC", "Procstate"));
CHECK_RETURN (addEntityValue ("SN_0", "ST_NodeState", "Sleep", GTG_RED));
CHECK_RETURN (addEntityValue ("SN_1", "ST_NodeState", "WaitLocal", GTG_PINK));
CHECK_RETURN (addEntityValue ("SN_2", "ST_NodeState", "WaitDistant", GTG_BLACK));
CHECK_RETURN (addEntityValue ("SP_3", "ST_ProcState", "Produit", GTG_ORANGE));
CHECK_RETURN (addEntityValue ("SP_4", "ST_ProcState", "Somme", GTG_GREEN));
CHECK_RETURN (addEntityValue ("SP_5", "ST_ProcState", "Difference", GTG_BLUE));
CHECK_RETURN (addEntityValue ("SP_6", "ST_ProcState", "Division", GTG_TEAL));
CHECK_RETURN (addEntityValue ("SP_7", "ST_ProcState", "Modulo", GTG_PURPLE));
CHECK_RETURN (addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC"));
CHECK_RETURN (addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC"));
CHECK_RETURN (addVarType ("V_Mem", "Memoire", "CT_NODE"));
CHECK_RETURN (addEventType ("E_0", "CT_PROC", "Rabbit"));
CHECK_RETURN (addEventType ("E_1", "CT_PROC", "Chocolate"));
/* Building containers tree */
CHECK_RETURN (addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "0"));
CHECK_RETURN (addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", "0"));
CHECK_RETURN (addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", "0"));
CHECK_RETURN (addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", "0"));
clear (txt, TXTSIZE);
time = 1.00000000;
for (i=0; i<200; i++){
if (i%10 == 0){
sprintf (txt , "ST_NodeState");
sprintf (proc, "C_N%d", (i%20)?0:1);
sprintf (name, "SN_%d", i%3);
}
else{
sprintf (txt , "ST_ProcState");
sprintf (proc, "C_P%d", i%6);
sprintf (name, "SP_%d", i%5+3);
}
CHECK_RETURN (setState (time, txt, proc, name)); /* State changes modifications */
/* Links */
sprintf (name, "L_%d", i%2);
sprintf (txt , "C_Net0");
sprintf (src , "C_P%d", (i+2)%6);
sprintf (dest, "C_P%d", (i+5)%6);
sprintf (proc, "%d", i);
sprintf (key , "%d", i);
CHECK_RETURN (startLink (time, name, txt, src, dest, proc, key));
time += 0.12;
CHECK_RETURN (endLink (time, name, txt, src, dest, proc, key));
sprintf (txt, "C_N%d", i%2);
CHECK_RETURN (setVar (time, "V_Mem", txt, i%5)); /* Modification of the variables */
time += 0.13;
}
/* clear (txt , TXTSIZE); */
/* clear (proc, TXTSIZE); */
/* clear (name, TXTSIZE); */
/* time = 1.00000000; */
/* timer = 1.50000000; */
/* for (i=0;i<30;i++){ */
/* sprintf (name, "L_%d", i%2); */
/* sprintf (txt , "C_Net0"); */
/* sprintf (src , "C_P%d", (i+2)%6); */
/* sprintf (dest, "C_P%d", (i+5)%6); */
/* sprintf (proc, "%d", i); */
/* sprintf (key , "%d", i); */
/* /\* Adding some communications *\/ */