pax_global_header00006660000000000000000000000064144642130770014522gustar00rootroot0000000000000052 comment=37a605235547e01c0d8ebe27a6a6f77443444450 gtg-trace-0.2-3/000077500000000000000000000000001446421307700134005ustar00rootroot00000000000000gtg-trace-0.2-3/AUTHORS000066400000000000000000000002721446421307700144510ustar00rootroot00000000000000 Francois Rue Francois Trahay Johnny Jazeix Kevin Coulomb Mathieu Faverge Olivier Lagrasse gtg-trace-0.2-3/COPYING000066400000000000000000000026701446421307700144400ustar00rootroot00000000000000Copyright © 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. gtg-trace-0.2-3/COPYRIGHT000066400000000000000000000525461446421307700147070ustar00rootroot00000000000000CeCILL-C FREE SOFTWARE LICENSE AGREEMENT Notice This Agreement is a Free Software license agreement that is the result of discussions between its authors in order to ensure compliance with the two main principles guiding its drafting: * firstly, compliance with the principles governing the distribution of Free Software: access to source code, broad rights granted to users, * secondly, the election of a governing law, French law, with which it is conformant, both as regards the law of torts and intellectual property law, and the protection that it offers to both authors and holders of the economic rights over software. The authors of the CeCILL-C (for Ce[a] C[nrs] I[nria] L[ogiciel] L[ibre]) license are: Commissariat ŕ l'Energie Atomique - CEA, a public scientific, technical and industrial research establishment, having its principal place of business at 25 rue Leblanc, immeuble Le Ponant D, 75015 Paris, France. Centre National de la Recherche Scientifique - CNRS, a public scientific and technological establishment, having its principal place of business at 3 rue Michel-Ange, 75794 Paris cedex 16, France. Institut National de Recherche en Informatique et en Automatique - INRIA, a public scientific and technological establishment, having its principal place of business at Domaine de Voluceau, Rocquencourt, BP 105, 78153 Le Chesnay cedex, France. Preamble The purpose of this Free Software license agreement is to grant users the right to modify and re-use the software governed by this license. The exercising of this right is conditional upon the obligation to make available to the community the modifications made to the source code of the software so as to contribute to its evolution. In consideration of access to the source code and the 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 only have limited liability. In this respect, the risks associated with loading, using, modifying and/or developing or reproducing the software by the user are brought to the user's attention, given its Free Software status, which may make it complicated to use, with the result that its use is reserved for developers and experienced professionals having in-depth computer knowledge. Users are therefore encouraged to load and test the suitability of the software 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 of security. This Agreement may be freely reproduced and published, provided it is not altered, and that no provisions are either added or removed herefrom. This Agreement may apply to any or all software for which the holder of the economic rights decides to submit the use thereof to its provisions. Article 1 - DEFINITIONS For the purpose of this Agreement, when the following expressions commence with a capital letter, they shall have the following meaning: Agreement: means this license agreement, and its possible subsequent versions and annexes. Software: means the software in its Object Code and/or Source Code form and, where applicable, its documentation, "as is" when the Licensee accepts the Agreement. Initial Software: means the Software in its Source Code and possibly its Object Code form and, where applicable, its documentation, "as is" when it is first distributed under the terms and conditions of the Agreement. Modified Software: means the Software modified by at least one Integrated Contribution. Source Code: means all the Software's instructions and program lines to which access is required so as to modify the Software. Object Code: means the binary files originating from the compilation of the Source Code. Holder: means the holder(s) of the economic rights over the Initial Software. Licensee: means the Software user(s) having accepted the Agreement. Contributor: means a Licensee having made at least one Integrated Contribution. Licensor: means the Holder, or any other individual or legal entity, who distributes the Software under the Agreement. Integrated Contribution: means any or all modifications, corrections, translations, adaptations and/or new functions integrated into the Source Code by any or all Contributors. Related Module: means a set of sources files including their documentation that, without modification to the Source Code, enables supplementary functions or services in addition to those offered by the Software. Derivative Software: means any combination of the Software, modified or not, and of a Related Module. Parties: mean both the Licensee and the Licensor. These expressions may be used both in singular and plural form. Article 2 - PURPOSE The purpose of the Agreement is the grant by the Licensor to the Licensee of a non-exclusive, transferable and worldwide license for the Software as set forth in Article 5 hereinafter for the whole term of the protection granted by the rights over said Software. Article 3 - ACCEPTANCE 3.1 The Licensee shall be deemed as having accepted the terms and conditions of this Agreement upon the occurrence of the first of the following events: * (i) loading the Software by any or all means, notably, by downloading from a remote server, or by loading from a physical medium; * (ii) the first time the Licensee exercises any of the rights granted hereunder. 3.2 One copy of the Agreement, containing a notice relating to the characteristics of the Software, to the limited warranty, and to the fact that its use is restricted to experienced users has been provided to the Licensee prior to its acceptance as set forth in Article 3.1 hereinabove, and the Licensee hereby acknowledges that it has read and understood it. Article 4 - EFFECTIVE DATE AND TERM 4.1 EFFECTIVE DATE The Agreement shall become effective on the date when it is accepted by the Licensee as set forth in Article 3.1. 4.2 TERM The Agreement shall remain in force for the entire legal term of protection of the economic rights over the Software. Article 5 - SCOPE OF RIGHTS GRANTED The Licensor hereby grants to the Licensee, who accepts, the following rights over the Software for any or all use, and for the term of the Agreement, on the basis of the terms and conditions set forth hereinafter. Besides, if the Licensor owns or comes to own one or more patents protecting all or part of the functions of the Software or of its components, the Licensor undertakes not to enforce the rights granted by these patents against successive Licensees using, exploiting or modifying the Software. If these patents are transferred, the Licensor undertakes to have the transferees subscribe to the obligations set forth in this paragraph. 5.1 RIGHT OF USE The Licensee is authorized to use the Software, without any limitation as to its fields of application, with it being hereinafter specified that this comprises: 1. permanent or temporary reproduction of all or part of the Software by any or all means and in any or all form. 2. loading, displaying, running, or storing the Software on any or all medium. 3. entitlement to observe, study or test its operation so as to determine the ideas and principles behind any or all constituent elements of said Software. This shall apply when the Licensee carries out any or all loading, displaying, running, transmission or storage operation as regards the Software, that it is entitled to carry out hereunder. 5.2 RIGHT OF MODIFICATION The right of modification includes the right to translate, adapt, arrange, or make any or all modifications to the Software, and the right to reproduce the resulting software. It includes, in particular, the right to create a Derivative Software. The Licensee is authorized to make any or all modification to the Software provided that it includes an explicit notice that it is the author of said modification and indicates the date of the creation thereof. 5.3 RIGHT OF DISTRIBUTION In particular, the right of distribution includes the right to publish, transmit and communicate the Software to the general public on any or all medium, and by any or all means, and the right to market, either in consideration of a fee, or free of charge, one or more copies of the Software by any means. The Licensee is further authorized to distribute copies of the modified or unmodified Software to third parties according to the terms and conditions set forth hereinafter. 5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION The Licensee is authorized to distribute true copies of the Software in Source Code or Object Code form, provided that said distribution complies with all the provisions of the Agreement and is accompanied by: 1. a copy of the Agreement, 2. a notice relating to the limitation of both the Licensor's warranty and liability as set forth in Articles 8 and 9, and that, in the event that only the Object Code of the Software is redistributed, the Licensee allows effective access to the full Source Code of the Software at a minimum during the entire period of its distribution of the Software, it being understood that the additional cost of acquiring the Source Code shall not exceed the cost of transferring the data. 5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE When the Licensee makes an Integrated Contribution to the Software, the terms and conditions for the distribution of the resulting Modified Software become subject to all the provisions of this Agreement. The Licensee is authorized to distribute the Modified Software, in source code or object code form, provided that said distribution complies with all the provisions of the Agreement and is accompanied by: 1. a copy of the Agreement, 2. a notice relating to the limitation of both the Licensor's warranty and liability as set forth in Articles 8 and 9, and that, in the event that only the object code of the Modified Software is redistributed, the Licensee allows effective access to the full source code of the Modified Software at a minimum during the entire period of its distribution of the Modified Software, it being understood that the additional cost of acquiring the source code shall not exceed the cost of transferring the data. 5.3.3 DISTRIBUTION OF DERIVATIVE SOFTWARE When the Licensee creates Derivative Software, this Derivative Software may be distributed under a license agreement other than this Agreement, subject to compliance with the requirement to include a notice concerning the rights over the Software as defined in Article 6.4. In the event the creation of the Derivative Software required modification of the Source Code, the Licensee undertakes that: 1. the resulting Modified Software will be governed by this Agreement, 2. the Integrated Contributions in the resulting Modified Software will be clearly identified and documented, 3. the Licensee will allow effective access to the source code of the Modified Software, at a minimum during the entire period of distribution of the Derivative Software, such that such modifications may be carried over in a subsequent version of the Software; it being understood that the additional cost of purchasing the source code of the Modified Software shall not exceed the cost of transferring the data. 5.3.4 COMPATIBILITY WITH THE CeCILL LICENSE When a Modified Software contains an Integrated Contribution subject to the CeCILL license agreement, or when a Derivative Software contains a Related Module subject to the CeCILL license agreement, the provisions set forth in the third item of Article 6.4 are optional. Article 6 - INTELLECTUAL PROPERTY 6.1 OVER THE INITIAL SOFTWARE The Holder owns the economic rights over the Initial Software. Any or all use of the Initial Software is subject to compliance with the terms and conditions under which the Holder has elected to distribute its work and no one shall be entitled to modify the terms and conditions for the distribution of said Initial Software. The Holder undertakes that the Initial Software will remain ruled at least by this Agreement, for the duration set forth in Article 4.2. 6.2 OVER THE INTEGRATED CONTRIBUTIONS The Licensee who develops an Integrated Contribution is the owner of the intellectual property rights over this Contribution as defined by applicable law. 6.3 OVER THE RELATED MODULES The Licensee who develops a Related Module is the owner of the intellectual property rights over this Related Module as defined by applicable law and is free to choose the type of agreement that shall govern its distribution under the conditions defined in Article 5.3.3. 6.4 NOTICE OF RIGHTS The Licensee expressly undertakes: 1. not to remove, or modify, in any manner, the intellectual property notices attached to the Software; 2. to reproduce said notices, in an identical manner, in the copies of the Software modified or not; 3. to ensure that use of the Software, its intellectual property notices and the fact that it is governed by the Agreement is indicated in a text that is easily accessible, specifically from the interface of any Derivative Software. The Licensee undertakes not to directly or indirectly infringe the intellectual property rights of the Holder and/or Contributors on the Software and to take, where applicable, vis-ŕ-vis its staff, any and all measures required to ensure respect of said intellectual property rights of the Holder and/or Contributors. Article 7 - RELATED SERVICES 7.1 Under no circumstances shall the Agreement oblige the Licensor to provide technical assistance or maintenance services for the Software. However, the Licensor is entitled to offer this type of services. The terms and conditions of such technical assistance, and/or such maintenance, shall be set forth in a separate instrument. Only the Licensor offering said maintenance and/or technical assistance services shall incur liability therefor. 7.2 Similarly, any Licensor is entitled to offer to its licensees, under its sole responsibility, a warranty, that shall only be binding upon itself, for the redistribution of the Software and/or the Modified Software, under terms and conditions that it is free to decide. Said warranty, and the financial terms and conditions of its application, shall be subject of a separate instrument executed between the Licensor and the Licensee. Article 8 - LIABILITY 8.1 Subject to the provisions of Article 8.2, the Licensee shall be entitled to claim compensation for any direct loss it may have suffered from the Software as a result of a fault on the part of the relevant Licensor, subject to providing evidence thereof. 8.2 The Licensor's liability is limited to the commitments made under this Agreement and shall not be incurred as a result of in particular: (i) loss due the Licensee's total or partial failure to fulfill its obligations, (ii) direct or consequential loss that is suffered by the Licensee due to the use or performance of the Software, and (iii) more generally, any consequential loss. In particular the Parties expressly agree that any or all pecuniary or business loss (i.e. loss of data, loss of profits, operating loss, loss of customers or orders, opportunity cost, any disturbance to business activities) or any or all legal proceedings instituted against the Licensee by a third party, shall constitute consequential loss and shall not provide entitlement to any or all compensation from the Licensor. Article 9 - WARRANTY 9.1 The Licensee acknowledges that the scientific and technical state-of-the-art when the Software was distributed did not enable all possible uses to be tested and verified, nor for the presence of possible defects to be detected. In this respect, the Licensee's attention has been drawn to the risks associated with loading, using, modifying and/or developing and reproducing the Software which are reserved for experienced users. The Licensee shall be responsible for verifying, by any or all means, the suitability of the product for its requirements, its good working order, and for ensuring that it shall not cause damage to either persons or properties. 9.2 The Licensor hereby represents, in good faith, that it is entitled to grant all the rights over the Software (including in particular the rights set forth in Article 5). 9.3 The Licensee acknowledges that the Software is supplied "as is" by the Licensor without any other express or tacit warranty, other than that provided for in Article 9.2 and, in particular, without any warranty as to its commercial value, its secured, safe, innovative or relevant nature. Specifically, the Licensor does not warrant that the Software is free from any error, that it will operate without interruption, that it will be compatible with the Licensee's own equipment and software configuration, nor that it will meet the Licensee's requirements. 9.4 The Licensor does not either expressly or tacitly warrant that the Software does not infringe any third party intellectual property right relating to a patent, software or any other property right. Therefore, the Licensor disclaims any and all liability towards the Licensee arising out of any or all proceedings for infringement that may be instituted in respect of the use, modification and redistribution of the Software. Nevertheless, should such proceedings be instituted against the Licensee, the Licensor shall provide it with technical and legal assistance for its defense. Such technical and legal assistance shall be decided on a case-by-case basis between the relevant Licensor and the Licensee pursuant to a memorandum of understanding. The Licensor disclaims any and all liability as regards the Licensee's use of the name of the Software. No warranty is given as regards the existence of prior rights over the name of the Software or as regards the existence of a trademark. Article 10 - TERMINATION 10.1 In the event of a breach by the Licensee of its obligations hereunder, the Licensor may automatically terminate this Agreement thirty (30) days after notice has been sent to the Licensee and has remained ineffective. 10.2 A Licensee whose Agreement is terminated shall no longer be authorized to use, modify or distribute the Software. However, any licenses that it may have granted prior to termination of the Agreement shall remain valid subject to their having been granted in compliance with the terms and conditions hereof. Article 11 - MISCELLANEOUS 11.1 EXCUSABLE EVENTS Neither Party shall be liable for any or all delay, or failure to perform the Agreement, that may be attributable to an event of force majeure, an act of God or an outside cause, such as defective functioning or interruptions of the electricity or telecommunications networks, network paralysis following a virus attack, intervention by government authorities, natural disasters, water damage, earthquakes, fire, explosions, strikes and labor unrest, war, etc. 11.2 Any failure by either Party, on one or more occasions, to invoke one or more of the provisions hereof, shall under no circumstances be interpreted as being a waiver by the interested Party of its right to invoke said provision(s) subsequently. 11.3 The Agreement cancels and replaces any or all previous agreements, whether written or oral, between the Parties and having the same purpose, and constitutes the entirety of the agreement between said Parties concerning said purpose. No supplement or modification to the terms and conditions hereof shall be effective as between the Parties unless it is made in writing and signed by their duly authorized representatives. 11.4 In the event that one or more of the provisions hereof were to conflict with a current or future applicable act or legislative text, said act or legislative text shall prevail, and the Parties shall make the necessary amendments so as to comply with said act or legislative text. All other provisions shall remain effective. Similarly, invalidity of a provision of the Agreement, for any reason whatsoever, shall not cause the Agreement as a whole to be invalid. 11.5 LANGUAGE The Agreement is drafted in both French and English and both versions are deemed authentic. Article 12 - NEW VERSIONS OF THE AGREEMENT 12.1 Any person is authorized to duplicate and distribute copies of this Agreement. 12.2 So as to ensure coherence, the wording of this Agreement is protected and may only be modified by the authors of the License, who reserve the right to periodically publish updates or new versions of the Agreement, each with a separate number. These subsequent versions may address new issues encountered by Free Software. 12.3 Any Software distributed under a given version of the Agreement may only be subsequently distributed under the same version of the Agreement or a subsequent version. Article 13 - GOVERNING LAW AND JURISDICTION 13.1 The Agreement is governed by French law. The Parties agree to endeavor to seek an amicable solution to any disagreements or disputes that may arise during the performance of the Agreement. 13.2 Failing an amicable solution within two (2) months as from their occurrence, and unless emergency proceedings are necessary, the disagreements or disputes shall be referred to the Paris Courts having jurisdiction, by the more diligent Party. Version 1.0 dated 2006-09-05. gtg-trace-0.2-3/ChangeLog000066400000000000000000000003621446421307700151530ustar00rootroot00000000000000Version 0.2 ----------- * Events can now be recorded out of order * Add an AddComment function (not implemented for OTF files) * Improved Vampir/Triva compatibility * Paje traces can now be compressed Version 0.1 ----------- * First release gtg-trace-0.2-3/Makefile.am000066400000000000000000000005311446421307700154330ustar00rootroot00000000000000SUBDIRS = extlib/ inc/ src/ if WITHDOC SUBDIRS += doc endif #WITHDOC 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 gtg-trace-0.2-3/NEWS000066400000000000000000000000001446421307700140650ustar00rootroot00000000000000gtg-trace-0.2-3/README000066400000000000000000000051321446421307700142610ustar00rootroot00000000000000============================================== === 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 Git 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 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 fill an issue (https://github.com/trahay/Generic-Trace-Generator/issues) so that we can fix the feature as soon as possible. You can also give us some feedback to help us improve the API. gtg-trace-0.2-3/ROADMAP000066400000000000000000000006761446421307700144170ustar00rootroot00000000000000Here are listed all the ideas that people can have (bearing with GTG if possible). - Support other formats : TAU, CLOG (and derivated) (maybe ideas here : http://www.netlib.org/utk/people/JackDongarra/PAPERS/perftools-review2.pdf) - Clean OTF code :D. Use dynamic allocation instead of static with #define. - Do an error interface. - Test with g++. - Make tests. - Add a rabbit logo. - Add a higher level interface. - Is GTG thread safe ?gtg-trace-0.2-3/configure.ac000066400000000000000000000210531446421307700156670ustar00rootroot00000000000000# 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.2-3], [https://github.com/trahay/Generic-Trace-Generator/issues]) AM_INIT_AUTOMAKE([1.10 subdir-objects]) # Checks for programs. AC_PROG_CC AC_PROG_F77 AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_LIBTOOL AM_PROG_CC_C_O # 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 build_doc=no AC_ARG_WITH(doc, [AS_HELP_STRING([--with-doc], [Generate documentation])], [if test x$withval != xno ; then build_doc=yes fi], [build_doc=no]) if test "x$build_doc" = "xyes" ; then AC_MSG_RESULT(Documentation will be generated) else AC_MSG_RESULT(Documentation will not be generated) fi use_libz=yes AC_ARG_WITH(libz, [AS_HELP_STRING([--with-libz[=]], [Enable libZ])], [ if test x$withval != xno; then use_libz=yes else use_libz=no fi ]) if [ test $use_libz = yes ]; then AC_CHECK_LIB(z, deflate, have_libz=yes) fi AM_CONDITIONAL([HAVE_LIBZ], [ test "x$have_libz" = xyes]) # 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[=]], [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$F77 = 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[=]], [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[=]], [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[=]], [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[=]], [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]) AM_CONDITIONAL([WITHDOC], [test "$build_doc" = "yes"]) AC_CONFIG_SUBDIRS([extlib/otf]) AC_OUTPUT([Makefile \ gtg.pc \ extlib/Makefile \ inc/Makefile \ src/Makefile \ doc/Makefile \ doc/Doxyfile]) gtg-trace-0.2-3/doc/000077500000000000000000000000001446421307700141455ustar00rootroot00000000000000gtg-trace-0.2-3/doc/Doxyfile.in000066400000000000000000001563501446421307700162720ustar00rootroot00000000000000# Doxyfile 1.5.5 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # This tag specifies the encoding used for all characters in the config file # that follow. The default is UTF-8 which is also the encoding used for all # text before the first occurrence of this tag. Doxygen uses libiconv (or the # iconv built into libc) for the transcoding. See # http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = "Generic Trace Generator (GTG)" # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = 0.1 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = . # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, # Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek, # Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages), # Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish, # Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, Swedish, # and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like regular Qt-style comments # (thus requiring an explicit @brief command for a brief description.) JAVADOC_AUTOBRIEF = NO # If the QT_AUTOBRIEF tag is set to YES then Doxygen will # interpret the first line (until the first dot) of a Qt-style # comment as the brief description. If set to NO, the comments # will behave just like regular Qt-style comments (thus requiring # an explicit \brief command for a brief description.) QT_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the DETAILS_AT_TOP tag is set to YES then Doxygen # will output the detailed description near the top, like JavaDoc. # If set to NO, the detailed description appears after the member # documentation. DETAILS_AT_TOP = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = YES # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java # sources only. Doxygen will then generate output that is more tailored for # Java. For instance, namespaces will be presented as packages, qualified # scopes will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran # sources only. Doxygen will then generate output that is more tailored for # Fortran. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL # sources. Doxygen will then generate output that is tailored for # VHDL. OPTIMIZE_OUTPUT_VHDL = NO # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want # to include (a tag file for) the STL sources as input, then you should # set this tag to YES in order to let doxygen match functions declarations and # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. # func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. BUILTIN_STL_SUPPORT = NO # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. CPP_CLI_SUPPORT = NO # Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. # Doxygen will parse them like normal C++ but will assume all classes use public # instead of private inheritance when no explicit protection keyword is present. SIP_SUPPORT = NO # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES # When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum # is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, # namespace, or class. And the struct will be named TypeS. This can typically # be useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. TYPEDEF_HIDES_STRUCT = NO #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = YES # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = YES # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called # 'anonymous_namespace{file}', where file will be replaced with the base # name of the file that contains the anonymous namespace. By default # anonymous namespace are hidden. EXTRACT_ANON_NSPACES = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the # hierarchy of group names into alphabetical order. If set to NO (the default) # the group names will appear in their defined order. SORT_GROUP_NAMES = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is NO. SHOW_DIRECTORIES = NO # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the program writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = YES # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = "$file:$line: $text" # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = "@srcdir@/../inc/" "@srcdir@/../src/FORTRAN/" # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is # also the default input encoding. Doxygen uses libiconv (or the iconv built # into libc) for the transcoding. See http://www.gnu.org/software/libiconv for # the list of possible encodings. INPUT_ENCODING = UTF-8 # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 FILE_PATTERNS = *.h *.f90 # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = NO # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names # (namespaces, classes, functions, etc.) that should be excluded from the # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test EXCLUDE_SYMBOLS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = YES # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = NO # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = NO # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will # link to the source code. Otherwise they will link to the documentstion. REFERENCES_LINK_SOURCE = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = NO # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 5 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = html # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compiled HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_DOCSET tag is set to YES, additional index files # will be generated that can be used as input for Apple's Xcode 3 # integrated development environment, introduced with OSX 10.5 (Leopard). # To create a documentation set, doxygen will generate a Makefile in the # HTML output directory. Running make will produce the docset in that # directory and running "make install" will install the docset in # ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find # it at startup. GENERATE_DOCSET = NO # When GENERATE_DOCSET tag is set to YES, this tag determines the name of the # feed. A documentation feed provides an umbrella under which multiple # documentation sets from a single provider (such as a company or product suite) # can be grouped. DOCSET_FEEDNAME = "Doxygen generated docs" # When GENERATE_DOCSET tag is set to YES, this tag specifies a string that # should uniquely identify the documentation set bundle. This should be a # reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen # will append .docset to the name. DOCSET_BUNDLE_ID = org.doxygen.Project # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the # page has loaded. For this to work a browser that supports # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). HTML_DYNAMIC_SECTIONS = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = NO # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = YES # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = latex # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = YES # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = YES # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = rtf # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = man # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = .3 # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = NO # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_DEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # You can define message sequence charts within doxygen comments using the \msc # command. Doxygen will then run the mscgen tool (see # http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the # documentation. The MSCGEN_PATH tag allows you to specify the directory where # the mscgen tool resides. If left empty the tool is assumed to be found in the # default search path. MSCGEN_PATH = # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = NO # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT options are set to YES then # doxygen will generate a call dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable call graphs # for selected functions only using the \callgraph command. CALL_GRAPH = NO # If the CALLER_GRAPH and HAVE_DOT tags are set to YES then # doxygen will generate a caller dependency graph for every global function # or class method. Note that enabling this option will significantly increase # the time of a run. So in most cases it will be better to enable caller # graphs for selected functions only using the \callergraph command. CALLER_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of # nodes that will be shown in the graph. If the number of nodes in a graph # becomes larger than this value, doxygen will truncate the graph, which is # visualized by representing a node as a red box. Note that doxygen if the # number of direct children of the root node in a graph is already larger than # DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. DOT_GRAPH_MAX_NODES = 50 # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that the size of a graph can be further restricted by # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is enabled by default, which results in a transparent # background. Warning: Depending on the platform used, enabling this option # may lead to badly anti-aliased labels on the edges of a graph (i.e. they # become hard to read). DOT_TRANSPARENT = YES # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO gtg-trace-0.2-3/doc/Makefile.am000066400000000000000000000032311446421307700162000ustar00rootroot00000000000000# 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)/gtg_refmanual.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 $(DESTDIR)$(htmldir) cp -r $(DOX_HTML_DIR) $(DESTDIR)$(htmldir) install_pdf: $(DOX_PDF) mkdir -p $(DESTDIR)$(pdfdir) cp -r $(DOX_PDF) $(DESTDIR)$(pdfdir) if USE_PDFLATEX install-data-am: install_pdf install_html else install-data-am: install_html endif include_HEADERS = Doxyfile endif gtg-trace-0.2-3/doc/userMan/000077500000000000000000000000001446421307700155575ustar00rootroot00000000000000gtg-trace-0.2-3/doc/userMan/Makefile000066400000000000000000000001421446421307700172140ustar00rootroot00000000000000all : pdflatex userMan.tex pdflatex userMan.tex clean : rm -f *~ *.aux *.toc gtg-trace-0.2-3/doc/userMan/licence.tex000077500000000000000000000030251446421307700177060ustar00rootroot00000000000000\section{Licence}\label{Licence} \GTG{} is under the licence \emph{CeCILL-C}. \medskip This software is governed by the \emph{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 \emph{CeCILL-C} license as circulated by \emph{CEA}, \emph{CNRS} and \emph{INRIA} at the following URL: \url{http://www.cecill.info}. \medskip 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. \medskip 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. \medskip The fact that you are presently reading this means that you have had knowledge of the \emph{CeCILL-C} license and that you accept its terms. gtg-trace-0.2-3/doc/userMan/project.tex000066400000000000000000000030231446421307700177450ustar00rootroot00000000000000\section{Presentation} The \GTG{} letters stand for Generic Trace Generator. The project comes from the authors of two INRIA projects, \eztrace{} that needed a good way to write traces and \ViTE{} that needed an easy way to generate traces. \GTG{} is a library that offers a simple and clear generic interface to write down traces in various formats (currently \paje{} and \OTF). \subsection{Authors} The authors of the project are~: \begin{itemize} \item Fran\c cois Rue \item Fran\c cois Trahay \item Olivier Lagrasse \item Johnny Jazeix \item Kevin Coulomb \end{itemize} If you find some bugs or have some feedbacks, please fill an issue at \href{https://github.com/trahay/Generic-Trace-Generator/issues}{\nolinkurl{https://github.com/trahay/Generic-Trace-Generator/issues}}. We will try to fix it as soon as possible. \subsection{\eztrace} \eztrace{} is a powerful tool, under CeCILL-B licence, to dynamically generate traces of parallel executions. The current version enables to have information on MPI calls, on pthread calls and use. The roadmap foresees to be able to trace any user define calls. The project is available at \url{https://eztrace.gitlab.io/eztrace/}. \subsection{\ViTE{}} The \ViTE{} (Visual Trace Explorer) project, under \href{http://www.cecill.info/licences/Licence_CeCILL_V2-en.html}{\textit{CeCILL-A}} licence, is made to easily and simply view and analyze traces in various formats (\paje{}, \OTF{} plus \TAU{} that will be added soon). The project is available at \url{https://gitlab.inria.fr/solverstack/vite/}. gtg-trace-0.2-3/doc/userMan/use.tex000066400000000000000000000017761446421307700171100ustar00rootroot00000000000000\section{Using the \GTG{} library} The \GTG{} library provides a generic interface to write down traces. Users are advised to use the generic calls (in the \textsc{GTGBasic} file) instead of using the specifics one (OTF\_*, PAJE\_*). There are some steps that must be followed to use the library~: \begin{itemize} \item First, one should choose the kind of trace to create \item Then, the init function has to be called \item \textcolor{red}{Warning, Changing the kind of trace to generate after the initialization has to result in an undefined behavior (mostly segfault)} \item Call all the trace writting functions \item You must end with the finalize call to clean the internal memory \end{itemize} Another useful interface is the color one, to customize the states information, one can set color to the states. The color API defines colors, but the user can create his own color using a RGB format. Some examples of using the API are provided within the \textit{exm} directory in the package. gtg-trace-0.2-3/doc/userMan/userMan.tex000066400000000000000000000014661446421307700177220ustar00rootroot00000000000000\documentclass{article} \usepackage[english]{babel} \usepackage{url} \usepackage{color} \usepackage[colorlinks=true]{hyperref} \hypersetup{urlcolor=blue,linkcolor=black,citecolor=black,colorlinks=true} \begin{document} \noindent {\Huge\bfseries \textit{GTG} \hspace{\stretch{1}}}\\ \rule[1ex]{\textwidth}{1pt}\\[1ex] \textsf{\Large \hspace{\stretch{1}} \today}\\ \vspace{\stretch{2}} %%%%%%%%%%%%%%% \begin{center} { \Huge\bfseries\center User Manual \medskip \Large\bfseries\center Release 0.1 } %%%%%%%%%%%%%%% \vspace{\stretch{2}} \end{center} \tableofcontents \newcommand\ViTE{\emph{ViTE}} \newcommand\eztrace{\emph{EzTrace}} \newcommand\GTG{\emph{GTG}} \newcommand\paje{\emph{Paje}} \newcommand\OTF{\emph{OTF}} \newcommand\TAU{\emph{TAU}} \input{licence} \input{project} \input{use} \end{document} gtg-trace-0.2-3/exm/000077500000000000000000000000001446421307700141715ustar00rootroot00000000000000gtg-trace-0.2-3/exm/Makefile000066400000000000000000000011141446421307700156260ustar00rootroot00000000000000BIN= 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 *eptgtg-trace-0.2-3/exm/gtg_color.c000066400000000000000000000045331446421307700163210ustar00rootroot00000000000000#include #include #include int main (int argc, char** argv){ (void) argc; (void) 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); free(nodeState); } endTrace (); return EXIT_SUCCESS; } gtg-trace-0.2-3/exm/otf_example.c000066400000000000000000000124211446421307700166400ustar00rootroot00000000000000/* * Small example to generate a trace in the otf format * Author Kevin Coulomb and Johnny Jazeix */ #define _GNU_SOURCE #include #include #include #include /* 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 use gtg_f implicit none real (8) :: time real (8) :: val integer :: ierr integer :: buf = 0 !! Init call setTraceType_f (PAJE, buf) call initTrace_f ("fpaje", ierr) !! Creating proc types call addContType_f ("CT_NET", "0", "Network", ierr) call addContType_f ("CT_NODE", "CT_NET", "Node", ierr) call addContType_f ("CT_PROC", "CT_NODE", "Proc", ierr) !! Creating state types call addStateType_f ("ST_NodeState", "CT_NODE", "Node state", ierr) call addStateType_f ("ST_ProcState", "CT_PROC", "Procstate", ierr) !! Creating Entity value types call addEntityValue_f ("SN_0", "ST_NodeState", "Sleep", P_RED, ierr) call addEntityValue_f ("SN_1", "ST_NodeState", "WaitLocal",& & P_BLUE, ierr) call addEntityValue_f ("SN_2", "ST_NodeState", "WaitDistant", & & P_GREEN, ierr) call addEntityValue_f ("SP_3", "ST_ProcState", "Produit", P_DARKPINK,& & ierr) call addEntityValue_f ("SP_4", "ST_ProcState", "Somme", P_BROWN, ierr) call addEntityValue_f ("SP_5", "ST_ProcState", "Difference",& & P_ORANGE, ierr) !! Creating link types call addLinkType_f ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC", & & ierr) call addLinkType_f ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC", & & ierr) !! Creating var type call addVarType_f ("V_Mem", "Memoire", "CT_NODE", ierr) !! Creating event types call addEventType_f ("E_0", "CT_PROC", "Lapin", ierr) call addEventType_f ("E_1", "CT_PROC", "Chocolat", ierr) time = 0.000000000000 !! Adding containers call addContainer_f (time, "C_Net0", "CT_NET", "0", "Ensemble0", "0",& & ierr) call addContainer_f (time, "C_N0", "CT_NODE", "C_Net0", "Node0", "0",& & ierr) call addContainer_f (time, "C_P0", "CT_PROC", "C_N0", "Proc0", "0", & & ierr) call addContainer_f (time, "C_P1", "CT_PROC", "C_N0", "Proc1", "0", & & ierr) call addContainer_f (time, "C_P2", "CT_PROC", "C_N0", "Proc2", "0", & & ierr) call addContainer_f (time, "C_N1", "CT_NODE", "C_Net0", "Node1", "0",& & ierr) call addContainer_f (time, "C_P3", "CT_PROC", "C_N1", "Proc3", "0", & & ierr) call addContainer_f (time, "C_P4", "CT_PROC", "C_N1", "Proc4", "0", & & ierr) call addContainer_f (time, "C_P5", "CT_PROC", "C_N1", "Proc5", "0", & & ierr) !! Setting var, events states, links on proc/nodes time = 0.0111742 val = 1.0 call setVar_f (time, "V_Mem", "C_N0", val, ierr) time = 0.0211 call setState_f (time, "ST_NodeState", "C_N1", "SN_1", ierr) time = 0.0212742 call setState_f (time, "ST_NodeState", "C_N0", "SN_0", ierr) time = 0.0214742 val = 2.0 call setVar_f (time, "V_Mem", "C_N0", val, ierr) time = 0.0311742 call setState_f (time, "ST_NodeState", "C_N1", "SN_2", ierr) time = 0.0411742 call setState_f (time, "ST_NodeState", "C_N0", "SN_1", ierr) time = 0.0311742 val = 3.0 call setVar_f (time, "V_Mem", "C_N0", val, ierr) time = 0.0411742 val = 1.0 call setVar_f (time, "V_Mem", "C_N1", val, ierr) time = 0.0511742 call setState_f (time, "ST_NodeState", "C_N1", "SN_0", ierr) time = 0.0511742 val = 2.0 call setVar_f (time, "V_Mem", "C_N1", val, ierr) time = 0.0611742 call setState_f (time, "ST_NodeState", "C_N0", "SN_2", ierr) time = 0.0611742 val = 3.0 call setVar_f (time, "V_Mem", "C_N1", val, ierr) time = 0.0151742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.0161742 call setState_f (time, "ST_ProcState", "C_P1", "SP_3", ierr) time = 0.0161742 call setState_f (time, "ST_ProcState", "C_P0", "SP_5", ierr) time = 0.0171742 call setState_f (time, "ST_ProcState", "C_P3", "SP_5", ierr) time = 0.0171742 call setState_f (time, "ST_ProcState", "C_P4", "SP_3", ierr) time = 0.0181742 call setState_f (time, "ST_ProcState", "C_P5", "SP_4", ierr) time = 0.0181742 call setState_f (time, "ST_ProcState", "C_P2", "SP_3", ierr) time = 0.0191742 call setState_f (time, "ST_ProcState", "C_P3", "SP_4", ierr) time = 0.0191742 call setState_f (time, "ST_ProcState", "C_P1", "SP_4", ierr) time = 0.0111742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.0111742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.0211742 call setState_f (time, "ST_ProcState", "C_P5", "SP_4", ierr) time = 0.0211742 call setState_f (time, "ST_ProcState", "C_P4", "SP_5", ierr) time = 0.0311742 call setState_f (time, "ST_ProcState", "C_P3", "SP_5", ierr) time = 0.0311742 call setState_f (time, "ST_ProcState", "C_P2", "SP_5", ierr) time = 0.0411742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.0411742 call setState_f (time, "ST_ProcState", "C_P1", "SP_3", ierr) time = 0.0511742 call setState_f (time, "ST_ProcState", "C_P1", "SP_4", ierr) time = 0.0511742 call setState_f (time, "ST_ProcState", "C_P2", "SP_4", ierr) time = 0.0611742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.0611742 call setState_f (time, "ST_ProcState", "C_P3", "SP_3", ierr) time = 0.0711742 call setState_f (time, "ST_ProcState", "C_P0", "SP_4", ierr) time = 0.0711742 call setState_f (time, "ST_ProcState", "C_P5", "SP_5", ierr) time = 0.0811742 call setState_f (time, "ST_ProcState", "C_P4", "SP_5", ierr) time = 0.0811742 call setState_f (time, "ST_ProcState", "C_P2", "SP_4", ierr) time = 0.0911742 call setState_f (time, "ST_ProcState", "C_P0", "SP_3", ierr) time = 0.02 call startLink_f (time, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0", & & ierr) time = 0.03 call startLink_f (time, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1", & & ierr) time = 0.04 call startLink_f (time, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2", & & ierr) time = 0.05 call startLink_f (time, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3", & & ierr) time = 0.03 call endLink_f (time, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0", & & ierr) time = 0.04 call endLink_f (time, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1", & & ierr) time = 0.05 call endLink_f (time, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2", & & ierr) time = 0.06 call endLink_f (time, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3", & & ierr) time = 0.02 call addEvent_f (time, "E_0", "C_P0", "11", ierr) time = 0.05 call addEvent_f (time, "E_0", "C_P2", "10", ierr) time = 0.07 call addEvent_f (time, "E_1", "C_P1", "1", ierr) time = 0.08 call addEvent_f (time, "E_1", "C_P5", "3", ierr) !! Cleaning call endTrace_f (ierr) end program main gtg-trace-0.2-3/exm/paje_example.c000066400000000000000000000111741446421307700167730ustar00rootroot00000000000000#include #include #include int main (int argc, char** argv){ (void) argc; (void) argv; setTraceType (PAJE); initTrace ("cpaje", 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", "Sleep", GTG_LIGHTPINK); addEntityValue ("SN_1", "ST_NodeState", "WaitLocal", GTG_PINK); addEntityValue ("SN_2", "ST_NodeState", "WaitDistant", GTG_BLUE); addEntityValue ("SP_3", "ST_ProcState", "Produit", GTG_ORANGE); addEntityValue ("SP_4", "ST_ProcState", "Somme", GTG_GREEN); addEntityValue ("SP_5", "ST_ProcState", "Difference", GTG_BLACK); addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC"); addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC"); addVarType ("V_Mem", "Memoire", "CT_NODE"); addEventType ("E_0", "CT_PROC", "Lapin"); addEventType ("E_1", "CT_PROC", "Chocolat"); 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"); addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", "0"); addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", "0"); addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "0"); addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", "0"); addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", "0"); addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", "0"); setVar (0.0111742, "V_Mem", "C_N0", 1.0000000); setState (0.01120000, "ST_NodeState", "C_N1", "SN_1"); setState (0.02121000, "ST_NodeState", "C_N0", "SN_0"); setVar (0.0212742, "V_Mem", "C_N0", 2.0000000); setState (0.03122000, "ST_NodeState", "C_N1", "SN_2"); setState (0.04123000, "ST_NodeState", "C_N0", "SN_1"); setVar (0.0313742, "V_Mem", "C_N0", 3.0000000); setVar (0.0414742, "V_Mem", "C_N1", 1.0000000); setState (0.05124000, "ST_NodeState", "C_N1", "SN_0"); setVar (0.0515742, "V_Mem", "C_N1", 2.0000000); setState (0.06124500, "ST_NodeState", "C_N0", "SN_2"); setVar (0.0616742, "V_Mem", "C_N1", 3.0000000); setState (0.00130000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00140000, "ST_ProcState", "C_P1", "SP_3"); setState (0.00150000, "ST_ProcState", "C_P0", "SP_5"); setState (0.00160000, "ST_ProcState", "C_P3", "SP_5"); setState (0.00170000, "ST_ProcState", "C_P4", "SP_3"); setState (0.00180000, "ST_ProcState", "C_P5", "SP_4"); setState (0.00190000, "ST_ProcState", "C_P2", "SP_3"); setState (0.00200000, "ST_ProcState", "C_P3", "SP_4"); setState (0.00210000, "ST_ProcState", "C_P1", "SP_4"); setState (0.00230000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00330000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00430000, "ST_ProcState", "C_P5", "SP_4"); setState (0.00530000, "ST_ProcState", "C_P4", "SP_5"); setState (0.00630000, "ST_ProcState", "C_P3", "SP_5"); setState (0.00730000, "ST_ProcState", "C_P2", "SP_5"); setState (0.00830000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00930000, "ST_ProcState", "C_P1", "SP_3"); setState (0.01030000, "ST_ProcState", "C_P1", "SP_4"); setState (0.02130000, "ST_ProcState", "C_P2", "SP_4"); setState (0.03130000, "ST_ProcState", "C_P0", "SP_3"); setState (0.04130000, "ST_ProcState", "C_P3", "SP_3"); setState (0.05130000, "ST_ProcState", "C_P0", "SP_4"); setState (0.06130000, "ST_ProcState", "C_P5", "SP_5"); setState (0.07130000, "ST_ProcState", "C_P4", "SP_2"); setState (0.08130000, "ST_ProcState", "C_P2", "SP_4"); setState (0.09130000, "ST_ProcState", "C_P0", "SP_3"); startLink (0.020000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0"); startLink (0.030000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1"); startLink (0.040000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2"); startLink (0.050000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3"); endLink (0.030000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0"); endLink (0.040000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1"); endLink (0.050000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2"); endLink (0.060000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3"); addEvent (0.030000, "E_0", "C_P0", "11"); addEvent (0.050000, "E_0", "C_P2", "10"); addEvent (0.070000, "E_1", "C_P1", "1"); addEvent (0.090000, "E_1", "C_P5", "3"); endTrace (); return EXIT_SUCCESS; } gtg-trace-0.2-3/exm/paje_example2.c000066400000000000000000000116171446421307700170570ustar00rootroot00000000000000/* * Small example to generate a trace in the Paje format * Author Kevin Coulomb */ #include #include #include #include #include /* 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 #include #include int main (int argc, char** argv){ int rk; MPI_Init (&argc, &argv); MPI_Comm_rank (MPI_COMM_WORLD, &rk); setTraceType (VITE, BUFF); setComm (MPI_COMM_WORLD); initTrace ("cvite"); if (rk==0){ 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", "Sleep", "0.5 0.5 0.5"); addEntityValue ("SN_1", "ST_NodeState", "WaitLocal", "0.0 0.5 0.9"); addEntityValue ("SN_2", "ST_NodeState", "WaitDistant", "0.9 0.5 0.0"); addEntityValue ("SP_3", "ST_ProcState", "Produit", "0.5 0.9 0.0"); addEntityValue ("SP_4", "ST_ProcState", "Somme", "0.9 0.9 0.0"); addEntityValue ("SP_5", "ST_ProcState", "Difference", "0.1 0.5 0.4"); addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC"); addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC"); addVarType ("V_Mem", "Memoire", "CT_NODE"); addEventType ("E_0", "CT_PROC", "Lapin"); addEventType ("E_1", "CT_PROC", "Chocolat"); 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_N1", "CT_NODE", "C_Net0", "Node1", "0"); addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", "cvite_proc0"); addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", "cvite_proc1"); addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", "cvite_proc2"); addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", "cvite_proc3"); addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", "cvite_proc4"); addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", "cvite_proc5"); } setVar (0.0111742, "V_Mem", "C_N0", 1.0000000); setState (0.01120000, "ST_NodeState", "C_N1", "SN_1"); setState (0.02121000, "ST_NodeState", "C_N0", "SN_0"); setVar (0.0212742, "V_Mem", "C_N0", 2.0000000); setState (0.03122000, "ST_NodeState", "C_N1", "SN_2"); setState (0.04123000, "ST_NodeState", "C_N0", "SN_1"); setVar (0.0313742, "V_Mem", "C_N0", 3.0000000); setVar (0.0414742, "V_Mem", "C_N1", 1.0000000); setState (0.05124000, "ST_NodeState", "C_N1", "SN_0"); setVar (0.0515742, "V_Mem", "C_N1", 2.0000000); setState (0.06124500, "ST_NodeState", "C_N0", "SN_2"); setVar (0.0616742, "V_Mem", "C_N1", 3.0000000); switch (rk){ case 0: setState (0.00130000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00150000, "ST_ProcState", "C_P0", "SP_5"); setState (0.00230000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00330000, "ST_ProcState", "C_P0", "SP_3"); setState (0.00830000, "ST_ProcState", "C_P0", "SP_3"); setState (0.03130000, "ST_ProcState", "C_P0", "SP_3"); setState (0.05130000, "ST_ProcState", "C_P0", "SP_4"); setState (0.09130000, "ST_ProcState", "C_P0", "SP_3"); startLink (0.040000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2"); endLink (0.050000, "L_0", "C_Net0", "C_P0", "C_P5", "14", "2"); addEvent (0.030000, "E_0", "C_P0", "11"); break; case 1 : setState (0.00140000, "ST_ProcState", "C_P1", "SP_3"); setState (0.00210000, "ST_ProcState", "C_P1", "SP_4"); setState (0.00930000, "ST_ProcState", "C_P1", "SP_3"); setState (0.01030000, "ST_ProcState", "C_P1", "SP_4"); addEvent (0.070000, "E_1", "C_P1", "1"); break; case 3 : setState (0.00160000, "ST_ProcState", "C_P3", "SP_5"); setState (0.00200000, "ST_ProcState", "C_P3", "SP_4"); setState (0.00630000, "ST_ProcState", "C_P3", "SP_5"); setState (0.04130000, "ST_ProcState", "C_P3", "SP_3"); startLink (0.050000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3"); endLink (0.060000, "L_1", "C_Net0", "C_P3", "C_P1", "15", "3"); break; case 4 : setState (0.00170000, "ST_ProcState", "C_P4", "SP_3"); setState (0.00530000, "ST_ProcState", "C_P4", "SP_5"); setState (0.07130000, "ST_ProcState", "C_P4", "SP_5"); startLink (0.030000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1"); endLink (0.030000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0"); break; case 5 : setState (0.00180000, "ST_ProcState", "C_P5", "SP_4"); setState (0.00430000, "ST_ProcState", "C_P5", "SP_4"); setState (0.06130000, "ST_ProcState", "C_P5", "SP_5"); addEvent (0.090000, "E_1", "C_P5", "3"); break; case 2 : setState (0.00190000, "ST_ProcState", "C_P2", "SP_3"); setState (0.00730000, "ST_ProcState", "C_P2", "SP_5"); setState (0.02130000, "ST_ProcState", "C_P2", "SP_4"); setState (0.08130000, "ST_ProcState", "C_P2", "SP_4"); startLink (0.020000, "L_0", "C_Net0", "C_P2", "C_P4", "12", "0"); endLink (0.040000, "L_1", "C_Net0", "C_P4", "C_P2", "13", "1"); addEvent (0.050000, "E_0", "C_P2", "10"); break; default : break; } endTrace (); MPI_Finalize (); return EXIT_SUCCESS; } gtg-trace-0.2-3/extlib/000077500000000000000000000000001446421307700146675ustar00rootroot00000000000000gtg-trace-0.2-3/extlib/Makefile.am000066400000000000000000000000751446421307700167250ustar00rootroot00000000000000 if DONT_USE_INTERNAL_OTF SUBDIRS = else SUBDIRS = otf endif gtg-trace-0.2-3/gtg.pc.in000066400000000000000000000003121446421307700151060ustar00rootroot00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: GTG Description: GTG - Generic Trace Generator Version: @VERSION@ Libs: -L${libdir} -lgtg Cflags: -I${includedir}gtg-trace-0.2-3/inc/000077500000000000000000000000001446421307700141515ustar00rootroot00000000000000gtg-trace-0.2-3/inc/GTG.h000066400000000000000000000017341446421307700147500ustar00rootroot00000000000000/** * \file GTG.h * \brief Generic header to include * \authors * Developpers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * * * \mainpage The GTG library * * (\\/) \n * (*-*) \n * (")(") \n * * \section Presentation * The GTG library provides a low level library to generate traces in various formats (Paje, OTF). \n * The use of the library is simple, you just need to include the GTG.h header * and then you can use the library as you wish. \n * Some simple examples are available in the test directory. \n * */ #ifndef _GTG_H_ #define _GTG_H_ #include #include "GTGTypes.h" #include "GTGColor.h" #include "GTGBasic.h" #endif /* _GTG_H_ */ gtg-trace-0.2-3/inc/GTGBasic.h000066400000000000000000000354141446421307700157140ustar00rootroot00000000000000/** * \file GTGBasic.h * \version 0.1 * \brief * * GTGBasic is a basic interface to generate trace in various formats. * * \authors * Developers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * * It has been initiated in 2010 by *eztrace* and *ViTE* projects * that both needs a good library to generate traces. * */ #ifndef _GTG_BASIC_H_ #define _GTG_BASIC_H_ #include #include #include "GTGColor.h" #include "GTGTypes.h" /** * \brief No flag specified. */ #define GTG_FLAG_NONE 0 /** * \brief Several MPI processes are currently using GTG. */ #define GTG_FLAG_USE_MPI 1 /** * \brief For writing the traces in a non-buffered mode. */ #define GTG_FLAG_NOTBUF 2 /** * \brief Allow the application to record events out of order */ #define GTG_FLAG_OUTOFORDER 4 /** * \brief For writing events in separate files (one file per container) */ #define GTG_FLAG_PAJE_MULTIPLE_FILES 8 /** * \brief Flags that can be specified to GTG. */ typedef uint8_t gtg_flag_t; /** * \defgroup traceType Trace type handler */ /** * \ingroup traceType * \enum traceType * \brief The type of the output trace. * */ typedef enum traceType{ PAJE, /*!< Paje trace format. */ VITE, /*!< ViTE-specific trace format. */ OTF, /*!< OTF trace format. */ TAU /*!< TAU Trace format. */ }traceType_t; /** * \ingroup traceType * \fn void setTraceType (traceType_t type) * \brief Set the type of output trace. * \param type Type of trace to generate */ void setTraceType (traceType_t type); /** * \ingroup traceType * \fn traceType_t getTraceType () * \brief Get the type of the output trace. * \return The type of the trace */ traceType_t getTraceType (); /** * \ingroup traceType * \fn traceType_t getName (int procRk) * \param procRk Rank of the proc to get the file containing it * \brief To get the name of the file to give to the addCont function for processors * \return The name of the file to give for a proc */ char* getName (int procRk); /** * \ingroup traceType * \fn int bufferedModeActivated() * \brief Check wether the buffered-mode is activated. * \return 1 is the buffered-mode is activate.\n * 0 otherwise. */ int bufferedModeActivated(); /** * \defgroup init To init the generated trace file(s) */ /** * \ingroup init * \fn int initTrace (const char* filename, int rank, gtg_flag_t flags) * \brief Initialize a trace. * \param filename Root name of the file to create * \param rank Process number of the file to create * \param flags One of GTG_FLAG_NONE, GTG_FLAG_USE_MPI, GTG_FLAG_NOTBUF. * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t initTrace (const char* filename, int rank, gtg_flag_t flags); /** * \ingroup init * \fn trace_return_t endTrace () * \brief Finalize a trace. * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t endTrace (); /** * \ingroup init * \fn trace_return_t setCompress (int val) * \brief Enable trace compression (only available for OTF traces). * \param val 0 means no compression, otherwize the output files will be compressed * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t setCompress (int val); /** * \defgroup procf Functions related to the containers */ /** * \ingroup procf * \fn trace_return_t addContType (const char* alias, * const char* contType, * const char* name) * \brief Add a Container Type. * \param alias Alias on the container added * \param contType Type of the parent container * \param name Alternative name of the new container type * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addContType (const char* alias, const char* contType, const char* name); /** * \defgroup statef Functions related to the states */ /** * \ingroup statef * \fn trace_return_t addStateType (const char* alias, * const char* contType, * const char* name) * \brief Add a State Type. * \param alias Alias on the state type added * \param contType Type of container of these states * \param name Alternative name of the state type * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addStateType (const char* alias, const char* contType, const char* name); /** * \defgroup eventf Functions related to the events */ /** * \ingroup eventf * \fn trace_return_t addEventType (const char* alias, * const char* contType, * const char* name) * \brief Add an Event Type. * \param alias Alias on the event type * \param contType Type of container of these events * \param name Alternative name of the event type * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addEventType (const char* alias, const char* contType, const char* name); /** * \defgroup linkf Functions related to links */ /** * \ingroup linkf * \fn trace_return_t addLinkType (const char* alias, * const char* name, * const char* contType, * const char* srcContType, * const char* destContType); * \brief Add a Link Type. * \param alias Alias on the link type * \param name Alternative name of the link type * \param contType Type of common ancestral container * \param srcContType Type of the source container * \param destContType Type of the destination container * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType); /** * \defgroup varf Functions related to variables */ /** * \ingroup varf * \fn trace_return_t addVarType (const char* alias, * const char* name, * const char* contType) * \brief Add a Variable Type. * \param alias Alias on the variable type * \param contType Type of container * \param name Alternative name of the variable type * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addVarType (const char* alias , const char* name, const char* contType); /** * \ingroup init * \fn trace_return_t addEntityValue (const char* alias, * const char* entType, * const char* name, * gtg_color_t p_color) * \brief Add an Entity Value. * \param alias Alias on the entity value * \param entType Type of the entity that can have the value * \param name Alternative name of the variable type * \param p_color Color of the entity * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addEntityValue (const char* alias, const char* entType, const char* name , gtg_color_t p_color); /** * \ingroup procf * \fn trace_return_t addContainer (varPrec time, * const char * alias, * const char * type, * const char * container, * const char * name, * const char * file) * \brief Add a Container. * \param time Time at which the container is added * \param alias Alias of the new container * \param type Type of the new container * \param container Container parent * \param name Alternative name of the variable type * \param file File containing the container for vite format. Use "0" or "" chains for other formats. * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name, const char* file); /** * \ingroup procf * \fn trace_return_t destroyContainer (varPrec time, * const char * name, * const char * type) * \brief Destroy a Container. * \param time Time at which the container is destroyed * \param name Name of the container * \param type Type of the container * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t destroyContainer (varPrec time, const char* name, const char* type); /** * \ingroup statef * \fn trace_return_t setState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Set the State of a Container. * \param time Time the state changes * \param type Type of the state * \param cont Container whose state changes * \param val Value of new state of container * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t setState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup statef * \fn trace_return_t pushState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Save the current State on a stack and change the State of a Container. * \param time Time the state changes * \param type Type of the state * \param cont Container whose state changes * \param val Value of state of container * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t pushState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup statef * \fn trace_return_t popState (varPrec time, * const char * type, * const char * cont) * \brief Revert the State of a Container to its previous value. * \param time Time the state changes * \param type Type of the state * \param cont Container whose state changes * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t popState (varPrec time, const char* type, const char* cont); /** * \ingroup eventf * \fn trace_return_t addEvent (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Add an Event. * \param time Time the event happens * \param type Type of the event * \param cont Container that produced the event * \param val Value of the new event * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addEvent (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup linkf * \fn trace_return_t startLink (varPrec time, * const char * type, * const char * cont, * const char * src, * const char * dest, * const char * val, * const char * key) * \brief Start a Link. * \param time Time the link starts * \param type Type of the link * \param cont Container containing the link (an ancestor of source and destination container) * \param src Source container * \param dest Destination container * \param val Value of the link * \param key Key to match the end link * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t startLink (varPrec time, const char* type, const char* cont, const char* src, const char* dest, const char* val, const char* key); /** * \ingroup linkf * \fn trace_return_t endLink (varPrec time, * const char * type, * const char * cont, * const char * src, * const char * dest, * const char * val, * const char * key) * \brief End a Link. * \param time Time the link ends * \param type Type of the link * \param cont Container containing the link (an ancestor of source and destination container) * \param src Source container * \param dest Destination container * \param val Value of the link * \param key Key to match the start link * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t endLink (varPrec time, const char* type, const char* cont, const char* src, const char* dest, const char* val, const char* key); /** * \ingroup varf * \fn trace_return_t setVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Set a Variable value. * \param time Time the variable changes * \param type Type of the variable * \param cont Container containing the variable * \param val New value of the variable * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t setVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup varf * \fn trace_return_t addVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Add a value to a Variable. * \param time Time the variable is incremented * \param type Type of the variable * \param cont Container containing the variable * \param val Value added * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t addVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup varf * \fn trace_return_t subVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Substract a value from a Variable. * \param time Time the variable is incremented * \param type Type of the variable * \param cont Container containing the variable * \param val Value substracted * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t subVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup procf * \fn trace_return_t AddComment (const char* comment) * * \brief Add some Comment in Trace file. * \param comment Comment to be added * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t AddComment (const char* comment); #endif /* _GTG_BASIC_H_ */ gtg-trace-0.2-3/inc/GTGColor.h000066400000000000000000000126471446421307700157540ustar00rootroot00000000000000/** * \file GTGColor.h * \version 0.1 * \brief * * This file defines some useful colors to use in entity values for GTG. * */ #ifndef _GTGCOLOR_H_ #define _GTGCOLOR_H_ #include /** * \defgroup GTGColor Defined colors for GTG */ typedef uint32_t gtg_rgb_color_t; /** * \ingroup GTGColor * \struct gtg_color * \brief This structure defines a color that can be used by GTG. */ struct gtg_color { /*@{*/ char* color_name; /**< The name of the color (ie. "RED" or "Black",...) */ gtg_rgb_color_t rgb; /**< RGB code of the color. It should be obtained by calling GTG_COLOR_SET_COLOR(r, g, b). */ /*@{*/ }; typedef struct gtg_color* gtg_color_t; /* In a 4-byte value, the first byte corresponds to blue, * the second to green, the third to red. The 4th byte is * unused (for now). ie. a color is represented as follows: * 0x00rrggbb */ #define GTG_COLOR_BLUE_POS 0 #define GTG_COLOR_GREEN_POS 8 #define GTG_COLOR_RED_POS 16 #define GTG_COLOR_BLUE_MASK (0x000000ff << GTG_COLOR_BLUE_POS) #define GTG_COLOR_GREEN_MASK (0x000000ff << GTG_COLOR_GREEN_POS) #define GTG_COLOR_RED_MASK (0x000000ff << GTG_COLOR_RED_POS) /** * \ingroup GTGColor * \fn GTG_COLOR_GET_BLUE(gtg_rgb_color_t rgb) * \brief Return the 1-byte value of the blue component of a rgb color. */ static inline uint8_t GTG_COLOR_GET_BLUE(gtg_rgb_color_t rgb) { return (((rgb) & GTG_COLOR_BLUE_MASK) >> GTG_COLOR_BLUE_POS ); } /** * \ingroup GTGColor * \fn GTG_COLOR_GET_GREEN(gtg_rgb_color_t rgb) * \brief Return the 1-byte value of the green component of a rgb color. */ static inline uint8_t GTG_COLOR_GET_GREEN(gtg_rgb_color_t rgb) { return (((rgb) & GTG_COLOR_GREEN_MASK) >> GTG_COLOR_GREEN_POS); } /** * \ingroup GTGColor * \fn GTG_COLOR_GET_RED(gtg_rgb_color_t rgb) * \brief Return the 1-byte value of the red component of a rgb color. */ static inline uint8_t GTG_COLOR_GET_RED(gtg_rgb_color_t rgb) { return (((rgb) & GTG_COLOR_RED_MASK) >> GTG_COLOR_RED_POS ); } /** * \ingroup GTGColor * \fn GTG_COLOR_SET_COLOR(uint8_t r, uint8_t g, uint8_t b) * \brief Return the 4-bytes RGB color from 3 1-byte components. */ static inline gtg_rgb_color_t GTG_COLOR_SET_COLOR(uint8_t r, uint8_t g, uint8_t b) { return ((r << GTG_COLOR_RED_POS) | (g << GTG_COLOR_GREEN_POS) | (b << GTG_COLOR_BLUE_POS)); } /** * \ingroup GTGColor * \var GTG_BLACK * \brief Default black color. (R,G,B) = (0, 0, 0) */ extern gtg_color_t GTG_BLACK; /** * \ingroup GTGColor * \var GTG_RED * \brief Default red color. (R,G,B) = (255, 0, 0) */ extern gtg_color_t GTG_RED; /** * \ingroup GTGColor * \var GTG_GREEN * \brief Default green color. (R,G,B) = (0, 255, 0) */ extern gtg_color_t GTG_GREEN; /** * \ingroup GTGColor * \var GTG_BLUE * \brief Default blue color. (R,G,B) = (0, 0, 255) */ extern gtg_color_t GTG_BLUE; /** * \ingroup GTGColor * \var GTG_WHITE * \brief Default white color. (R,G,B) = (255, 255, 255) */ extern gtg_color_t GTG_WHITE; /** * \ingroup GTGColor * \var GTG_TEAL * \brief Default teal color. (R,G,B) = (0, 255, 255) */ extern gtg_color_t GTG_TEAL; /** * \ingroup GTGColor * \var GTG_DARKGREY * \brief Default dark grey color. (R,G,B) = (85, 85, 85) */ extern gtg_color_t GTG_DARKGREY; /** * \ingroup GTGColor * \var GTG_YELLOW * \brief Default yellow color. (R,G,B) = (255, 255, 0) */ extern gtg_color_t GTG_YELLOW; /** * \ingroup GTGColor * \var GTG_PURPLE * \brief Default purple color. (R,G,B) = (153, 25, 230) */ extern gtg_color_t GTG_PURPLE; /** * \ingroup GTGColor * \var GTG_LIGHTBROWN * \brief Default light brown color. (R,G,B) = (170, 130, 130) */ extern gtg_color_t GTG_LIGHTBROWN; /** * \ingroup GTGColor * \var GTG_LIGHTGREY * \brief Default light grey color. (R,G,B) = (200, 200, 200) */ extern gtg_color_t GTG_LIGHTGREY; /** * \ingroup GTGColor * \var GTG_DARKBLUE * \brief Default dark blue color. (R,G,B) = (0, 0, 80) */ extern gtg_color_t GTG_DARKBLUE; /** * \ingroup GTGColor * \var GTG_PINK * \brief Default pink color. (R,G,B) = (255, 0, 255) */ extern gtg_color_t GTG_PINK; /** * \ingroup GTGColor * \var GTG_DARKPINK * \brief Default dark pink color. (R,G,B) = (180, 80, 180) */ extern gtg_color_t GTG_DARKPINK; /** * \ingroup GTGColor * \var GTG_SEABLUE * \brief Default sea blue color. (R,G,B) = (25, 128, 200) */ extern gtg_color_t GTG_SEABLUE; /** * \ingroup GTGColor * \var GTG_KAKI * \brief Default kaki color. (R,G,B) = (80, 100, 25) */ extern gtg_color_t GTG_KAKI; /** * \ingroup GTGColor * \var GTG_REDBLOOD * \brief Default red blood color. (R,G,B) = (200, 25, 25) */ extern gtg_color_t GTG_REDBLOOD; /** * \ingroup GTGColor * \var GTG_BROWN * \brief Default brown color. (R,G,B) = (100, 25, 25) */ extern gtg_color_t GTG_BROWN; /** * \ingroup GTGColor * \var GTG_GRENAT * \brief Default grenat color. (R,G,B) = (100, 0, 80) */ extern gtg_color_t GTG_GRENAT; /** * \ingroup GTGColor * \var GTG_ORANGE * \brief Default orange color. (R,G,B) = (255, 160, 0) */ extern gtg_color_t GTG_ORANGE; /** * \ingroup GTGColor * \var GTG_MAUVE * \brief Default mauve color. (R,G,B) = (128, 0, 255) */ extern gtg_color_t GTG_MAUVE; /** * \ingroup GTGColor * \var GTG_LIGHTPINK * \brief Default light pink color. (R,G,B) = (255, 128, 255) */ extern gtg_color_t GTG_LIGHTPINK; void gtg_color_init(); void gtg_color_exit(); gtg_color_t gtg_color_create( const char *name, uint8_t r, uint8_t g, uint8_t b); void gtg_color_free(gtg_color_t color); #endif /* _GTGCOLOR_H_ */ gtg-trace-0.2-3/inc/GTGCompress.h000066400000000000000000000021361446421307700164610ustar00rootroot00000000000000#ifndef GTG_COMPRESS_H #define GTG_COMPRESS_H #include #include #include /* compress a buffer into another buffer */ int gtg_compress_m2m(z_stream *z, void* in_buf, uint32_t len, void* out_buf, uint32_t out_max_len); /* compress a buffer and save the result in a file */ int gtg_compress_m2f(z_stream *z, void* in_buf, uint32_t len, FILE* file_out); /* compress a file into a buffer */ int gtg_compress_f2m(z_stream *z, FILE* file_in, void* out_buf, uint32_t out_max_len); /* compress a file into another file */ int gtg_compress_f2f(z_stream *z, FILE* file_in, FILE* file_out); /* save functions for decompression */ int gtg_decompress_m2m(z_stream *z, void* in_buf, uint32_t len, void* out_buf, uint32_t out_max_len); int gtg_decompress_m2f(z_stream *z, void* in_buf, uint32_t len, FILE* file_out); int gtg_decompress_f2m(z_stream *z, FILE* file_in, void* out_buf, uint32_t out_max_len); int gtg_decompress_f2f(z_stream *z, FILE* file_in, FILE* file_out); int gtg_compress_init(z_stream *z, int compression_ratio); int gtg_decompress_init(z_stream *z); #endif /* GTG_COMPRESS_H */ gtg-trace-0.2-3/inc/GTGList.h000066400000000000000000000115541446421307700156050ustar00rootroot00000000000000#ifndef GTG_LIST_H #define GTG_LIST_H struct gtg_list { struct gtg_list *prev; struct gtg_list *next; }; typedef struct gtg_list* gtg_list_t; /** * \fn GTG_LIST_INIT(ptr) * \brief initialize a list. * \param ptr pointer to the list (gtg_list_t). */ #define GTG_LIST_INIT(ptr) \ do { \ (ptr)->prev = (ptr); \ (ptr)->next = (ptr); \ } while(0) /** * \fn GTG_LIST(name) * \brief declare and initialize a list. * \param name Name of the variable */ #define GTG_LIST(name) \ struct gtg_list name; \ GTG_LIST_INIT(&name) /** * \fn gtg_list_entry(ptr, type, member) * \brief get the structure corresponding to a list entry * \param ptr pointer to the list entry (gtg_list_t) * \param type the type of the struct this is embedded in. * \param member the name of the struct gtg_list member within the struct. */ #define gtg_list_entry(ptr, type, member) \ ((type *)((char *)(ptr) - (char *)(&((type *)0)->member))) /* * Insert a new entry between two known consecutive entries. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __gtg_list_add(gtg_list_t lnew, gtg_list_t prev, gtg_list_t next) { next->prev = lnew; lnew->next = next; lnew->prev = prev; prev->next = lnew; } /** * \fn void gtg_list_add(gtg_list_t lnew, gtg_list_t head) * \brief Insert a new entry after the specified head. * \param lnew new entry to be added * \param head list head to add it after */ static inline void gtg_list_add(gtg_list_t lnew, gtg_list_t head) { __gtg_list_add(lnew, head, head->next); } /** * \fn void gtg_list_add_tail(gtg_list_t lnew, gtg_list_t head) * \brief Insert a new entry before the specified head (ie. at the tail of the list). * \param lnew new entry to be added * \param head list head to add it after */ static inline void gtg_list_add_tail(gtg_list_t lnew, gtg_list_t head) { __gtg_list_add(lnew, head->prev, head); } /** * Delete a list entry by making the prev/next entries * point to each other. * * This is only for internal list manipulation where we know * the prev/next entries already! */ static inline void __gtg_list_del(gtg_list_t prev, gtg_list_t next) { next->prev = prev; prev->next = next; } /** * \fn void gtg_list_del(gtg_list_t entry) * \brief delete an entry from its list and reinitialize it. * \param entry the element to delete from the list. */ static inline void gtg_list_del(gtg_list_t entry) { __gtg_list_del(entry->prev, entry->next); GTG_LIST_INIT(entry); } /** * \fn gtg_list_for_each(gtg_list_t pos, gtg_list_t head) * \brief iterate over a list * \param pos the gtg_list_t to use as a loop counter. * \param head the head for the list. */ #define gtg_list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) /** * \fn gtg_list_for_each_reverse(gtg_list_t pos, gtg_list_t head) * \brief iterate over a list backwards * \param pos the gtg_list_t to use as a loop counter. * \param head the head for the list. */ #define gtg_list_for_each_reverse(pos, head) \ for (pos = (head)->prev; pos != (head); pos = pos->prev) /** * \fn gtg_list_for_each_safe(gtg_list_t pos, gtg_list_t n, gtg_list_t head) * \brief iterate over a list safe against removal of list entry * \param pos the gtg_list_t to use as a loop counter. * \param n another gtg_list_t to use as temporary storage * \param head the head for the list. */ #define gtg_list_for_each_safe(pos, n, head) \ for (pos = (head)->next, n = pos->next; pos != (head); \ pos = n, n = pos->next) /** * gtg_list_for_each_entry(pos, head, member) * \brief iterate over list of given type * \param pos the type * to use as a loop counter. * \param head the head for the list. * \param member the name of the struct gtg_list member within the struct. */ #define gtg_list_for_each_entry(pos, head, member) \ for (pos = gtg_list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ pos = gtg_list_entry(pos->member.next, typeof(*pos), member)) /** * gtg_list_for_each_entry_safe(pos, n, head, member) * \brief iterate over list of given type safe against removal of list entry * \param pos the type * to use as a loop counter. * \param n another type * to use as temporary storage * \param head the head for the list. * \param member the name of the struct gtg_list member within the struct. */ #define gtg_list_for_each_entry_safe(pos, n, head, member) \ for (pos = gtg_list_entry((head)->next, typeof(*pos), member), \ n = gtg_list_entry(pos->member.next, typeof(*pos), member); \ &pos->member != (head); \ pos = n, n = gtg_list_entry(n->member.next, typeof(*n), member)) static inline int gtg_list_size(gtg_list_t l) { int res = 0; gtg_list_t ptr = NULL; gtg_list_for_each(ptr, l) res++; return res; } #endif /* GTG_LIST_H */ gtg-trace-0.2-3/inc/GTGMemory.h000066400000000000000000000026001446421307700161320ustar00rootroot00000000000000/** * \file GTGMemory.h * \version 0.1 * \brief * * This file defines a fast allocator for fixed-size blocks */ #ifndef GTG_MEMORY_H #define GTG_MEMORY_H #include /** * \defgroup GTGMemory Memory management */ struct gtg_memory { void *first_mem; void *current_mem; size_t block_len; long mem_len; void *first_free; long first_new; long nb_allocated; }; typedef struct gtg_memory *gtg_memory_t; /** * \ingroup GTGMemory * \fn void gtg_block_memory_init(gtg_memory_t *memory, size_t block_size, long initial_block_number) * \brief Initialize the allocator * \param memory A memory describer * \param block_size The block size to be allocated when malloc is called * \param initial_block_number The number of blocks to allocate initialy */ void gtg_block_memory_init(gtg_memory_t *memory, size_t block_size, long initial_block_number); /** * \ingroup GTGMemory * \fn void* gtg_block_malloc(gtg_memory_t memory); * \brief Allocate a block of data * \param memory The memory describer * \return A pointer to a block or NULL if allocation failed */ void* gtg_block_malloc(gtg_memory_t memory); /** * \ingroup GTGMemory * \fn void gtg_block_free(gtg_memory_t memory, void *ptr); * \brief Free a block of data * \param memory The memory describer * \param ptr The block of data to free */ void gtg_block_free(gtg_memory_t memory, void *ptr); #endif gtg-trace-0.2-3/inc/GTGOTF.h000066400000000000000000000011751446421307700153200ustar00rootroot00000000000000/** * \file GTGOTF.h * \version 0.1 * \brief * OTF is the global file for gtg interface using OTF. * * \authors * Developers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * */ #ifndef _GTG_OTF_H_ #define _GTG_OTF_H_ #include #include "GTGOTF_Structs.h" #include "GTGOTF_Basic.h" #endif /* _GTG_OTF_H_ */ gtg-trace-0.2-3/inc/GTGOTF_Basic.h000066400000000000000000000323521446421307700164220ustar00rootroot00000000000000/** * \file GTGOTF_Basic.h * \version 0.1 * \brief * OTF_GTGBasic1 is the OTF implementation of the basic interface to generate traces (GTGBasic1). * * \authors * Developers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n */ #ifndef _GTG_OTF_BASIC_H_ #define _GTG_OTF_BASIC_H_ #include "GTGTypes.h" #include "GTGBasic.h" #include "GTGOTF_Structs.h" /** * \defgroup cotf OTF interface in C of the traceGeneratorBasic API */ /** * \ingroup cotf * \fn const char* OTF_get_color(gtg_color_t color) * \brief Converts a GTG color into a OTF color. * \param color GTG color to convert * \return The OTF color */ const otf_color_t OTF_get_color(gtg_color_t color); /** * \ingroup cotf * \fn trace_return_t OTFInitTrace (const char* filename, gtg_flag_t flags) * \brief Initialize an OTF trace. * \param filename Root name of the file to create * \param flags One of GTG_FLAG_NONE, GTG_FLAG_USE_MPI, GTG_FLAG_NOTBUF. * \return 0 if success * An error code otherwise */ trace_return_t OTFInitTrace (const char* filename, gtg_flag_t flags); /** * \ingroup cotf * \fn trace_return_t OTFSetCompress(int val) * \brief Enable trace compression. * \param val 0 means no compression, otherwize the output files will be compressed. * \return 0 if success \n * An error code otherwise */ trace_return_t OTFSetCompress(int val); /** * \ingroup cotf * \fn trace_return_t OTFAddContType (const char* alias, * const char* contType, * const char* name) * \brief Add a Container Type. * \param alias Alias on the container * \param contType Type of container * \param name Name of the container type * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddContType (const char* alias, const char* contType, const char* name); /** * \ingroup cotf * \fn trace_return_t OTFAddStateType (const char* alias, * const char* contType, * const char* name) * \brief Add a State Type. * \param alias Alias on the state type * \param contType Type of container * \param name Name of the state type * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddStateType (const char* alias, const char* contType, const char* name); /** * \ingroup cotf * \fn trace_return_t OTFAddEventType (const char* alias, * const char* contType, * const char* name) * \brief Add an Event Type. * \param alias Alias on the event type * \param contType Type of container * \param name Name of the event type * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddEventType (const char* alias, const char* contType, const char* name); /** * \ingroup cotf * \fn trace_return_t OTFAddLinkType (const char* alias, * const char* name, * const char* contType, * const char* srcContType, * const char* destContType); * \brief Add a Link Type. * \param alias Alias on the link type * \param name Name of the link type * \param contType Type of container * \param srcContType Type of the source container * \param destContType Type of the destination container * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType); /** * \ingroup cotf * \fn trace_return_t OTFAddVarType (const char* alias, * const char* contType, * const char* name) * \brief Add a Variable Type. * \param alias Alias on the variable type * \param contType Type of container * \param name Name of the variable type * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddVarType (const char* alias , const char* name, const char* contType); /** * \ingroup cotf * \fn trace_return_t OTFAddEntityValue (const char* alias, * const char* entType, * const char* name, * const otf_color_t color) * \brief Add an Entity Value. * \param alias Alias on the entity value * \param entType Type of the entity * \param name Name of the variable type * \param color Color of the entity * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddEntityValue (const char* alias, const char* entType, const char* name , const otf_color_t color); /** * \ingroup cotf * \fn trace_return_t OTFDefineContainer (varPrec time, * const char * alias, * const char * type, * const char * container, * const char * name, * const char * file) * \brief Define a Container. * \param alias Alias of the new container * \param type Type of the container * \param container Container parent * \param name Name of the variable type * \param file File containing the container trace * \return 0 if success \n * An error code otherwise */ trace_return_t OTFDefineContainer (const char* alias, const char* type, const char* container, const char* name, const char* file); /** * \ingroup cotf * \fn trace_return_t OTFStartContainer (varPrec time, * const char * alias, * const char * type, * const char * container, * const char * name, * const char * file) * \brief Start a Container. * \param time Time at which the container is added * \param alias Alias of the new container * \param type Type of the container * \param container Container parent * \param name Name of the variable type * \param file File containing the container trace * \return 0 if success \n * An error code otherwise */ trace_return_t OTFStartContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name, const char* file); /** * \ingroup cotf * \fn trace_return_t OTFDestroyContainer (varPrec time, * const char * name, * const char * type) * \brief Destroy a Container. * \param time Time at which the container is destroyed * \param name Name of the container * \param type Type of the container * \return 0 if success \n * An error code otherwise */ trace_return_t OTFDestroyContainer (varPrec time, const char* name, const char* type); /** * \ingroup cotf * \fn trace_return_t OTFSetState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Set the State of a Container. * \param time Time at which the state is set * \param type Type of the state * \param cont Container in this state * \param val Entity value of the state of the container * \return 0 if success \n * An error code otherwise */ trace_return_t OTFSetState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cotf * \fn trace_return_t OTFPushState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Save the current State on a stack and change the State of a Container. * \param time Time at which the state is pushed * \param type Type of the state * \param cont Container in this state * \param val Entity value of the state of the container * \return 0 if success \n * An error code otherwise */ trace_return_t OTFPushState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cotf * \fn trace_return_t OTFPopState (varPrec time, * const char * type, * const char * cont) * \brief Revert the State of a Container to its previous value. * \param time Time at which the state is poped * \param type Type of the state * \param cont Container in this state * \return 0 if success \n * An error code otherwise */ trace_return_t OTFPopState (varPrec time, const char* type, const char* cont); /** * \ingroup cotf * \fn trace_return_t OTFAddEvent (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Add an Event. * \param time Time at which the event happens * \param type Type of the event * \param cont Container in this event * \param val Entity value of the event of the container * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddEvent (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cotf * \fn trace_return_t OTFStartLink (varPrec time, * const char * type, * const char * cont, * const char * src, * const char * val, * const char * key) * \brief Start a Link. * \param time Time at which the link starts * \param type Type of the link * \param cont Container containning the link * \param src Container source * \param val Entity value of the link * \param key Key to identify the link * \return 0 if success \n * An error code otherwise */ trace_return_t OTFStartLink (varPrec time, const char* type, const char* src, const char* dest, const char* val , const char* key); /** * \ingroup cotf * \fn trace_return_t OTFEndLink (varPrec time, * const char * type, * const char * cont, * const char * dest, * const char * val, * const char * key) * \brief End a Link. * \param time Time at which the link ends * \param type Type of the link * \param cont Container containning the link * \param dest Container destination * \param val Entity value of the link * \param key Key to identify the link * \return 0 if success \n * An error code otherwise */ trace_return_t OTFEndLink (varPrec time, const char* type, const char* src, const char* dest, const char* val, const char* key); /** * \ingroup cotf * \fn trace_return_t OTFSetVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Set a Variable value. * \param time Time at which the variable is set * \param type Type of the variable * \param cont Container containning the variable * \param val Value of the variable * \return 0 if success \n * An error code otherwise */ trace_return_t OTFSetVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cotf * \fn trace_return_t OTFAddVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Add a value to a Variable. * \param time Time at which the variable is incremented * \param type Type of the variable * \param cont Container containning the variable * \param val Value added * \return 0 if success \n * An error code otherwise */ trace_return_t OTFAddVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cotf * \fn trace_return_t OTFSubVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Substract a value from a Variable. * \param time Time at which the variable is incremented * \param type Type of the variable * \param cont Container containning the variable * \param val Value substracted * \return 0 if success \n * An error code otherwise */ trace_return_t OTFSubVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cotf * \fn trace_return_t OTFAddComment (const char* comment) * * \brief Add some Comment in Trace file. * \param comment Comment to be added * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t OTFAddComment (const char* comment); /** * \ingroup cotf * \fn OTFEndTrace () * \brief Finalize an OTF trace. * \return 0 if success \n * An error code otherwise */ trace_return_t OTFEndTrace (); #endif /* _GTG_OTF_BASIC_H_ */ gtg-trace-0.2-3/inc/GTGOTF_Structs.h000066400000000000000000000155661446421307700170600ustar00rootroot00000000000000/** * \file GTGOTF_Structs.h * \version 0.1 * \brief * OTF_Structs gives the global types and functions needed to have the OTF implementation. * * \authors * Developers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * */ #ifndef _GTG_OTF_STRUCTS_H_ #define _GTG_OTF_STRUCTS_H_ #include #include "GTGList.h" #include "GTGStack.h" /* todo: remove this */ #define MAX_PROCESS 64 /*! StateTypes */ typedef struct StateType { /* Func group */ char *name; char *alias; int groupId; int id; struct gtg_list token; /* stored in the stateTypes list */ } StateType_t; /*! States */ typedef struct State { int value; int cont; int stateType; gtg_stack token; /* stored in the states list */ } State_t; /* ContainerTypes */ typedef struct ContainerType { char *name; char *alias; int id; struct gtg_list token; /* stored in the ctType list */ } ContainerType_t; /*! Containers */ typedef struct Container { char *name; char *alias; int ctType; int id; struct gtg_list token; /* stored in the conts list */ State_t state_stack; } Container_t; /*! EntityValue, contains the name of the functions/states */ typedef struct EntityValue { char *name; char *alias; int groupId; int id; struct gtg_list token; /* not used */ } EntityValue_t; /*! Events/Markers */ typedef struct EventType { char *name; char *alias; int contType; int id; struct gtg_list token; /* stored in the eventTypes list */ } EventType_t; /*! Links/Messages */ typedef struct LinkType { char *name; char *alias; int contType; int srcType; int destType; int id; struct gtg_list token; /* stored in the linkTypes lisk */ } LinkType_t; typedef struct Link { varPrec time; int src; } Link_t; /*! Variables/Counters */ typedef struct VariableType { char *name; char *alias; int contType; int id; struct gtg_list token; /* stored in the variableTypes list */ } VariableType_t; typedef struct Variable { int parent; int type; uint64_t value; int id; struct gtg_list token; /* stored in the variables list */ } Variable_t; struct otf_color { char *colorID; uint8_t red; uint8_t green; uint8_t blue; }; typedef struct otf_color* otf_color_t; #define ContainerType_NIL 0 #define Container_NIL 0 #define StateType_NIL 0 #define State_NIL 0 #define EntityValue_NIL 0 #define EventType_NIL 0 #define LinkType_NIL 0 #define VariableType_NIL 0 #define Variable_NIL 0 #define init_ContainerType(var)\ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).id = ContainerType_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_Container(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).ctType = ContainerType_NIL; \ (var).id = Container_NIL; \ GTG_LIST_INIT(&(var).token); \ GTG_STACK_INIT(&(var).state_stack.token); \ }while(0) #define init_StateType(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).groupId = 0; \ (var).id = StateType_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_EntityValue(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).groupId = 0; \ (var).id = EntityValue_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_EventType(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).contType = ContainerType_NIL; \ (var).id = EventType_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_LinkType(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).contType = ContainerType_NIL; \ (var).srcType = ContainerType_NIL; \ (var).destType = ContainerType_NIL; \ (var).id = LinkType_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_VariableType(var) \ do { \ (var).name = NULL; \ (var).alias = NULL; \ (var).contType = ContainerType_NIL; \ (var).id = VariableType_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_Variable(var) \ do { \ (var).parent = Container_NIL; \ (var).parent = VariableType_NIL; \ (var).value = 0; \ (var).id = Variable_NIL; \ GTG_LIST_INIT(&(var).token); \ }while(0) #define init_State(var) \ do { \ (var).value = EntityValue_NIL; \ (var).cont = Container_NIL; \ (var).stateType = StateType_NIL; \ GTG_STACK_INIT(&(var).token); \ }while(0) #define alloc_struct(ptr, type, list_head) \ do { \ ptr = (type*) malloc(sizeof(type)); \ GTG_LIST_INIT(&(ptr->token)); \ ptr->id = (gtg_list_entry((list_head)->prev, type, token)->id) + 1; \ gtg_list_add_tail(&(ptr->token), list_head); \ } while(0) #define alloc_init_struct(type, ptr, list_head, _name_, _alias_) \ do { \ alloc_struct(ptr, type, list_head); \ (ptr)->name = (char *)malloc(sizeof(char)*(strlen(_name_)+1)); \ strcpy((ptr)->name, _name_); \ (ptr)->alias = (char *)malloc(sizeof(char)*(strlen(_alias_)+1)); \ strcpy((ptr)->alias, _alias_); \ }while(0) #define alloc_Variable(_ptr_, _id_, _parent_, _type_, _value_) \ do { \ (_ptr_) = (Variable_t*) malloc(sizeof(Variable_t)); \ init_Variable(*(_ptr_)); \ (_ptr_)->id = _id_; \ (_ptr_)->parent = _parent_; \ (_ptr_)->type = _type_; \ (_ptr_)->value = _value_; \ }while(0) #define alloc_State(_ptr_, _value_, _cont_, _stateType_) \ do { \ _ptr_ = (State_t*) malloc(sizeof(State_t)); \ init_State(*(_ptr_)); \ (_ptr_)->value = _value_; \ (_ptr_)->cont = _cont_; \ (_ptr_)->stateType = _stateType_; \ }while(0) #define free_struct(_type_, _list_head_)\ do{\ _type_ *ptr, *tmp; \ gtg_list_for_each_entry_safe(ptr, tmp, &(_list_head_).token, token) { \ gtg_list_del(&(ptr->token));\ free(ptr->name);\ free(ptr->alias);\ free(ptr);\ }\ }while(0) #endif /* _GTG_OTF_STRUCTS_H_ */ gtg-trace-0.2-3/inc/GTGPaje.h000066400000000000000000000007751446421307700155540ustar00rootroot00000000000000/** * \file GTGPaje.h * \version 0.1 * \brief * * pajeColor is a file that defines function that manipulate colors. * */ #ifndef _GTG_PAJE_H_ #define _GTG_PAJE_H_ typedef char* paje_color_t; /** * \ingroup cpaje * \fn const paje_color_t Paje_get_color(gtg_color_t color) * \brief Converts a GTG color into a PAJE color. * \param color GTG color to convert * \return The PAJE color */ paje_color_t Paje_get_color(gtg_color_t p_color); #include "GTGPaje_Basic.h" #endif /* _GTG_PAJE_H_ */ gtg-trace-0.2-3/inc/GTGPaje_Basic.h000066400000000000000000000367531446421307700166620ustar00rootroot00000000000000/** * \file GTGPaje_Basic.h * \version 0.1 * \brief * paje_GTGBasic1 is the Paje implementation of the basic interface to generate traces (GTGBasic1). * * \authors * Developers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * */ #ifndef _GTG_PAJE_BASIC_H_ #define _GTG_PAJE_BASIC_H_ #include "GTGBasic.h" /** * \brief Constant to create a paje trace */ #define FMT_PAJE 0 /** * \brief Constant to create a vite trace */ #define FMT_VITE 1 /** * \defgroup cpaje Paje interface in C of the GTGBasic1 API */ /** * \ingroup cpaje * \fn trace_return_t pajeInitTrace (const char* filename, int rank, gtg_flag_t flags, int fmt) * \brief Initialize a VITE trace ( *.ept) * \param filename Root name of the file to create * \param rank Rank of the processor * \param flags One of GTG_FLAG_NONE, GTG_FLAG_USE_MPI, GTG_FLAG_NOTBUF. * \param fmt Format, paje or vite * \return 0 if success * An error code otherwise */ trace_return_t pajeInitTrace (const char* filename, int rank, gtg_flag_t flags, int fmt); /** * \ingroup cpaje * \fn char* pajeGetName (int rk) * \param rk Rank of the proc you want the filename containing it * \brief Function to get the name of the file containing all the data for the proc of rank rk * \return Name of the file. */ char* pajeGetName (int rk); /** * \ingroup cpaje * \fn trace_return_t pajeSetCompress(int val) * \brief Enable trace compression. * \param val 0 means no compression, otherwize the output files will be compressed. * \return 0 if success \n * An error code otherwise */ trace_return_t pajeSetCompress(int val); /** * \ingroup cpaje * \fn trace_return_t pajeAddContType (const char* alias, * const char* contType, * const char* name) * \brief Add a Container Type. * \param alias Alias on the container * \param contType Type of container * \param name Name of the container type * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddContType (const char* alias, const char* contType, const char* name); /** * \ingroup cpaje * \fn trace_return_t pajeAddStateType (const char* alias, * const char* contType, * const char* name) * \brief Add a State Type. * \param alias Alias on the state type * \param contType Type of container * \param name Name of the state type * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddStateType (const char* alias, const char* contType, const char* name); /** * \ingroup cpaje * \fn trace_return_t pajeAddEventType (const char* alias, * const char* contType, * const char* name) * \brief Add an Event Type. * \param alias Alias on the event type * \param contType Type of container * \param name Name of the event type * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddEventType (const char* alias, const char* contType, const char* name); /** * \ingroup cpaje * \fn trace_return_t pajeAddLinkType (const char* alias, * const char* name, * const char* contType, * const char* srcContType, * const char* destContType); * \brief Add a Link Type. * \param alias Alias on the link type * \param name Name of the link type * \param contType Type of container * \param srcContType Type of the source container * \param destContType Type of the destination container * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType); /** * \ingroup cpaje * \fn trace_return_t pajeAddVarType (const char* alias, * const char* contType, * const char* name) * \brief Add a Variable Type. * \param alias Alias on the variable type * \param contType Type of container * \param name Name of the variable type * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddVarType (const char* alias , const char* contType, const char* name); /** * \ingroup cpaje * \fn trace_return_t pajeAddEntityValue (const char* alias, * const char* entType, * const char* name, * const char* color) * \brief Add an Entity Value. * \param alias Alias on the entity value * \param entType Type of the entity * \param name Name of the variable type * \param color Color of the entity * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddEntityValue (const char* alias, const char* entType, const char* name , const char* color); /** * \ingroup cpaje * \fn trace_return_t pajeAddContainer (varPrec time, * const char * alias, * const char * type, * const char * container, * const char * name, * const char * file) * \brief Add a Container (VITE format). * \param time Time at which the container is added * \param alias Alias on the new container * \param type Type of the container * \param container Container parent * \param name Name of the variable type * \param file File containing the container trace * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name, const char* file); /** * \ingroup cpaje * \fn trace_return_t pajeSeqAddContainer (varPrec time, * const char * alias, * const char * type, * const char * container, * const char * name) * \brief Add a Container (PAJE format). * \param time Time at which the container is added * \param alias Alias on the new container * \param type Type of the container * \param container Container parent * \param name Name of the variable type * \return 0 if success \n * An error code otherwise */ trace_return_t pajeSeqAddContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name); /** * \ingroup cpaje * \fn trace_return_t pajeDestroyContainer (varPrec time, * const char * name, * const char * type) * \brief Destroy a Container. * \param time Time at which the container is destroyed * \param name Name on the container to destroy * \param type Type of the container * \return 0 if success \n * An error code otherwise */ trace_return_t pajeDestroyContainer (varPrec time, const char* name, const char* type); /** * \ingroup cpaje * \fn trace_return_t pajeSetState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Set the State of a Container. * \param time Time at which the state is set * \param type Type of the state * \param cont Container in this state * \param val Entity value of the state of the container * \return 0 if success \n * An error code otherwise */ trace_return_t pajeSetState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cpaje * \fn trace_return_t pajePushState (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Save the current State on a stack and change the State of a Container. * \param time Time at which the state is pushed * \param type Type of the state * \param cont Container in this state * \param val Entity value of the state of the container * \return 0 if success \n * An error code otherwise */ trace_return_t pajePushState (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cpaje * \fn trace_return_t pajePopState (varPrec time, * const char * type, * const char * cont) * \brief Revert the State of a Container to its previous value. * \param time Time at which the state is poped * \param type Type of the state * \param cont Container in this state * \return 0 if success \n * An error code otherwise */ trace_return_t pajePopState (varPrec time, const char* type, const char* cont); /** * \ingroup cpaje * \fn trace_return_t pajeAddEvent (varPrec time, * const char * type, * const char * cont, * const char * val) * \brief Add an Event. * \param time Time at which the event happens * \param type Type of the event * \param cont Container in this event * \param val Entity value of the event of the container * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddEvent (varPrec time, const char* type, const char* cont, const char* val); /** * \ingroup cpaje * \fn trace_return_t pajeStartLink (varPrec time, * const char * type, * const char * cont, * const char * src, * const char * val, * const char * key) * \brief Start a link * \param time Time at which the link starts * \param type Type of the link * \param cont Container parent of the source and destination containers containing the link * \param src Source container * \param val Value of the link * \param key Key used to match start link with end link * \return 0 if success \n * An error code otherwise */ trace_return_t pajeStartLink (varPrec time, const char* type, const char* cont, const char* src, const char* val , const char* key); /** * \ingroup cpaje * \fn trace_return_t pajeEndLink (varPrec time, * const char * type, * const char * cont, * const char * dest, * const char * val, * const char * key) * \brief Start a link * \param time Time at which the link starts * \param type Type of the link * \param cont Container parent of the source and destination containers containing the link * \param dest Source container * \param val Value of the link * \param key Key used to match start link with end link * \return 0 if success \n * An error code otherwise */ trace_return_t pajeEndLink (varPrec time, const char* type, const char* cont, const char* dest, const char* val , const char* key); /** * \ingroup cpaje * \fn trace_return_t pajeSetVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Set a Variable value * \param time Time at which the variable is set * \param type Type of the variable * \param cont Container containing the variable * \param val Value of the variable * \return 0 if success \n * An error code otherwise */ trace_return_t pajeSetVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cpaje * \fn trace_return_t pajeAddVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Add a value to a Variable. * \param time Time at which the variable is incremented * \param type Type of the variable * \param cont Container containing the variable * \param val Value added * \return 0 if success \n * An error code otherwise */ trace_return_t pajeAddVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cpaje * \fn trace_return_t pajeSubVar (varPrec time, * const char * type, * const char * cont, * varPrec val) * \brief Substract a value from a Variable. * \param time Time at which the variable is incremented * \param type Type of the variable * \param cont Container containing the variable * \param val Value substracted * \return 0 if success \n * An error code otherwise */ trace_return_t pajeSubVar (varPrec time, const char* type, const char* cont, varPrec val); /** * \ingroup cpaje * \fn trace_return_t pajeAddComment (const char* comment) * * \brief Add some Comment in Trace file. * \param comment Comment to be added * \return TRACE_SUCCESS on success \n * An error code otherwise */ trace_return_t pajeAddComment (const char* comment); /** * \ingroup cpaje * \fn pajeEndTrace () * \brief Finalize a PAJE trace. * \return 0 if success \n * An error code otherwise */ trace_return_t pajeEndTrace (); /** * \ingroup cpaje * \fn viteEndTrace () * \brief Finalize a VITE trace. * \return 0 if success \n * An error code otherwise */ trace_return_t viteEndTrace (); /* * Functions to handle extra-parameters in the Paje Definitions * This will need to be cleaned to be closer to OTF interface */ enum gtg_paje_evtdef_e { GTG_PAJE_EVTDEF_DefineContainerType, GTG_PAJE_EVTDEF_DefineStateType, GTG_PAJE_EVTDEF_DefineEventType, GTG_PAJE_EVTDEF_DefineVariableType, GTG_PAJE_EVTDEF_DefineLinkType, GTG_PAJE_EVTDEF_DefineEntityValue, GTG_PAJE_EVTDEF_CreateContainer, GTG_PAJE_EVTDEF_DestroyContainer, GTG_PAJE_EVTDEF_SetState, GTG_PAJE_EVTDEF_PushState, GTG_PAJE_EVTDEF_PopState, GTG_PAJE_EVTDEF_ResetState, GTG_PAJE_EVTDEF_NewEvent, GTG_PAJE_EVTDEF_SetVariable, GTG_PAJE_EVTDEF_AddVariable, GTG_PAJE_EVTDEF_SubVariable, GTG_PAJE_EVTDEF_StartLink, GTG_PAJE_EVTDEF_EndLink, GTG_PAJE_EVTDEF_NBR }; enum gtg_paje_fieldtype_e { GTG_PAJE_FIELDTYPE_Int, GTG_PAJE_FIELDTYPE_Hex, GTG_PAJE_FIELDTYPE_Date, GTG_PAJE_FIELDTYPE_Double, GTG_PAJE_FIELDTYPE_String, GTG_PAJE_FIELDTYPE_Color, GTG_PAJE_FIELDTYPE_NBR }; struct gtg_paje_edp_s { struct gtg_paje_edp_s *next; char *name; enum gtg_paje_fieldtype_e type; }; typedef struct gtg_paje_edp_s gtg_paje_edp_t; struct gtg_paje_eventdef_s { char *name; int id; gtg_paje_edp_t *first; gtg_paje_edp_t *last; }; typedef struct gtg_paje_eventdef_s gtg_paje_eventdef_t; extern gtg_paje_eventdef_t paje_eventdefs[GTG_PAJE_EVTDEF_NBR]; void pajeEventDefAddParam( enum gtg_paje_evtdef_e event, const char *name, enum gtg_paje_fieldtype_e type ); #endif /* _GTG_PAJE_BASIC_H_ */ gtg-trace-0.2-3/inc/GTGReplay.h000066400000000000000000000021111446421307700161130ustar00rootroot00000000000000/** * \file GTGReplay.h * \version 0.1 * \brief * * This file defines functions for postponing event-processing function calls */ #ifndef GTG_REPLAY_H #define GTG_REPLAY_H /** * \defgroup GTGReplay Functions for postponing event-processing function calls */ enum event_type_t { event_addContainer, event_destroyContainer, event_setState, event_pushState, event_popState, event_addEvent, event_startLink, event_endLink, event_setVar, event_addVar, event_subVar }; /** * \ingroup GTGReplay * \fn void gtg_record(enum event_type_t type, varPrec time, ...) * \brief postpone the recording of an event * \param type The type of function to postpone * \param time The time at which the event happens */ void gtg_record(enum event_type_t type, varPrec time, ...); /** * \ingroup GTGReplay * \fn void gtg_write_events(long nb_events_to_write) * \brief run the first nb_events_to_write events * \param nb_events_to_write The number of functions to process (-1 for all functions) */ void gtg_write_events(long nb_events_to_write); #endif /* GTG_REPLAY_H */ gtg-trace-0.2-3/inc/GTGStack.h000066400000000000000000000013051446421307700157300ustar00rootroot00000000000000#ifndef GTG_STACK_H #define GTG_STACK_H #include "GTGList.h" typedef struct gtg_list gtg_stack; typedef gtg_stack* gtg_stack_t; #define GTG_STACK_INIT(ptr) GTG_LIST_INIT(ptr) #define GTG_STACK(ptr) GTG_LIST(ptr) #define gtg_stack_entry(ptr, type, member) gtg_list_entry(ptr, type, member) static inline void gtg_stack_push(gtg_stack_t lnew, gtg_stack_t p_stack) { gtg_list_add_tail(lnew, p_stack); } static inline void gtg_stack_pop(gtg_stack_t p_stack) { gtg_list_del(p_stack->prev); } static inline gtg_stack_t gtg_stack_top(gtg_stack_t p_stack) { return p_stack->prev; } static inline int gtg_stack_empty(gtg_stack_t p_stack) { return p_stack->prev == p_stack; } #endif /* GTG_STACK_H */ gtg-trace-0.2-3/inc/GTGTypes.h000066400000000000000000000023261446421307700157730ustar00rootroot00000000000000/** * \file GTGtypes.h * \version 0.1 * \brief * * types define some types that are used in the library. * * \authors * Developpers are : \n * Francois Rue - francois.rue@labri.fr \n * Francois Trahay - francois.trahay@labri.fr \n * Johnny Jazeix - jazeix@enseirb-matmeca.fr \n * Kevin Coulomb - kevin.coulomb@gmail.com \n * Mathieu Faverge - faverge@labri.fr \n * Olivier Lagrasse - lagrasse@enseirb-matmeca.fr \n * */ #ifndef _GTG_TYPES_H_ #define _GTG_TYPES_H_ /** * \defgroup type Types used */ /** * \ingroup type Type used for time and value in C * \brief Use the double precision type for time and value. */ typedef double varPrec; /** * \ingroup type Return values of functions * \enum trace_return_t * \brief Define various return values */ typedef enum trace_return_t{ TRACE_SUCCESS , /*!< Success of the call. */ TRACE_ERR_OPEN , /*!< Failed to open files to write. */ TRACE_ERR_CLOSE, /*!< Failed to close file. */ TRACE_ERR_WRITE, /*!< Failed to write trace. */ TRACE_ERR_NOT_IMPL /*!< Function not impleneted. */ } trace_return_t; #endif /* _GTG_TYPES_H_ */ gtg-trace-0.2-3/inc/Makefile.am000066400000000000000000000005351446421307700162100ustar00rootroot00000000000000# Copyright © CNRS, INRIA, Université Bordeaux 1 # See COPYING in top-level directory. include_HEADERS = GTG.h \ GTGBasic.h \ GTGColor.h \ GTGReplay.h \ GTGMemory.h \ GTGOTF.h \ GTGOTF_Basic.h \ GTGOTF_Structs.h \ GTGPaje.h \ GTGPaje_Basic.h \ GTGTypes.h \ GTGList.h \ GTGStack.h \ GTGCompress.h gtg-trace-0.2-3/release_notes000066400000000000000000000012021446421307700161460ustar00rootroot00000000000000The GTG team is pleased to announce the release 0.1 Generic Trace Generator (GTG) aims at providing a simple and generic interface for generating execution traces in several formats (OTF, Paje, etc.) It will be used by EZTrace and ViTE, but it can also be used by any application. GTG is available under the CECILL-C license and it can be downloaded from the GTG website: https://github.com/trahay/Generic-Trace-Generator gtg 0.1 is the first release of this project. This version includes: * Full support for PAJE and VITE formats * Partial support for OTF format. The following features are missing for this format: * links * colors gtg-trace-0.2-3/src/000077500000000000000000000000001446421307700141675ustar00rootroot00000000000000gtg-trace-0.2-3/src/C/000077500000000000000000000000001446421307700143515ustar00rootroot00000000000000gtg-trace-0.2-3/src/C/GTGBasic1_c.c000066400000000000000000000331571446421307700164740ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include "GTG.h" #include "GTGPaje.h" #include "GTGBasic.h" #include "GTGReplay.h" #include "GTGOTF_Basic.h" #include "GTGPaje_Basic.h" /* verbose !=0 means debugging mode */ int verbose = 0; static traceType_t traceType; /* Flags that should be used */ gtg_flag_t gtg_flags; char* getName (int procNbr){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeGetName (procNbr); break; #endif #ifdef BUILD_OTF case OTF : break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return "0"; } void setTraceType (traceType_t type){ char* res; traceType = type; res = getenv("GTG_VERBOSE"); if(res) verbose = 1; } traceType_t getTraceType (){ return traceType; } int bufferedModeActivated() { return !(gtg_flags & GTG_FLAG_NOTBUF); } trace_return_t initTrace (const char* filename, int rank, gtg_flag_t flags){ /* first, let's initialize gtg */ gtg_color_init(); if( (flags & GTG_FLAG_USE_MPI) && (flags & GTG_FLAG_OUTOFORDER)) { fprintf(stderr, "Warning: you cannot record events out of order when using MPI\n"); flags ^= GTG_FLAG_OUTOFORDER; } gtg_flags = flags; switch (traceType){ #ifdef BUILD_PAJE case PAJE : return pajeInitTrace (filename, rank, flags, FMT_PAJE); break; case VITE : return pajeInitTrace (filename, rank, flags, FMT_VITE); break; #endif /* BUILD_PAJE */ #ifdef BUILD_OTF case OTF : return OTFInitTrace (filename, flags); break; #endif /* BUILD_OTF */ #ifdef BUILD_TAU case TAU : #endif /* BUILD_TAU */ default : break; } return TRACE_ERR_NOT_IMPL; } trace_return_t setCompress (int val){ #ifndef BUILD_OTF (void) val; #endif switch (traceType){ #ifdef BUILD_OTF case OTF : return OTFSetCompress (val); break; #endif case PAJE : return pajeSetCompress(val); break; case TAU : default : return TRACE_SUCCESS; } return TRACE_SUCCESS; } trace_return_t addContType (const char* alias, const char* contType, const char* name){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddContType (alias, contType, name); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddContType (alias, contType, name); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addStateType (const char* alias, const char* contType, const char* name){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddStateType (alias, contType, name); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddStateType (alias, contType, name); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addEventType (const char* alias, const char* contType, const char* name){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddEventType (alias, contType, name); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddEventType (alias, contType, name); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddLinkType (alias, name, contType, srcContType, destContType); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddLinkType (alias, name, contType, srcContType, destContType); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addVarType (const char* alias , const char* name, const char* contType){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddVarType (alias, contType, name); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddVarType (alias, contType, name); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addEntityValue (const char* alias, const char* entType, const char* name , gtg_color_t p_color){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddEntityValue (alias, entType, name, Paje_get_color(p_color)); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddEntityValue (alias, entType, name, OTF_get_color(p_color)); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name, const char* file){ #ifdef BUILD_OTF /* for OTF traces, adding a container consists in two steps: * 1 - defining the container (this appears in the trace headers) * 2 - starting the container (this appears in the body) * We need to define the container right now so that it can be refered to * before its start (for example a StartLink event may use this container * before its creation) */ if (traceType == OTF){ return OTFDefineContainer (alias, type, container, name, file); } #endif if(gtg_flags & GTG_FLAG_OUTOFORDER) { /* if the application records events out of order, don't execute this function right now. */ gtg_record(event_addContainer, time, alias, type, container, name, file); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : return pajeSeqAddContainer (time, alias, type, container, name); break; case VITE : return pajeAddContainer (time, alias, type, container, name, file); break; #endif #ifdef BUILD_OTF case OTF : return OTFStartContainer (time, alias, type, container, name, file); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t destroyContainer (varPrec time, const char* name, const char* type){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_destroyContainer, time, name, type); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeDestroyContainer (time, name, type); break; #endif #ifdef BUILD_OTF case OTF : return OTFDestroyContainer (time, name, type); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t setState (varPrec time, const char* type, const char* cont, const char* val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_setState, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeSetState (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFSetState (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t pushState (varPrec time, const char* type, const char* cont, const char* val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_pushState, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajePushState (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFPushState (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t popState (varPrec time, const char* type, const char* cont){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_popState, time, type, cont); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajePopState (time, type, cont); break; #endif #ifdef BUILD_OTF case OTF : return OTFPopState (time, type, cont); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addEvent (varPrec time, const char* type, const char* cont, const char* val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_addEvent, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddEvent (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddEvent (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t startLink (varPrec time, const char* type, const char* cont, const char* src, const char* dest, const char* val, const char* key){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_startLink, time, type, cont, src, dest, val, key); return TRACE_SUCCESS; } #ifndef BUILD_OTF (void) dest; #endif switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeStartLink (time, type, cont, src, val, key); break; #endif #ifdef BUILD_OTF case OTF : return OTFStartLink (time, type, src, dest, val, key); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t endLink (varPrec time, const char* type, const char* cont, const char* src, const char* dest, const char* val, const char* key){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_endLink, time, type, cont, src, dest, val, key); return TRACE_SUCCESS; } #ifndef BUILD_OTF (void) src; #endif switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeEndLink (time, type, cont, dest, val, key); break; #endif #ifdef BUILD_OTF case OTF : return OTFEndLink (time, type, src, dest, val, key); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t setVar (varPrec time, const char* type, const char* cont, varPrec val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_setVar, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeSetVar (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFSetVar (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t addVar (varPrec time, const char* type, const char* cont, varPrec val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_addVar, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddVar (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddVar (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t subVar (varPrec time, const char* type, const char* cont, varPrec val){ if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_record(event_subVar, time, type, cont, val); return TRACE_SUCCESS; } switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeSubVar (time, type, cont, val); break; #endif #ifdef BUILD_OTF case OTF : return OTFSubVar (time, type, cont, val); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t AddComment (const char* comment){ switch (traceType){ #ifdef BUILD_PAJE case PAJE : case VITE : return pajeAddComment (comment); break; #endif #ifdef BUILD_OTF case OTF : return OTFAddComment (comment); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } return TRACE_SUCCESS; } trace_return_t endTrace (){ int ret = TRACE_ERR_CLOSE; if(gtg_flags & GTG_FLAG_OUTOFORDER) { gtg_write_events(-1); } switch (traceType){ #ifdef BUILD_PAJE case PAJE : ret = pajeEndTrace (); break; case VITE : ret = viteEndTrace (); break; #endif #ifdef BUILD_OTF case OTF : ret = OTFEndTrace (); break; #endif #ifdef BUILD_TAU case TAU : #endif default : break; } gtg_color_exit(); return ret; } gtg-trace-0.2-3/src/C/GTGColor.c000066400000000000000000000151321446421307700161370ustar00rootroot00000000000000/** * \file GTGColor.c * \version 0.1 * \brief * * This file defines some basic colors to use in entity values for GTG. * */ #include #include #include "GTGColor.h" #define NB_DEFAULT_COLOR 22 struct gtg_color __gtg_colors[NB_DEFAULT_COLOR]; gtg_color_t GTG_BLACK; gtg_color_t GTG_RED; gtg_color_t GTG_GREEN; gtg_color_t GTG_BLUE; gtg_color_t GTG_WHITE; gtg_color_t GTG_TEAL; gtg_color_t GTG_DARKGREY; gtg_color_t GTG_YELLOW; gtg_color_t GTG_PURPLE; gtg_color_t GTG_LIGHTBROWN; gtg_color_t GTG_LIGHTGREY; gtg_color_t GTG_DARKBLUE; gtg_color_t GTG_PINK; gtg_color_t GTG_DARKPINK; gtg_color_t GTG_SEABLUE; gtg_color_t GTG_KAKI; gtg_color_t GTG_REDBLOOD; gtg_color_t GTG_BROWN; gtg_color_t GTG_GRENAT; gtg_color_t GTG_ORANGE; gtg_color_t GTG_MAUVE; gtg_color_t GTG_LIGHTPINK; /** * \ingroup color * \brief Black color */ #define GTG_BLACK_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(0, 0, 0) /** * \ingroup color * \brief Red color */ #define GTG_RED_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 0, 0) /** * \ingroup color * \brief Green color */ #define GTG_GREEN_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(0, 255, 0) /** * \ingroup color * \brief Blue color */ #define GTG_BLUE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(0, 0, 255) /** * \ingroup color * \brief White color */ #define GTG_WHITE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 255, 255) /** * \ingroup color * \brief Teal color */ #define GTG_TEAL_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(0, 255, 255) /** * \ingroup color * \brief Dark grey color */ #define GTG_DARKGREY_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(85, 85, 85) /** * \ingroup color * \brief Yellow color */ #define GTG_YELLOW_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 255, 0) /** * \ingroup color * \brief Purple color */ #define GTG_PURPLE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(153, 25, 230) /** * \ingroup color * \brief Light brown color */ #define GTG_LIGHTBROWN_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(170, 130, 130) /** * \ingroup color * \brief Light grey color */ #define GTG_LIGHTGREY_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(200, 200, 200) /** * \ingroup color * \brief Dark blue color */ #define GTG_DARKBLUE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(0, 0, 80) /** * \ingroup color * \brief Pink color */ #define GTG_PINK_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 0, 255) /** * \ingroup color * \brief Dark pink color */ #define GTG_DARKPINK_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(180, 80, 180) /** * \ingroup color * \brief Sea blue color */ #define GTG_SEABLUE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(25, 128, 200) /** * \ingroup color * \brief Kaki color */ #define GTG_KAKI_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(80, 100, 25) /** * \ingroup color * \brief Red blood color */ #define GTG_REDBLOOD_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(200, 25, 25) /** * \ingroup color * \brief Brown color */ #define GTG_BROWN_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(100, 25, 25) /** * \ingroup color * \brief Grenat color */ #define GTG_GRENAT_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(100, 0, 80) /** * \ingroup color * \brief Orange color */ #define GTG_ORANGE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 160, 0) /** * \ingroup color * \brief Mauve color */ #define GTG_MAUVE_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(128, 0, 255) /** * \ingroup color * \brief Light pink color */ #define GTG_LIGHTPINK_RGB (gtg_rgb_color_t) GTG_COLOR_SET_COLOR(255, 128, 255) void __init_color(gtg_color_t p_color, const char* name, gtg_rgb_color_t rgb) { p_color->color_name = (char*)malloc((strlen(name)+1)*sizeof(char)); strncpy(p_color->color_name, name, strlen(name)+1); p_color->rgb = rgb; } static int __gtg_color_initialized = 0; void gtg_color_init() { /* make sure that this function is only run once */ if(__gtg_color_initialized) return; __gtg_color_initialized = 1; /* fill the default color structures */ GTG_BLACK = &__gtg_colors[0]; GTG_RED = &__gtg_colors[1]; GTG_GREEN = &__gtg_colors[2]; GTG_BLUE = &__gtg_colors[3]; GTG_WHITE = &__gtg_colors[4]; GTG_TEAL = &__gtg_colors[5]; GTG_DARKGREY = &__gtg_colors[6]; GTG_YELLOW = &__gtg_colors[7]; GTG_PURPLE = &__gtg_colors[8]; GTG_LIGHTBROWN = &__gtg_colors[9]; GTG_LIGHTGREY = &__gtg_colors[10]; GTG_DARKBLUE = &__gtg_colors[11]; GTG_PINK = &__gtg_colors[12]; GTG_DARKPINK = &__gtg_colors[13]; GTG_SEABLUE = &__gtg_colors[14]; GTG_KAKI = &__gtg_colors[15]; GTG_REDBLOOD = &__gtg_colors[16]; GTG_BROWN = &__gtg_colors[17]; GTG_GRENAT = &__gtg_colors[18]; GTG_ORANGE = &__gtg_colors[19]; GTG_MAUVE = &__gtg_colors[20]; GTG_LIGHTPINK = &__gtg_colors[21]; __init_color(GTG_BLACK , "BLACK" , GTG_BLACK_RGB); __init_color(GTG_RED , "RED" , GTG_RED_RGB); __init_color(GTG_GREEN , "GREEN" , GTG_GREEN_RGB); __init_color(GTG_BLUE , "BLUE" , GTG_BLUE_RGB); __init_color(GTG_WHITE , "WHITE" , GTG_WHITE_RGB); __init_color(GTG_TEAL , "TEAL" , GTG_TEAL_RGB); __init_color(GTG_DARKGREY , "DARKGREY" , GTG_DARKGREY_RGB); __init_color(GTG_YELLOW , "YELLOW" , GTG_YELLOW_RGB); __init_color(GTG_PURPLE , "PURPLE" , GTG_PURPLE_RGB); __init_color(GTG_LIGHTBROWN, "LIGHTBROWN", GTG_LIGHTBROWN_RGB); __init_color(GTG_LIGHTGREY , "LIGHTGREY" , GTG_LIGHTGREY_RGB); __init_color(GTG_DARKBLUE , "DARKBLUE" , GTG_DARKBLUE_RGB); __init_color(GTG_PINK , "PINK" , GTG_PINK_RGB); __init_color(GTG_DARKPINK , "DARKPINK" , GTG_DARKPINK_RGB); __init_color(GTG_SEABLUE , "SEABLUE" , GTG_SEABLUE_RGB); __init_color(GTG_KAKI , "KAKI" , GTG_KAKI_RGB); __init_color(GTG_REDBLOOD , "REDBLOOD" , GTG_REDBLOOD_RGB); __init_color(GTG_BROWN , "BROWN" , GTG_BROWN_RGB); __init_color(GTG_GRENAT , "GRENAT" , GTG_GRENAT_RGB); __init_color(GTG_ORANGE , "ORANGE" , GTG_ORANGE_RGB); __init_color(GTG_MAUVE , "MAUVE" , GTG_MAUVE_RGB); __init_color(GTG_LIGHTPINK , "LIGHTPINK" , GTG_LIGHTPINK_RGB); } void gtg_color_exit() { int i; for (i=0; icolor_name != NULL ) free(color->color_name); free(color); } gtg-trace-0.2-3/src/C/GTGMemory.c000066400000000000000000000043261446421307700163340ustar00rootroot00000000000000#include #include #include "GTGMemory.h" #define CTRL_ALLOC(ptr) \ { \ if(!ptr) { \ fprintf(stderr, "Cannot allocate memory. Aborting\n"); \ abort(); \ } \ } /* Initialize the allocator */ void gtg_block_memory_init(gtg_memory_t *memory, size_t block_len, long initial_block_number) { gtg_memory_t temp_mem = NULL; /* allocate the memory descriptor */ temp_mem = (gtg_memory_t) malloc(sizeof(struct gtg_memory)); CTRL_ALLOC(temp_mem); if (block_len < sizeof(void *)) { block_len = sizeof(void *); } /* allocate n * block_len */ temp_mem->first_mem = malloc((initial_block_number * block_len) + sizeof(void *)); CTRL_ALLOC(temp_mem->first_mem); memset(temp_mem->first_mem, 0, (initial_block_number * block_len) + sizeof(void *)); temp_mem->current_mem = temp_mem->first_mem; *(void **) ((char *) temp_mem->current_mem + (initial_block_number * block_len)) = NULL; temp_mem->block_len = block_len; temp_mem->mem_len = initial_block_number; temp_mem->first_free = NULL; temp_mem->first_new = 0; temp_mem->nb_allocated = 0; *memory = temp_mem; } /* Allocate a block of data */ void* gtg_block_malloc(gtg_memory_t memory) { void *ptr = NULL; if (memory->first_free != NULL) { /* There is a remaining block in memory */ ptr = memory->first_free; memory->first_free = *(void **) ptr; } else { if (memory->first_new >= memory->mem_len) { /* The allocated memory is exhausted. Allocate a larger space. */ const size_t mem_size = memory->mem_len * memory->block_len; void *new_mem = malloc(mem_size + sizeof(void *)); memset(new_mem, 0, mem_size + sizeof(void *)); *(void **) ((char *) new_mem + mem_size) = NULL; *(void **) ((char *) memory->current_mem + mem_size) = new_mem; memory->current_mem = new_mem; memory->first_new = 0; } ptr = (char *) memory->current_mem + memory->block_len * memory->first_new; memory->first_new++; } memory->nb_allocated++; return ptr; } /* Free a block of data */ void gtg_block_free(gtg_memory_t memory, void *ptr) { *(void **) ptr = memory->first_free; memory->first_free = ptr; memory->nb_allocated--; } gtg-trace-0.2-3/src/C/GTGReplay.c000066400000000000000000000352531446421307700163230ustar00rootroot00000000000000#define _GNU_SOURCE #include #include #include #include #include "GTGBasic.h" #include "GTGReplay.h" #include "GTGMemory.h" #define MAX_EVENTS (2048*1024) #define SHORTCUT_RATIO 1000 extern gtg_flag_t gtg_flags; #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) /* This file is used for ensuring that events are recorded in the correct order. * This is done by storing events in a list. The list is flushed when full or at the * end of the application. When the list is flushed, when event is recorded (by calling * addVar, startLink, etc.) * When adding an event to the list, it is inserted in the correct order (so the list * is sorted). In order to avoid browsing the entire list when inserting an event, * a 'shortcut' list is also implemented. One event out of 1000 is inserted in the * shortcut list. Thus, looking for the place to insert an element, we can browse the * shortcut list until we find the right shortcut. We then browse the event list, starting * from this shortcut. This permits to speed up the insertion of events by approx 1000. */ /* event list */ struct event_list_t { struct event_list_t *next; struct event_list_t *prev; enum event_type_t type; varPrec time; uint64_t data[6]; }; /* shortcut list */ struct event_list_shortcut_t { struct event_list_shortcut_t *next; struct event_list_shortcut_t *prev; varPrec time; struct event_list_t* event; }; /* queue and tail of the shortcut list */ static struct event_list_shortcut_t* __shortcut_first = NULL; static struct event_list_shortcut_t* __shortcut_last = NULL; /* queue and tail of the event list */ static struct event_list_t* __first_event = NULL; static struct event_list_t* __last_event = NULL; static int nb_events = 0; /* block allocators used for the event list and the shortcut list */ gtg_memory_t memory; gtg_memory_t shortcut_memory; /* insert new_event *after* cur_event */ static void __event_list_insert_after(struct event_list_t*new_event, struct event_list_t *cur_event) { assert(cur_event); new_event->prev = cur_event; new_event->next = cur_event->next; cur_event->next = new_event; if(cur_event->next) new_event->next->prev = new_event; else /* this is the last event */ __last_event = new_event; } /* insert new_event *before* cur_event */ static void __event_list_insert_before(struct event_list_t*new_event, struct event_list_t *cur_event) { assert(cur_event); new_event->next = cur_event; new_event->prev = cur_event->prev; cur_event->prev = new_event; if(cur_event->prev) new_event->prev->next = new_event; else __first_event = new_event; } /* for debugging purpose, print the list of recorded events */ static inline void __gtg_print_events() { struct event_list_t* cur_event = __first_event; while(cur_event) { printf("[%p]\t T=%f \t event type=%d\n", (void*)cur_event, cur_event->time, cur_event->type); cur_event = cur_event->next; } } static inline void __gtg_print_n_events(int nb_events, struct event_list_t *p_event) { struct event_list_t* cur_event = p_event; int i; for(i=0; itime, cur_event->type); cur_event = cur_event->next; } } /* run the first nb_events_to_write events * if nb_events_to_write == 1, it run all recorded events. */ void gtg_write_events(long nb_events_to_write) { struct event_list_t* cur_event = __first_event; struct event_list_t* prev; struct event_list_t* next; void* ptr; volatile int n = 0; int cpt=0; /* unset the outoforder flag so that functions can be called for real */ gtg_flags ^= GTG_FLAG_OUTOFORDER; while(cur_event && ((nb_events_to_write<0) ||(n < nb_events_to_write))) { /* for each event, call the corresponding function */ cpt++; switch(cur_event->type) { case event_addContainer: /* get the 5 parameters that were recorded and pass them to addContainer */ addContainer(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2], (char*)cur_event->data[3], (char*)cur_event->data[4]); break; case event_destroyContainer: destroyContainer(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1]); break; case event_setState: setState(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2]); break; case event_pushState: pushState(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2]); break; case event_popState: popState(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1]); break; case event_addEvent: addEvent(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2]); break; case event_startLink: startLink(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2], (char*)cur_event->data[3], (char*)cur_event->data[4], (char*)cur_event->data[5]); break; case event_endLink: endLink(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (char*)cur_event->data[2], (char*)cur_event->data[3], (char*)cur_event->data[4], (char*)cur_event->data[5]); break; case event_setVar: setVar(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (double)cur_event->data[2]); break; case event_addVar: addVar(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (double)cur_event->data[2]); break; case event_subVar: subVar(cur_event->time, (char*)cur_event->data[0], (char*)cur_event->data[1], (double)cur_event->data[2]); break; default: fprintf(stderr, "Unknown event type: %d\n", cur_event->type); } /* remove the current item from the list */ prev = cur_event->prev; next = cur_event->next; if(prev) prev->next = next; if(next) next->prev = prev; n++; nb_events--; /* delete the current event */ ptr = cur_event; cur_event = next; gtg_block_free(memory, ptr); } __first_event = cur_event; /* update the shortcut list */ { struct event_list_shortcut_t *cur_shortcut = __shortcut_first; if(__first_event) { /* the event list is not empty. Remove the shortcut that correspond * to events that were processed. */ while(cur_shortcut && cur_shortcut->time < __first_event->time) { struct event_list_shortcut_t * next_shortcut = cur_shortcut->next; next_shortcut->prev = NULL; gtg_block_free(shortcut_memory, cur_shortcut); cur_shortcut = next_shortcut; } } else { /* the event list is empty. Let's empty the shortcut list. */ while(cur_shortcut) { struct event_list_shortcut_t * next_shortcut = cur_shortcut->next; cur_shortcut->prev = NULL; gtg_block_free(shortcut_memory, cur_shortcut); cur_shortcut = next_shortcut; } } __shortcut_first = cur_shortcut; if(!__shortcut_first) /* if the shortcut list is empty, update shortcut_last */ __shortcut_last = NULL; } /* set the outoforder flag so that the next calls to functions can be recorded */ gtg_flags |= GTG_FLAG_OUTOFORDER; } /* update the shortcut list */ static void __gtg_insert_shortcut(struct event_list_t* new_event) { struct event_list_shortcut_t *new_shortcut; /* create a shortcut (roughly) once every 1000 events */ if(nb_events % SHORTCUT_RATIO) return; /* allocate and initialize the new shortcut */ new_shortcut = gtg_block_malloc(shortcut_memory); new_shortcut->time = new_event->time; new_shortcut->event = new_event; /* insert the shortcut in the shortcut list */ if(!__shortcut_first || !__shortcut_last) { /* the shortcut list is not initialized yet */ __shortcut_first = new_shortcut; __shortcut_last = new_shortcut; new_shortcut->next = NULL; new_shortcut->prev = NULL; return; } /* browse the shortcut list and find where to insert new_shortcut */ { struct event_list_shortcut_t * cur_shortcut = __shortcut_last; while(cur_shortcut && cur_shortcut->time > new_shortcut->time) { cur_shortcut = cur_shortcut->prev; } if(!cur_shortcut) { /* we need to insert new_shortcut at the beginning of the list */ new_shortcut->next = __shortcut_first; new_shortcut->prev = NULL; new_shortcut->next->prev = new_shortcut; __shortcut_first = new_shortcut; return; } /* insert new_shortcut between cur_shortcut and cur_shortcut->next */ new_shortcut->next = cur_shortcut->next; new_shortcut->prev = cur_shortcut; cur_shortcut->next = new_shortcut; if(new_shortcut->next) new_shortcut->next->prev = new_shortcut; else { __shortcut_last = new_shortcut; } } } /* Insert an event in the list of events. * At any time, this list is sorted. */ static void __gtg_insert(struct event_list_t* new_event) { struct event_list_t* cur_event = NULL; struct event_list_t* next_event = NULL; /* The list of event is not initialized yet */ if(!__last_event || !__first_event) { __last_event = new_event; __first_event = new_event; new_event->next = NULL; new_event->prev = NULL; goto out; } /* This is the 'normal' case: the event is the last one */ if(likely(new_event->time >= __last_event->time)) { /* the event is the last one */ __last_event->next = new_event; new_event->prev = __last_event; new_event->next = NULL; __last_event = new_event; goto out; } if(new_event->time < __first_event->time) { /* the event is the first one */ __first_event->prev = new_event; new_event->next = __first_event; new_event->prev = NULL; __first_event = new_event; goto out; } /* the last event happened after new_event. * let's browse the list and find a place to insert new_event. */ cur_event = __first_event; next_event = __first_event->next; if(unlikely(!next_event)) { /* only one event in the list. We know that it happened after new_event. * let's insert new_event in the first position */ /* this should never happen */ new_event->next = __first_event; __first_event->prev = new_event; __first_event = new_event; goto out; } /* browse the shortcut list starting from the end (since it is likely that new_event * happened not so long before last_event. */ { struct event_list_shortcut_t* cur_shortcut = __shortcut_last; while(cur_shortcut) { if(cur_shortcut->time <= new_event->time) { /* we need to insert new_event between cur_shortcut and cur_shortcut->next */ /* browse the list, starting from cur_shortcut->event */ cur_event = cur_shortcut->event; while(cur_event->time <= new_event->time) { /* We don't need to check for the end of the list. * This should never happen since this case is handled earlier */ cur_event = cur_event->next; } assert(cur_event->prev->time <= new_event->time); /* insert new_event between cur_event->prev and cur_event */ __event_list_insert_before(new_event, cur_event); goto out; } if(cur_shortcut->prev) cur_shortcut = cur_shortcut->prev; else /* we browsed the whole list but didn't find the place where to insert the event. */ break; } } /* cur_shortcut is NULL */ /* browse the list starting from the end (since it is likely that new_event * happened not so long before last_event. */ cur_event = __last_event; while(cur_event->time > new_event->time) { if(cur_event->prev) cur_event = cur_event->prev; else break; } /* insert new_event after cur_event */ __event_list_insert_after(new_event, cur_event); out: __gtg_insert_shortcut(new_event); } /* copy nb_string string parameters and nb_double double parameters into the data array of evt * warning: actually, the parameters are not copied (in the case of string) */ static void __copy_args(struct event_list_t* evt, int nb_string, int nb_double, va_list args) { int i; for(i=0; idata[i] = (uint64_t) x; } for(i=nb_string; idata[i] = (uint64_t)x; } } /* postpone the recording of an event */ void gtg_record(enum event_type_t type, varPrec time, ...) { struct event_list_t* new_event; va_list arguments; static int initialized=0; if(!initialized) { /* initialize the block allocator */ gtg_block_memory_init(&memory, sizeof(struct event_list_t), MAX_EVENTS); gtg_block_memory_init(&shortcut_memory, sizeof(struct event_list_shortcut_t), MAX_EVENTS/1000); initialized = 1; } /* If the buffer is full, flush half of the recorded events. * There may be out of order events, but it is quite unlikely. */ if(nb_events > MAX_EVENTS) gtg_write_events(MAX_EVENTS/2); /* allocate the new event */ new_event = gtg_block_malloc(memory); new_event->next = NULL; new_event->type = type; new_event->time = time; va_start (arguments, time); /* Depending on the type of event, copy its parameters */ switch(type) { case event_startLink: case event_endLink: /* 6 parameters */ __copy_args(new_event, 6, 0, arguments); break; case event_addContainer: /* 5 parameters */ __copy_args(new_event, 5, 0, arguments); break; case event_setState: case event_pushState: case event_addEvent: /* 3 parameters */ __copy_args(new_event, 3, 0, arguments); break; case event_setVar: case event_addVar: case event_subVar: /* 2 string parameters + 1 double */ __copy_args(new_event, 2, 1, arguments); break; case event_destroyContainer: case event_popState: /* 2 parameters */ __copy_args(new_event, 2, 0, arguments); break; default: fprintf(stderr, "Unknown event type: %d\n", type); } va_end (arguments); /* Insert the new event in the list */ nb_events++; __gtg_insert(new_event); } gtg-trace-0.2-3/src/C/OTF_GTGBasic1_c.c000066400000000000000000000434141446421307700172010ustar00rootroot00000000000000#ifdef BUILD_OTF #define _GNU_SOURCE #include #include #include #include "GTG.h" #include "GTGOTF.h" /* set in GTGBasic1_c.c * verbose !=0 means debugging mode */ extern int verbose; /* set to 'val' if the initialization should invoke set_compression * This may happen when setCompress is called before initTrace */ int use_compress = 0; /* Flags that should be used. */ static gtg_flag_t otf_flags; /* OTF data */ static OTF_FileManager* manager = NULL; static OTF_Writer* writer = NULL; /* each of these instances of structures corresponds to the NIL value. It contains: * - the head of the list * - the first identifier */ ContainerType_t ctType; Container_t conts; StateType_t stateTypes; EntityValue_t states; VariableType_t variableTypes; Variable_t variables; EventType_t eventTypes; LinkType_t linkTypes; /* Root name */ static char *filename = NULL; #define CHECK_RESULT(__func__) { \ if(__func__ != 1) { \ fprintf(stderr, "Error while writing the OTF trace\n"); \ abort(); \ } \ } #define TIMER_RES 100000. struct otf_color otf_color_null; const otf_color_t OTF_get_color(gtg_color_t color) { /* todo */ return &otf_color_null; } /* * Local methods for OTF only, will be put in an other file after to be cleaner than now... */ #define getXXXPtrFromName(_type_, list_head) \ struct _type_ *get##_type_##PtrFromName(const char *name) { \ struct _type_ *ptr; \ if(name == NULL) { \ return NULL; \ } \ gtg_list_for_each_entry(ptr, &(list_head).token, token) { \ if(strcmp(name, ptr->name) == 0 \ || strcmp(name, ptr->alias) == 0) { \ return ptr; \ } \ } \ return NULL; \ } #define getXXXFromName(__type__) \ int get##__type__##FromName(const char *name) { \ struct __type__ *res = get##__type__##PtrFromName(name); \ return (res? res->id : __type__##_NIL); \ } /* generate functions that permit to retrieve a pointer to an object*/ getXXXPtrFromName(ContainerType, ctType) getXXXPtrFromName(Container, conts) getXXXPtrFromName(StateType, stateTypes) getXXXPtrFromName(EntityValue, states) getXXXPtrFromName(VariableType, variableTypes) getXXXPtrFromName(EventType, eventTypes) getXXXPtrFromName(LinkType, linkTypes) /* generate functions that permit to retrieve the id of objects */ getXXXFromName(ContainerType) getXXXFromName(Container) getXXXFromName(StateType) getXXXFromName(EntityValue) getXXXFromName(VariableType) getXXXFromName(EventType) getXXXFromName(LinkType) /* * return a pointer to the Variable whose container is cont and whose variable type is type. * return NULL if not found */ Variable_t *getVariablePtrFromCont(int cont, int type) { struct Variable *ptr; /* todo: use one list of variable per container */ gtg_list_for_each_entry(ptr, &(variables).token, token) { if(type == ptr->type && cont == ptr->parent) { return ptr; } } return NULL; } /* * return the id of the Variable whose container is cont and whose variable type is type. * return NULL if not found */ int getVariableFromCont(int cont, int type) { Variable_t *res = getVariablePtrFromCont(cont, type); return (res? res->id : Variable_NIL); } /* Initialize all the OTF-specific variables */ static void __OTF_init() { /* initialize otf_color_null */ asprintf(&otf_color_null.colorID, "NO COLOR"); otf_color_null.red = 0; otf_color_null.green = 0; otf_color_null.blue = 0; /* initialize all the lists/stacks */ init_ContainerType(ctType); init_Container(conts); init_StateType(stateTypes); init_EntityValue(states); init_VariableType(variableTypes); init_Variable(variables); init_EventType(eventTypes); init_LinkType(linkTypes); } /* Beginning of the implementation of the interface for OTF */ trace_return_t OTFInitTrace(const char* filenam, gtg_flag_t flags) { int ret = TRACE_ERR_OPEN; otf_flags = flags; /* first, let's initialize all the OTF-specific variables */ __OTF_init(); filename = (char *)malloc (sizeof (char)* (strlen (filenam)+1)); strcpy (filename, filenam); /* Open maximum of a MAX_PROCESS files for writing trace */ manager = OTF_FileManager_open(MAX_PROCESS); if(manager == NULL) { fprintf (stderr, "Failed to open a manager for OTF. \n Leaving \n"); return (trace_return_t) ret; } writer = OTF_Writer_open(filename, 0, manager); if(writer == NULL) { OTF_FileManager_close(manager); manager = NULL; fprintf (stderr, "Failed to open a writer for OTF. \n Leaving \n"); return (trace_return_t) ret; } OTF_Writer_writeDefTimerResolution(writer, 0, TIMER_RES); if(use_compress) OTF_Writer_setCompression (writer, use_compress); OTFAddContType("0", NULL, "0"); return TRACE_SUCCESS; } trace_return_t OTFSetCompress(int val) { if(writer) { if(OTF_Writer_setCompression (writer, val)) return TRACE_SUCCESS; } else { /* postpone the invocation of setCompression */ use_compress=val; } return TRACE_ERR_WRITE; } trace_return_t OTFAddContType (const char* alias, const char* contType, const char* name) { uint32_t parent = 0; ContainerType_t *p_cont; if(contType != NULL && strcmp(contType, "0") != 0) { /* get its parent id */ parent = getContainerTypeFromName(contType); } /* allocate the container type, initialise it and add it to the list of * container types. */ alloc_init_struct(ContainerType_t, p_cont, &ctType.token, name, alias); if(verbose) printf("addCtType : name %s, alias %s, contType %s\n", name, alias, contType); return TRACE_SUCCESS; } trace_return_t OTFAddStateType (const char* alias, const char* contType, const char* name) { /* allocate the state type, initialise it and add it to the list of * state types. */ StateType_t *p_state; alloc_init_struct(StateType_t, p_state, &stateTypes.token, name, alias); if(verbose) printf("addStateType : id %d, alias %s, name %s, contType %s\n", p_state->id, alias, name, contType); CHECK_RESULT(OTF_Writer_writeDefFunctionGroup(writer, 0, p_state->id, name)); return TRACE_SUCCESS; } trace_return_t OTFAddEventType (const char* alias, const char* contType, const char* name) { /* allocate the event type, initialise it and add it to the list of * event types. */ EventType_t *p_event; alloc_init_struct(EventType_t, p_event, &eventTypes.token, name, alias); p_event->contType = getContainerTypeFromName(contType); if(verbose) printf("addEventType : id %d, alias %s, name %s, contType %s\n", p_event->id, alias, name, contType); CHECK_RESULT(OTF_Writer_writeDefMarker(writer, 0, p_event->id, name, OTF_MARKER_TYPE_UNKNOWN)); return TRACE_SUCCESS; } trace_return_t OTFAddLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType) { /* allocate the link type, initialise it and add it to the list of * link types. */ LinkType_t *p_link; alloc_init_struct(LinkType_t, p_link, &linkTypes.token, name, alias); p_link->contType = getContainerTypeFromName(contType); p_link->srcType = getContainerTypeFromName(srcContType); p_link->destType = getContainerTypeFromName(destContType); if(verbose) printf("addLinkType : id %d, alias %s, name %s, contType %s, src %s, dest %s\n", p_link->id, alias, name, contType, srcContType, destContType); return TRACE_SUCCESS; } trace_return_t OTFAddVarType (const char* alias , const char* contType, const char* name) { /* allocate the Variable type, initialise it and add it to the list of * variable types. */ VariableType_t *p_variable; alloc_init_struct(VariableType_t, p_variable, &variableTypes.token, name, alias); CHECK_RESULT(OTF_Writer_writeDefCounterGroup (writer, 0, p_variable->id, name)); if(verbose) printf("addVarType : id %d, alias %s, name %s, contType %s\n", p_variable->id, alias, name, contType); return TRACE_SUCCESS; } trace_return_t OTFAddEntityValue (const char* alias, const char* entType, const char* name , const otf_color_t color) { int type; EntityValue_t *p_ent; type = getStateTypeFromName(entType); alloc_init_struct(EntityValue_t, p_ent, &states.token, name, alias); if(verbose) printf("addEntityValue : id %d, alias %s, name %s, type %d\n", p_ent->id, alias, name, type); CHECK_RESULT(OTF_Writer_writeDefFunction(writer, 0, p_ent->id, name, type, 0)); return TRACE_SUCCESS; } trace_return_t OTFDefineContainer (const char* alias, const char* type, const char* container, const char* name, const char* file) { int parent; Container_t *p_cont; parent = getContainerFromName(container); /*int ctType = getContainerTypeFromName(type);*/ /* allocate the Container, initialize it and add it to the list of * containers. */ alloc_init_struct(Container_t, p_cont, &conts.token, name, alias); /* Initialize the state stack. */ init_State(p_cont->state_stack); if(verbose) printf("addCont : parent %d, id %d, name %s, alias %s, type %s, parent %s\n", parent, p_cont->id, name, alias, type, container); CHECK_RESULT(OTF_Writer_writeDefProcess(writer, 0, p_cont->id, name, parent)); return TRACE_SUCCESS; } trace_return_t OTFStartContainer (varPrec time, const char* alias, const char* type, const char* container, const char* name, const char* file) { uint32_t new_container = getContainerFromName(alias); if(!new_container) { /* container not yet defined */ OTFDefineContainer(alias, type, container, name, file); } OTF_Writer_writeBeginProcess (writer, time*TIMER_RES, new_container); return TRACE_SUCCESS; } trace_return_t OTFSeqAddContainer (varPrec time, const char* alias, const char* type, const char* container, const char* name) { return OTFStartContainer(time, alias, type, container, name, NULL); } trace_return_t OTFDestroyContainer (varPrec time, const char* name, const char* type) { uint32_t process = getContainerFromName(name); CHECK_RESULT(OTF_Writer_writeEndProcess (writer, time*TIMER_RES, process)); return TRACE_SUCCESS; } trace_return_t OTFSetState (varPrec time, const char* type, const char* cont, const char* val) { Container_t *p_parent = getContainerPtrFromName(cont); int stateType = getStateTypeFromName(type); int state = getEntityValueFromName(val); /* We need to free the current State structure (if it exists). */ State_t* p_state; if(!gtg_stack_empty(&p_parent->state_stack.token)) { p_state = gtg_list_entry(gtg_stack_top(&p_parent->state_stack.token), State_t, token); gtg_stack_pop(&p_parent->state_stack.token); free(p_state); } /* Allocate a new State structure and fill it */ alloc_State(p_state, state, p_parent->id, stateType); /* Add the structure to the container state stack. */ gtg_stack_push(&p_state->token, &p_parent->state_stack.token); if(verbose) printf("SetState : parent %d, stateType %d, val %d\n", p_parent->id, stateType, state); CHECK_RESULT(OTF_Writer_writeEnter (writer, time*TIMER_RES, state, p_parent->id, 0)); return TRACE_SUCCESS; } trace_return_t OTFPushState (varPrec time, const char* type, const char* cont, const char* val) { Container_t *p_parent = getContainerPtrFromName(cont); int stateType = getStateTypeFromName(type); int value = getEntityValueFromName(val); State_t* p_state; /* Allocate a new State structure and fill it */ alloc_State(p_state, value, p_parent->id, stateType); /* Add the structure to the container state stack. */ gtg_stack_push(&p_state->token, &p_parent->state_stack.token); if(verbose) printf("PushState : parent %d, stateType %d, val %d\n", p_parent->id, stateType, value); CHECK_RESULT(OTF_Writer_writeEnter (writer, time*TIMER_RES, value, p_parent->id, 0)); return TRACE_SUCCESS; } trace_return_t OTFPopState (varPrec time, const char* type, const char* cont) { /* Pop and set */ Container_t *p_parent = getContainerPtrFromName(cont); State_t *p_state; /* Free the current State structure (if it exists). */ if(!gtg_stack_empty(&p_parent->state_stack.token)) { /* Get the top of the stack. */ p_state = gtg_list_entry(gtg_stack_top(&p_parent->state_stack.token), State_t, token); gtg_stack_pop(&p_parent->state_stack.token); } else { /* The stack is empty, don't do anything and print a warning */ fprintf(stderr, "Warning: PopState called, but the stack is empty!\n"); return TRACE_ERR_WRITE; } if(verbose) printf("PopState : parent %d, stateType %d, val %d\n", p_state->cont, p_state->stateType, p_state->value); CHECK_RESULT(OTF_Writer_writeLeave (writer, time*TIMER_RES, p_state->value, p_state->cont, 0)); free(p_state); return TRACE_SUCCESS; } trace_return_t OTFAddEvent (varPrec time , const char* type, const char *cont, const char* val){ uint32_t process = getContainerFromName(cont); uint32_t eventType = getEventTypeFromName(type); CHECK_RESULT(OTF_Writer_writeMarker (writer, time*TIMER_RES, process, eventType, val)); if(verbose) printf("AddEvent : parent %d, eventType %d, val %s\n", process, eventType, val); return TRACE_SUCCESS; } trace_return_t OTFStartLink (varPrec time, const char* type, const char* src, const char* dest, const char* val , const char* key){ uint32_t source = getContainerFromName(src); uint32_t destination = getContainerFromName(dest); uint32_t linkType = getLinkTypeFromName(type); CHECK_RESULT(OTF_Writer_writeSendMsg(writer, time*TIMER_RES, source, destination, 0, linkType, 0, 0)); if(verbose) printf("StartLink : time %f, src %d, dest %d, linkType %d, val %s, key %s\n", time*TIMER_RES, source, destination, linkType, val, key); return TRACE_SUCCESS; } trace_return_t OTFEndLink (varPrec time, const char* type, const char* src, const char* dest, const char* val, const char* key){ uint32_t src_cont = getContainerFromName(src); uint32_t dest_cont = getContainerFromName(dest); uint32_t linkType = getLinkTypeFromName(type); CHECK_RESULT(OTF_Writer_writeRecvMsg(writer, time*TIMER_RES, dest_cont, src_cont, 0, linkType, 0, 0)); if(verbose) printf("EndLink : time %f, src %d, dest %d, linkType %d, val %s, key %s\n", time*TIMER_RES, src_cont, dest_cont, linkType, val, key); return TRACE_SUCCESS; } trace_return_t OTFSetVar (varPrec time, const char* type, const char* cont, varPrec val) { int parent = getContainerFromName(cont); int varType = getVariableTypeFromName(type); /* Check wether the variable already exists */ Variable_t * p_counter = getVariablePtrFromCont(parent, varType); if(!p_counter) { /* the variable doesn't exist yet. Allocate and initialize it */ alloc_Variable(p_counter, (gtg_list_entry(variables.token.prev, Variable_t, token)->id) + 1, parent, varType, 0); gtg_list_add_tail(&(p_counter->token), &(variables.token)); CHECK_RESULT(OTF_Writer_writeDefCounter(writer, 0, p_counter->id, type, 0, varType, NULL)); } /* Update the value of the variable */ p_counter->value = val; if( p_counter->value < 0) { fprintf(stderr, "A counter value can not be negative!\n"); return TRACE_ERR_WRITE; } CHECK_RESULT(OTF_Writer_writeCounter (writer, time*TIMER_RES, parent, varType, p_counter->value)); if(verbose) printf("setVar : %s %s %f\n", type, cont, val); return TRACE_SUCCESS; } trace_return_t OTFAddVar (varPrec time, const char* type, const char* cont, varPrec val) { int parent = getContainerFromName(cont); int varType = getVariableTypeFromName(type); /* Check wether the variable already exists */ Variable_t * p_counter = getVariablePtrFromCont(parent, varType); if(!p_counter) { /* the variable doesn't exist yet. Allocate and initialize it */ alloc_Variable(p_counter, (gtg_list_entry(variables.token.prev, Variable_t, token)->id) + 1, parent, varType, 0 /* Let's assume that the initial value is 0 */); gtg_list_add_tail(&(p_counter->token), &(variables.token)); CHECK_RESULT(OTF_Writer_writeDefCounter(writer, 0, p_counter->id, type, 0, varType, NULL)); } /* update the variable value */ p_counter->value += val; if(p_counter->value < 0) { fprintf(stderr, "A counter value can not be negative!\n"); return TRACE_ERR_WRITE; } CHECK_RESULT(OTF_Writer_writeCounter (writer, time*TIMER_RES, parent, varType, p_counter->value)); if(verbose) printf("addVar : %s %s %f\n", type, cont, val); return TRACE_SUCCESS; } trace_return_t OTFSubVar (varPrec time, const char* type, const char* cont, varPrec val) { return OTFAddVar(time, type, cont, - (val) ); } trace_return_t OTFAddComment (const char* comment){ /* Not implemented yet */ return TRACE_ERR_WRITE; } trace_return_t OTFEndTrace () { Container_t *ptr, *tmp; State_t *ptr2, *tmp2; /* free all the allocated structures */ free_struct(ContainerType_t, ctType); free_struct(StateType_t, stateTypes); free_struct(VariableType_t, variableTypes); free_struct(EventType_t, eventTypes); free_struct(LinkType_t, linkTypes); free_struct(EntityValue_t, states); /* special case for the list of containers since each one contains a state stack */ gtg_list_for_each_entry_safe(ptr, tmp, &(conts).token, token) { gtg_list_del(&(ptr->token)); /* Free the State stack */ gtg_list_for_each_entry_safe(ptr2, tmp2, &(ptr->state_stack).token, token) { gtg_list_del(&(ptr2->token)); free(ptr2); } free(ptr->name); free(ptr->alias); free(ptr); } /* Close the output trace */ if(!OTF_Writer_close(writer)) { fprintf (stderr, "unable to close the file writer"); return TRACE_ERR_CLOSE; } writer = NULL; OTF_FileManager_close(manager); manager = NULL; if (filename) free (filename); filename = NULL; free(otf_color_null.colorID); return TRACE_SUCCESS; } #endif /* BUILD_OTF */ gtg-trace-0.2-3/src/C/gtg_compress.c000066400000000000000000000024071446421307700172140ustar00rootroot00000000000000 #include #include #include #include #include "GTGCompress.h" char* input_filename; char* output_filename; static void usage (int argc __attribute__((unused)), char **argv) { fprintf (stderr, "Usage : %s -i input_filename [-o output_filename] \n", argv[0]); } static void parse_args (int argc, char **argv) { int i; input_filename = NULL; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-o") == 0) { output_filename = argv[++i]; } else if (strcmp (argv[i], "-i") == 0) { if(input_filename) { usage (argc, argv); exit (-1); } input_filename = argv[++i]; } else { if(input_filename) { usage (argc, argv); exit (-1); } input_filename = argv[i]; } } } int main(int argc, char**argv) { parse_args(argc, argv); if(!input_filename) { fprintf(stderr, "please provide an input file and an output file\n"); exit(-1); } if(!output_filename) { asprintf(&output_filename, "%s.z", input_filename); } printf("compressing file %s into file %s\n", input_filename, output_filename); FILE *fin=fopen(input_filename, "r"); FILE *fout=fopen(output_filename, "w"); z_stream z; gtg_compress_init(&z, 1); gtg_compress_f2f(&z, fin, fout); return 0; } gtg-trace-0.2-3/src/C/gtg_compress_core.c000066400000000000000000000166021446421307700202260ustar00rootroot00000000000000 #include #include #include #include #include #include #include #include "GTGCompress.h" #define BUF_SIZE_MAX (1024*1024*32) /* block size used */ #define BLOCK_SIZE (128*1024) int gtg_compress_init(z_stream *z, int compression_ratio) { static int first_init = 1; int status = Z_OK; if(first_init) { int level = compression_ratio; z->zalloc = NULL; z->zfree = NULL; z->opaque = NULL; z->avail_in = 0; z->next_in = Z_NULL; status = deflateInit(z, level); if (status != Z_OK) { fprintf(stderr, "error at init: %d\n", status); } first_init=0; } return status; } int gtg_compress_m2m(z_stream *z, void* in_buf, uint32_t len, void* out_buf, uint32_t out_max_len) { int status; int offset_out = 0; /* offset in the dest buffer */ z->avail_out = out_max_len; z->avail_in = len; z->next_out = out_buf; z->next_in = in_buf; /* compress */ status = deflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d in compressing\n", status); return -1; } /* compute output len */ offset_out = out_max_len - z->avail_out; return offset_out; } int gtg_compress_m2f(z_stream *z, void* in_buf, uint32_t len, FILE* file_out) { int status; int offset_in = 0; int offset_out = 0; int total_written = 0; int cur_input_size = 0; uint8_t out_buf[BLOCK_SIZE]; int written = 0; /* compress each block of data */ while(offset_in < len) { z->next_out = out_buf; z->avail_out = BLOCK_SIZE; /* compute input buffer address */ if(offset_in + BLOCK_SIZE > len) z->avail_in = len - offset_in; else z->avail_in = BLOCK_SIZE; cur_input_size = z->avail_in; z->next_in = &((uint8_t*)in_buf)[offset_in]; /* compress */ status = deflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d in compressing\n", status); return -1; } /* compute new offset */ offset_out = BLOCK_SIZE - z->avail_out; offset_in += cur_input_size; /* write to disk */ written = fwrite(out_buf, sizeof(uint8_t), offset_out, file_out); if(written < offset_out) { fprintf(stderr, "warning: %d bytes out of %d were written to disk\n", written, offset_out); } total_written += written; } return total_written; } int gtg_compress_f2m(z_stream *z, FILE* file_in, void* out_buf, uint32_t out_max_len) { int status; int offset = 0; /* offset in the dest buffer */ uint8_t in_buf[BLOCK_SIZE]; int in_len = 0; while(!feof(file_in)) { /* read a block of data */ in_len = fread(in_buf, sizeof(uint8_t), BLOCK_SIZE, file_in); z->avail_in = in_len; z->next_in = in_buf; z->avail_out = out_max_len - offset; z->next_out = &((uint8_t*)out_buf)[offset]; /* compress the block */ status = deflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d in compressing\n", status); return -1; } /* compute output len */ offset = out_max_len - z->avail_out; } return offset; } int gtg_compress_f2f(z_stream *z, FILE* file_in, FILE* file_out) { int status; int offset = 0; /* offset in the dest buffer */ uint8_t in_buf[BLOCK_SIZE]; uint8_t out_buf[BLOCK_SIZE]; int in_len = 0; int total_written = 0; int written = 0; while(!feof(file_in)) { /* read a block of data */ in_len = fread(in_buf, sizeof(uint8_t), BLOCK_SIZE, file_in); z->avail_in = in_len; z->next_in = in_buf; z->avail_out = BLOCK_SIZE; z->next_out = out_buf; /* compress the block */ status = deflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d in compressing\n", status); return -1; } /* compute output len */ offset = BLOCK_SIZE - z->avail_out; /* write the output block to disk */ written = fwrite(out_buf, sizeof(uint8_t), offset, file_out); if(written < offset) { fprintf(stderr, "warning: %d bytes out of %d were written to disk\n", written, offset); } total_written += written; } return total_written; } /* decompression routines */ int gtg_decompress_init(z_stream *z) { int status; z->zalloc = NULL; z->zfree = NULL; z->opaque = NULL; z->avail_in = 0; z->next_in = Z_NULL; status = inflateInit(z); if (status != Z_OK) { fprintf(stderr, "error at init: %d\n", status); } return status; } int gtg_decompress_m2m(z_stream *z, void* in_buf, uint32_t len, void* out_buf, uint32_t out_max_len) { int status; z->next_in= in_buf; z->avail_in = len; z->next_out = out_buf; z->avail_out = out_max_len; /* decompress */ status = inflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d while decompressing\n", status); return -1; } return out_max_len - z->avail_out; } int gtg_decompress_m2f(z_stream *z, void* in_buf, uint32_t len, FILE* file_out) { int status; uint8_t out_buf[BLOCK_SIZE]; int offset_out = 0; int offset_in = 0; int total_written = 0; int written = 0; /* decompress one block at a time */ while(offset_in < len) { z->next_in= &((uint8_t*)in_buf)[offset_in]; z->avail_in = len - offset_in; z->next_out = out_buf; z->avail_out = BLOCK_SIZE; /* decompress */ status = inflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d while decompressing\n", status); return -1; } /* compute new offsets */ offset_out = BLOCK_SIZE - z->avail_out; offset_in = len - z->avail_in; written = fwrite(out_buf, 1, offset_out, file_out); if(written < offset_out){ fprintf(stderr, "warning: %d bytes out of %d written\n", written, offset_out); return -1; } total_written += written; } return total_written; } int gtg_decompress_f2m(z_stream *z, FILE* file_in, void* out_buf, uint32_t out_max_len) { int status; uint8_t in_buf[BLOCK_SIZE]; uint32_t in_len = 0; int offset_out = 0; while(! feof(file_in)) { in_len = fread(in_buf, sizeof(uint8_t), BLOCK_SIZE, file_in); z->avail_in = in_len; z->next_in = in_buf; z->avail_out = out_max_len - offset_out; z->next_out = &((uint8_t*)out_buf)[offset_out]; /* decompress */ status = inflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d while decompressing\n", status); return -1; } /* compute output len */ offset_out = out_max_len - z->avail_out; } return offset_out; } int gtg_decompress_f2f(z_stream *z, FILE* file_in, FILE* file_out) { int status; int offset = 0; /* offset in the dest buffer */ uint8_t in_buf[BLOCK_SIZE]; uint8_t out_buf[BLOCK_SIZE]; int in_len = 0; int total_written = 0; int written = 0; while(!feof(file_in)) { in_len = fread(in_buf, sizeof(uint8_t), BLOCK_SIZE, file_in); z->avail_in = in_len; z->next_in = in_buf; z->avail_out = BLOCK_SIZE; z->next_out = out_buf; /* decompress */ status = inflate( z, Z_SYNC_FLUSH ); if ( Z_OK != status ) { fprintf( stderr, "error %d in compressing\n", status); return -1; } /* compute output len */ offset = BLOCK_SIZE - z->avail_out; written = fwrite(out_buf, sizeof(uint8_t), offset, file_out); if(written < offset) { fprintf(stderr, "warning: %d bytes out of %d were written to disk\n", written, offset); } total_written += written; } return total_written; } gtg-trace-0.2-3/src/C/gtg_decompress.c000066400000000000000000000024211446421307700175210ustar00rootroot00000000000000 #define _GNU_SOURCE #include #include #include #include #include "GTGCompress.h" char* input_filename; char* output_filename; static void usage (int argc __attribute__((unused)), char **argv) { fprintf (stderr, "Usage : %s -i input_filename [-o output_filename] \n", argv[0]); } static void parse_args (int argc, char **argv) { int i; input_filename = NULL; for (i = 1; i < argc; i++) { if (strcmp (argv[i], "-o") == 0) { output_filename = argv[++i]; } else if (strcmp (argv[i], "-i") == 0) { if(input_filename) { usage (argc, argv); exit (-1); } input_filename = argv[++i]; } else { if(input_filename) { usage (argc, argv); exit (-1); } input_filename = argv[i]; } } } int main(int argc, char**argv) { parse_args(argc, argv); if(!input_filename) { fprintf(stderr, "please provide an input file\n"); exit(-1); } if(!output_filename) { asprintf(&output_filename, "%s.unzipped", input_filename); } printf("decompressing file %s into file %s\n", input_filename, output_filename); FILE *fin=fopen(input_filename, "r"); FILE *fout=fopen(output_filename, "w"); z_stream z; gtg_decompress_init(&z); gtg_decompress_f2f(&z, fin, fout); return 0; } gtg-trace-0.2-3/src/C/interfaceCFortranBasic1.c000066400000000000000000000313121446421307700211370ustar00rootroot00000000000000#include #include #include "GTG.h" void setTraceType_i (int *type) { setTraceType ((traceType_t) * type); } int getTraceType_i () { return getTraceType (); } int bufferedModeActivated_i() { return bufferedModeActivated_i(); } void initTrace_i (char *f, int *len, int *rank, gtg_flag_t* flags, int *err) { char *filename = (char *) malloc (sizeof (char) * (*len + 1)); memcpy (filename, f, *len); filename[*len] = '\0'; *err = initTrace (filename, *rank, *flags); } void addContType_i (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, contType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; *err = addContType (a, c, n); } void addStateType_i (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, contType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; *err = addStateType (a, c, n); } void addEventType_i (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, contType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; *err = addEventType (a, c, n); } void addLinkType_i (char *alias, int *s1, char *name, int *s3, char *contType, int *s2, char *src, int *s4, char *dest, int *s5, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *d = (char *) malloc (sizeof (char) * (*s5 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); char *s = (char *) malloc (sizeof (char) * (*s4 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, contType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; memcpy (s, src, *s4); s[*s4] = '\0'; memcpy (d, dest, *s5); d[*s5] = '\0'; *err = addLinkType (a, n, c, s, d); } void addVarType_i (char *alias, int *s1, char *name, int *s3, char *contType, int *s2, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, contType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; *err = addVarType (a, c, n); } void addEntityValue_i (char *alias, int *s1, char *entType, int *s2, char *name, int *s3, gtg_color_t color, int *s4, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *c = (char *) malloc (sizeof (char) * (*s2 + 1)); char *n = (char *) malloc (sizeof (char) * (*s3 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (c, entType, *s2); c[*s2] = '\0'; memcpy (n, name, *s3); n[*s3] = '\0'; *err = addEntityValue (a, c, n, color); } void addContainer_i (varPrec * time, char *alias, int *s1, char *type, int *s2, char *container, int *s3, char *name, int *s4, char *filename, int *s5, int *err) { char *a = (char *) malloc (sizeof (char) * (*s1 + 1)); char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s3 + 1)); char *n = (char *) malloc (sizeof (char) * (*s4 + 1)); char *f = (char *) malloc (sizeof (char) * (*s5 + 1)); memcpy (a, alias, *s1); a[*s1] = '\0'; memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, container, *s3); c[*s3] = '\0'; memcpy (n, name, *s4); n[*s4] = '\0'; memcpy (f, filename, *s5); f[*s5] = '\0'; *err = addContainer (*time, a, t, c, n, f); } void destroyContainer_i (varPrec * time, char *name, int *s1, char *type, int *s2, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *n = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (n, name, *s1); n[*s1] = '\0'; *err = destroyContainer (*time, n, t); } void setState_i (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *v = (char *) malloc (sizeof (char) * (*s3 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; memcpy (v, val, *s3); v[*s3] = '\0'; *err = setState (*time, t, c, v); } void pushState_i (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); char *v = (char *) malloc (sizeof (char) * (*s3 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; memcpy (v, val, *s3); v[*s3] = '\0'; *err = pushState (*time, t, c, v); } void popState_i (varPrec * time, char *type, int *s2, char *cont, int *s1, int *s3, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; *err = popState (*time, t, c); } void addEvent_i (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *v = (char *) malloc (sizeof (char) * (*s3 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; memcpy (v, val, *s3); v[*s3] = '\0'; *err = addEvent (*time, t, c, v); } void startLink_i (varPrec * time, char *type, int *s2, char *cont, int *s1, char *src, int *s3, char *dest, int *s4, char *val, int *s5, char *key, int *s6, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *k = (char *) malloc (sizeof (char) * (*s6 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); char *v = (char *) malloc (sizeof (char) * (*s5 + 1)); char *s = (char *) malloc (sizeof (char) * (*s3 + 1)); char *d = (char *) malloc (sizeof (char) * (*s4 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; memcpy (v, val, *s5); v[*s5] = '\0'; memcpy (s, src, *s3); s[*s3] = '\0'; memcpy (d, dest, *s4); d[*s4] = '\0'; memcpy (k, key, *s6); k[*s6] = '\0'; *err = startLink (*time, t, c, s, d, v, k); } void endLink_i (varPrec * time, char *type, int *s2, char *cont, int *s1, char *src, int *s3, char *dest, int *s4, char *val, int *s5, char *key, int *s6, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *k = (char *) malloc (sizeof (char) * (*s6 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); char *v = (char *) malloc (sizeof (char) * (*s5 + 1)); char *s = (char *) malloc (sizeof (char) * (*s3 + 1)); char *d = (char *) malloc (sizeof (char) * (*s4 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; memcpy (v, val, *s5); v[*s5] = '\0'; memcpy (s, src, *s3); s[*s3] = '\0'; memcpy (d, dest, *s4); d[*s4] = '\0'; memcpy (k, key, *s6); k[*s6] = '\0'; *err = endLink (*time, t, c, s, d, v, k); } void setVar_i (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; *err = setVar (*time, t, c, *val); } void addVar_i (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; *err = addVar (*time, t, c, *val); } void subVar_i (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); char *c = (char *) malloc (sizeof (char) * (*s1 + 1)); memcpy (t, type, *s2); t[*s2] = '\0'; memcpy (c, cont, *s1); c[*s1] = '\0'; *err = subVar (*time, t, c, *val); } void addComm_i (char *comm, int *s2, int *err) { char *t = (char *) malloc (sizeof (char) * (*s2 + 1)); memcpy (t, comm, *s2); t[*s2] = '\0'; *err = AddComment (t); } void endTrace_i (int *err) { *err = endTrace (); } /* manual aliasing of function, in order to avoid using GCC specific __attribute__ keyword */ void settracetype_i_ (int *type) { setTraceType_i (type); } int gettracetype_i_ () { return getTraceType_i (); } int bufferedmodeactivated_i_() { return bufferedModeActivated_i(); } void inittrace_i_ (char *f, int *len, int*rank, gtg_flag_t* flags, int *err) { initTrace_i (f, len, rank, flags, err); } void addconttype_i_ (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { addContType_i (alias, s1, contType, s2, name, s3, err); } void addstatetype_i_ (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { addStateType_i (alias, s1, contType, s2, name, s3, err); } void addeventtype_i_ (char *alias, int *s1, char *contType, int *s2, char *name, int *s3, int *err) { addEventType_i (alias, s1, contType, s2, name, s3, err); } void addlinktype_i_ (char *alias, int *s1, char *name, int *s3, char *contType, int *s2, char *src, int *s4, char *dest, int *s5, int *err) { addLinkType_i (alias, s1, name, s3, contType, s2, src, s4, dest, s5, err); } void addvartype_i_ (char *alias, int *s1, char *name, int *s3, char *contType, int *s2, int *err) { addVarType_i (alias, s1, name, s3, contType, s2, err); } void addentityvalue_i_ (char *alias, int *s1, char *entType, int *s2, char *name, int *s3, gtg_color_t color, int *s4, int *err) { addEntityValue_i (alias, s1, entType, s2, name, s3, color, s4, err); } void addcontainer_i_ (varPrec * time, char *alias, int *s1, char *type, int *s2, char *container, int *s3, char *name, int *s4, char *filename, int *s5, int *err) { addContainer_i (time, alias, s1, type, s2, container, s3, name, s4, filename, s5, err); } void destroycontainer_i_ (varPrec * time, char *name, int *s1, char *type, int *s2, int *err) { destroyContainer_i (time, name, s1, type, s2, err); } void setstate_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { setState_i (time, type, s2, cont, s1, val, s3, err); } void pushstate_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { pushState_i (time, type, s2, cont, s1, val, s3, err); } void popstate_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, int *s3, int *err) { popState_i (time, type, s2, cont, s1, s3, err); } void addevent_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, char *val, int *s3, int *err) { addEvent_i (time, type, s2, cont, s1, val, s3, err); } void startlink_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, char *src, int *s3, char *dest, int *s4, char *val, int *s5, char *key, int *s6, int *err) { startLink_i (time, type, s2, cont, s1, src, s3, dest, s4, val, s5, key, s6, err); } void endlink_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, char *src, int *s3, char *dest, int *s4, char *val, int *s5, char *key, int *s6, int *err) { endLink_i (time, type, s2, cont, s1, src, s3, dest, s4, val, s5, key, s6, err); } void setvar_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { setVar_i (time, type, s2, cont, s1, val, err); } void addvar_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { addVar_i (time, type, s2, cont, s1, val, err); } void subvar_i_ (varPrec * time, char *type, int *s2, char *cont, int *s1, varPrec * val, int *err) { subVar_i (time, type, s2, cont, s1, val, err); } void addcomm_i_ (char *comm, int *s2, int *err) { addComm_i (comm, s2, err); } void endtrace_i_ (int *err) { endTrace_i (err); } gtg-trace-0.2-3/src/C/paje_GTGBasic1_c.c000066400000000000000000000624471446421307700174770ustar00rootroot00000000000000#ifdef BUILD_PAJE #define _GNU_SOURCE #include #include #include #include #include #include #include #include #include #include #include #ifdef USE_MPI #include #endif #include "GTG.h" #include "GTGPaje_Basic.h" #include "GTGPaje.h" #if HAVE_LIBZ #include "GTGCompress.h" #endif extern int _is_paje_header_written; void pajeInitHeaderData( int fmt, gtg_flag_t paje_flags); void pajeWriteHeader( FILE *file ); /* set in GTGBasic1_c.c * verbose !=0 means debugging mode */ extern int verbose; /* Max length of the names built */ #define BUFFSIZE 1024 /* File where each proc writes the header and the definitions of the data. */ static FILE* headFile=NULL; /* name of the root file*/ static char headFilename[BUFFSIZE]; /* base name */ static char* filename; /* mpi rank */ static int rank; /* Name built for getName */ static char* nameTmp; /* Flags that should be used. */ static gtg_flag_t paje_flags; /* in non-buffered mode, flush a file */ #define FLUSH(file) \ if(paje_flags & GTG_FLAG_NOTBUF) \ fflush(file) #define PRINT_PAJE_HEADER() \ if ( !_is_paje_header_written ) { \ pajeWriteHeader( headFile ); \ FLUSH( headFile ); \ } /* Structure containing the info of a current line */ typedef struct line_t{ FILE* file; /* File */ char* value; /* The value of the line */ size_t size; /* Size of the value buffer */ varPrec time; /* Time (second element of the line) */ int status; /* If EOF reached */ }line_t; typedef struct doubleLinkList_t{ struct doubleLinkList_t* prev; /* Previous element */ struct doubleLinkList_t* next; /* Next element */ line_t current; /* Current line */ }doubleLinkList_t; struct container_file{ char container_name[1024]; char file_name[1024]; FILE* file; int closed; struct container_file *next; }; /* File where each proc writes state/event/var/link changes. */ static struct container_file *procFile=NULL; /* TODO: don't hardcode the size */ static int nb_containers = 0; static int nb_allocated_containers = 0; /* returns 1 if str is null (or contains "0" or "(null)") */ static int null_string(const char*str) { return (! str || strcmp(str, "0") == 0 || strcmp(str, "") == 0 || strcmp(str, "(null)") == 0); } #define GET_FILE_DESCRIPTOR(f, cont) \ do { \ struct container_file* p_cont = __paje_find_container(cont); \ if(! p_cont) { \ p_cont = __paje_create_container_file(cont); \ } \ f = p_cont->file; \ } while(0) /* find the container_file structure that corresponds to cont */ static struct container_file* __paje_find_container(const char* cont) { int i; cont = cont? cont : ""; for(i=0; i= nb_allocated_containers) { nb_allocated_containers *= 2 ; nb_allocated_containers=(nb_allocated_containers?nb_allocated_containers:100); procFile = realloc(procFile, sizeof(struct container_file)*nb_allocated_containers); assert(procFile); } assert(nb_containersclosed = 0; strcpy(res->container_name, cont?cont:""); if(paje_flags & GTG_FLAG_PAJE_MULTIPLE_FILES) { /* each container write to a separate file */ sprintf (res->file_name, "%s_%s.trace", filename, res->container_name); res->file = fopen (res->file_name, "w"); if(!res->file) abort(); } else { /* all the containers write to the same file */ sprintf (res->file_name, "%s.trace", headFilename); res->file = headFile; } return res; } static void __paje_destroy_container(struct container_file* p_cont) { if(p_cont->closed > 0) /* this container is already destroyed */ return; FLUSH(p_cont->file); fclose (p_cont->file); p_cont->closed = 1; } #if HAVE_LIBZ static z_stream z; static int compression_ratio = 0; /* compress data and write to disk */ void paje_print(FILE* file, const char*format, ...) { int len = 0; int ret = 0; va_list args; char* tmp_buf = NULL; va_start(args, format); if(compression_ratio) { len = vasprintf(&tmp_buf, format, args); va_end(args); ret = gtg_compress_m2f(&z, tmp_buf, len, file); if (ret < 0) { fprintf(stderr, "gtg: an error occured while compressing\n"); } } else { /* don't compress, write directly to disk */ vfprintf(file, format, args); va_end(args); } } trace_return_t pajeSetCompress(int val) { compression_ratio = val; if(val) gtg_compress_init(&z, compression_ratio); return TRACE_SUCCESS; } #else /* HAVE_LIBZ */ #define paje_print fprintf trace_return_t pajeSetCompress(int val) { return TRACE_ERR_WRITE; } #endif #ifndef HAVE_GETLINE ssize_t getline(char** buf, size_t* size, FILE* stream) { char *ret; int alloc_size = 1024; int nb_char = 0; if(!(*buf)) { /* we need to allocate the buffer */ alloc_size = 1024; *buf = malloc(sizeof(char) * alloc_size); } else { alloc_size = *size; } *buf[0]=0; do { if(nb_char + 512 >= alloc_size) { /* the next fgets may overflow the buffer, so let's allocate more space */ alloc_size *= 2; *buf = realloc(*buf, alloc_size); *size = alloc_size; } /* read at most 512 bytes */ ret = fgets((*buf)+nb_char, 512, stream); if(!ret){ /* error while reading or EOF */ *size = 1; (*buf)[0] = EOF; return -1; } nb_char = strlen(*buf); } while((*buf)[nb_char -1] !='\n'); return nb_char; } #endif /* HAVE_GETLINE */ void myGetLine (doubleLinkList_t* li){ int toto; int ret; if (li->current.value) free (li->current.value); li->current.value = NULL; ret = getline (&(li->current.value), &(li->current.size), li->current.file); if (li->current.size==0 || ret ==-1){ li->current.status=0; } if ((li->current.size)>0) sscanf (li->current.value, "%d %lf", &toto, &(li->current.time)); else fprintf (stderr, "failed to read\n"); } paje_color_t Paje_get_color(gtg_color_t p_color) { /** \todo it is not const*/ int ret; paje_color_t res = NULL; ret = asprintf(&res, "%1.1f %1.1f %1.1f", (float)GTG_COLOR_GET_RED( p_color->rgb)/256, (float)GTG_COLOR_GET_GREEN(p_color->rgb)/256, (float)GTG_COLOR_GET_BLUE( p_color->rgb)/256); (void)ret; return res; } char* pajeGetName (int procNb){ if (nameTmp) free (nameTmp); nameTmp = (char *)malloc (sizeof (char)*BUFFSIZE); if (filename){ sprintf (nameTmp, "%s_proc%d.ept", filename, procNb); if(verbose) fprintf (stderr, "Name built : %s \n", nameTmp); return nameTmp; } return "0"; } trace_return_t my_open (int rk){ trace_return_t ret = TRACE_ERR_OPEN; if (!headFile){ sprintf (headFilename, "%s_proc%d.ept", filename, rk); headFile = fopen (headFilename, "w"); } if (!headFile) return ret; ret = TRACE_SUCCESS; return ret; } trace_return_t my_close (){ trace_return_t ret = TRACE_ERR_CLOSE; if (headFile){ ret = (trace_return_t) fclose (headFile); headFile = NULL; } return ret; } trace_return_t pajeInitTrace (const char* filenam, int rk, gtg_flag_t flags, int fmt) { trace_return_t ret = TRACE_ERR_OPEN; my_close (); rank = rk; /* fixme: why there is need to copy filenam ????*/ filename = (char *)malloc (sizeof (char)* (strlen (filenam)+1)); strcpy (filename, filenam); headFile = NULL; paje_flags = flags; if( rank==0 || (! (flags & GTG_FLAG_USE_MPI) && !(flags & GTG_FLAG_PAJE_MULTIPLE_FILES))) { sprintf (headFilename, "%s_root.ept", filename); headFile = fopen (headFilename, "w"); if (!headFile){ fprintf (stderr, "Failed to open file %s. \n Leaving\n", headFilename); return ret; } pajeInitHeaderData( fmt, flags); FLUSH(headFile); } else { /* another process writes the header, so we don't have to */ _is_paje_header_written = 1; } return my_open(rank); } trace_return_t pajeAddContType(const char* alias, const char* contType, const char* name) { PRINT_PAJE_HEADER(); if(verbose) printf("addCtType : name %s, alias %s, contType %s\n", name, alias, contType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineContainerType].id, name, contType ? contType : "0", alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddStateType (const char* alias, const char* contType, const char* name){ PRINT_PAJE_HEADER(); if(verbose) printf("addStateType : alias %s, name %s, contType %s\n", alias, name, contType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineStateType].id, name, contType, alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddEventType (const char* alias, const char* contType, const char* name){ PRINT_PAJE_HEADER(); if(verbose) printf("addEventType : alias %s, name %s, contType %s\n", alias, name, contType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineEventType].id, name, contType, alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddVarType (const char* alias , const char* contType, const char* name){ PRINT_PAJE_HEADER(); if(verbose) printf("addVarType : alias %s, name %s, contType %s\n", alias, name, contType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"0 0 0\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineVariableType].id, name, contType, alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddLinkType (const char* alias , const char* name, const char* contType, const char* srcContType, const char* destContType){ PRINT_PAJE_HEADER(); if (verbose) printf ("Add link type: alias: %s name: %s contType: %s src: %s des: %s\n", alias, name, contType, srcContType, destContType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineLinkType].id, name, contType, srcContType, destContType, alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddEntityValue (const char* alias, const char* entType, const char* name , const char* color){ PRINT_PAJE_HEADER(); if(verbose) printf("addEntityValue : color %s, alias %s, name %s, type %s\n", color, alias, name, entType); if (headFile){ fprintf (headFile, "%d \"%s\" \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DefineEntityValue].id, entType, name, color, alias); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddContainer_generic(varPrec time, const char* alias, const char* type, const char* container, const char* name, const char* file){ PRINT_PAJE_HEADER(); if (headFile){ fprintf (headFile, "%d %.13e \"%s\" \"%s\"", paje_eventdefs[GTG_PAJE_EVTDEF_CreateContainer].id, time, name, type); if(container && strcmp(container, "(null)")!=0 ) { fprintf(headFile, " \"%s\"", container); }else{ fprintf(headFile, " 0"); } fprintf(headFile, " \"%s\"", alias); if(! null_string(file)) { fprintf(headFile, " \"%s\"", file); } fprintf(headFile,"\n"); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddContainer(varPrec time, const char* alias, const char* type, const char* container, const char* name, const char* file){ PRINT_PAJE_HEADER(); if (headFile){ if(null_string(file)) { struct container_file* p_cont = __paje_create_container_file(alias); if(paje_flags & GTG_FLAG_PAJE_MULTIPLE_FILES) { return pajeAddContainer_generic(time, alias, type, container, name, p_cont->file_name); } } return pajeAddContainer_generic(time, alias, type, container, name, file); } return TRACE_ERR_WRITE; } trace_return_t pajeSeqAddContainer (varPrec time, const char* alias , const char* type, const char* container, const char* name){ PRINT_PAJE_HEADER(); if (headFile){ struct container_file* p_cont = __paje_create_container_file(alias); if(paje_flags & GTG_FLAG_PAJE_MULTIPLE_FILES) { return pajeAddContainer_generic(time, alias, type, container, name, p_cont->file_name); } else { return pajeAddContainer_generic(time, alias, type, container, name, NULL); } } return TRACE_ERR_WRITE; } trace_return_t pajeDestroyContainer (varPrec time, const char* name, const char* type){ PRINT_PAJE_HEADER(); if (headFile){ struct container_file* p_cont = __paje_find_container(name); fprintf (p_cont->file, "%d %.13e \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_DestroyContainer].id, time, name, type); FLUSH(p_cont->file); __paje_destroy_container(p_cont); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeSetState (varPrec time, const char* type, const char* cont, const char* val){ FILE *f=NULL; if(verbose) printf("SetState : type %s, container %s, val %s\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_SetState].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } printf("f==NULL (cont=%s)\n", cont); return TRACE_ERR_WRITE; } trace_return_t pajePushState (varPrec time, const char* type, const char* cont, const char* val){ FILE *f=NULL; if(verbose) printf("PushState : type %s, container %s, val %s\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_PushState].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajePopState (varPrec time, const char* type, const char* cont){ FILE *f=NULL; if(verbose) printf("PopState : type %s, container %s\n", type, cont); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_PopState].id, time, type, cont); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddEvent (varPrec time, const char* type, const char* cont, const char* val){ FILE *f=NULL; if(verbose) printf("AddEvent : type %s, cont %s, val %s\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_NewEvent].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeStartLink (varPrec time, const char* type, const char* cont, const char* src, const char* val , const char* key){ FILE *f=NULL; if (verbose) printf ("Start link: type: %s container: %s src: %s val: %s key %s\n", type, cont, src, val, key); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_StartLink].id, time, type, cont, src, val, key); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeEndLink (varPrec time, const char* type, const char* cont, const char* dest, const char* val , const char* key){ FILE *f=NULL; if (verbose) printf ("End link type: %s container: %s src: %s val: %s key %s\n", type, cont, dest, val, key); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", paje_eventdefs[GTG_PAJE_EVTDEF_EndLink].id, time, type, cont, dest, val, key); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeSetVar (varPrec time, const char* type, const char* cont, varPrec val){ FILE *f=NULL; if (verbose) printf ("SetVar: type: %s container: %s value: %e\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" %e\n", paje_eventdefs[GTG_PAJE_EVTDEF_SetVariable].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddVar (varPrec time, const char* type, const char* cont, varPrec val){ FILE *f=NULL; if (verbose) printf ("AddVar: type: %s container: %s value: %e\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" %e\n", paje_eventdefs[GTG_PAJE_EVTDEF_AddVariable].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeSubVar (varPrec time, const char* type, const char* cont, varPrec val){ FILE *f=NULL; if (verbose) printf ("SubVar: type: %s container: %s value: %e\n", type, cont, val); GET_FILE_DESCRIPTOR(f, cont); if (f){ fprintf (f, "%d %.13e \"%s\" \"%s\" %e\n", paje_eventdefs[GTG_PAJE_EVTDEF_SubVariable].id, time, type, cont, val); FLUSH(f); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } trace_return_t pajeAddComment (const char* comment){ if (verbose) printf ("AddComment: %s\n",comment); if (headFile){ fprintf(headFile,"#%s\r\n",comment); FLUSH(headFile); return TRACE_SUCCESS; } return TRACE_ERR_WRITE; } int acquire_lock(const char* lockfile) { int lock_fd, rc; lock_fd = open(lockfile, O_RDWR | O_CREAT, 0666); if(lock_fd < 0) { printf("open(%s) returned %d (%s)\n", lockfile, errno, strerror(errno)); abort(); } rc = flock(lock_fd, LOCK_EX); if(rc != 0) { printf("flock returned %d\n", rc); abort(); } return lock_fd; } void release_lock(const char* lockfile, int lock_fd){ int rc = flock(lock_fd, LOCK_UN); if(rc !=0){ printf("unlock returned %d\n", rc); abort(); } /* todo: delete the lock file */ } #define MAX_LINE_SIZE 1024 struct paje_line_t{ char *line; int len; /* length of the line */ size_t size; /* allocated size of line */ int code; double timestamp; int eof; }; static void __init_paje_line(struct paje_line_t*l) { l->size=MAX_LINE_SIZE; l->line=malloc(sizeof(char)*l->size); l->len=0; l->code=-1; l->timestamp=-1; l->eof=0; } void read_line(FILE*f, struct paje_line_t *l) { int rc; l->len = getline(&l->line, &l->size, f); if(l->len<0) { if(!feof(f)) { printf("getline failed!\n"); abort(); } l->eof=1; return; } /* getline managed to read something */ rc = sscanf(l->line, "%d %lf", &l->code, &l->timestamp); if(rc != 2) { /* this is probably because the line starts with % */ l->code=-1; l->timestamp=-1; } } void write_line(FILE*f, struct paje_line_t*l) { fprintf(f, "%s", l->line); } /* check if input1 (resp. input2) is empty and if so, rename input2 (resp. * input1) into output) * return 0 if none of the files were renamed */ static int __try_to_rename(const char *input1, const char *input2, const char *output) { /* check if input1 exists */ struct stat st; int rc = stat(input1, &st); if(rc <0 && errno == ENOENT) { /* input1 does not exist. we can simply rename input2 to output */ rc = rename(input2, output); assert(rc == 0); return 1; } /* check if input2 exists */ rc = stat(input2, &st); if(rc <0 && errno == ENOENT) { /* input2 does not exist. we can simply rename input1 to output */ rc = rename(input1, output); assert(rc == 0); return 1; } /* both files exist */ return 0; } /* merge input1 and input2 into output */ static void __merge_files(const char *input1, const char *input2, const char *output) { FILE* input1_file; FILE* input2_file; FILE* output_file; struct paje_line_t line_input, line_merge; if(__try_to_rename(input1, input2, output)) { goto out; } /* both input1 and input2 exist */ /* open the merge file */ input1_file = fopen(input1, "r"); assert(input1_file); /* open the input file */ input2_file = fopen(input2, "r"); assert(input2_file); /* open the output file */ output_file = fopen(output, "w"); assert(output_file); /* merge input2_file and input1_file */ __init_paje_line(&line_input); __init_paje_line(&line_merge); read_line(input2_file, &line_input); read_line(input1_file, &line_merge); /* merge input and merge files */ while(!line_input.eof && ! line_merge.eof) { if(line_input.timestamp.trace */ static void merge_contrib(const char *base_filename) { int lock_fd; int rc; char merged_filename[BUFFSIZE]; /* the other file to merge */ char output_filename[BUFFSIZE]; /* the resulting file */ char lockfile[BUFFSIZE]; /* .trace will contain the merge of .ept and .trace.merged */ /* todo: check if compression still works */ #if HAVE_LIBZ if(compression_ratio) sprintf (output_filename, "%s.trace.z", base_filename); else #endif sprintf (output_filename, "%s.trace", base_filename); sprintf (merged_filename, "%s.trace.merged", base_filename); sprintf (lockfile, "%s.trace.lock", base_filename); /* make sure we have exclusive access to files */ lock_fd = acquire_lock(lockfile); assert(lock_fd>=0); { /* Currently, .trace contains the merge of the other *.ept files, * let's rename it to .trace.merge */ rc = rename(output_filename, merged_filename); if(rc != 0 && errno != ENOENT) { /* rename failed */ fprintf(stderr, "gtg: failed to rename %s into %s\n", output_filename, merged_filename); abort(); } __merge_files(merged_filename, headFilename, output_filename); } release_lock(lockfile, lock_fd); } static trace_return_t __pajeEndTrace_generic (int should_merge) { int i; my_close (); /* Wait for all proc to finish writing their trace */ if(paje_flags & GTG_FLAG_PAJE_MULTIPLE_FILES) { for(i=0;i #include #include #ifdef USE_MPI #include #endif #include "GTG.h" #include "GTGPaje.h" int _is_paje_header_written = 0; gtg_paje_eventdef_t paje_eventdefs[GTG_PAJE_EVTDEF_NBR] = { { "PajeDefineContainerType", 0, NULL, NULL}, { "PajeDefineStateType", 1, NULL, NULL}, { "PajeDefineEventType", 2, NULL, NULL}, { "PajeDefineVariableType", 3, NULL, NULL}, { "PajeDefineLinkType", 4, NULL, NULL}, { "PajeDefineEntityValue", 5, NULL, NULL}, { "PajeCreateContainer", 7, NULL, NULL}, { "PajeDestroyContainer", 8, NULL, NULL}, { "PajeSetState", 10, NULL, NULL}, { "PajePushState", 11, NULL, NULL}, { "PajePopState", 12, NULL, NULL}, { "PajeResetState", 13, NULL, NULL}, { "PajeNewEvent", 20, NULL, NULL}, { "PajeSetVariable", 30, NULL, NULL}, { "PajeAddVariable", 31, NULL, NULL}, { "PajeSubVariable", 32, NULL, NULL}, { "PajeStartLink", 40, NULL, NULL}, { "PajeEndLink", 41, NULL, NULL}, }; char *FieldType[GTG_PAJE_FIELDTYPE_NBR] = { "int", "hex", "date", "double", "string", "color" }; #define printExtra( file, event ) \ if ( (paje_eventdefs[event].first) != NULL ) { \ gtg_paje_edp_t *e, *n; \ for( e = paje_eventdefs[event].first; e != NULL; ) { \ n = e->next; \ fprintf(file, "%% %s %s\n", e->name, FieldType[e->type]); \ e = n; \ } \ } /* * args needs to be set to 0 before the first call */ void pajeEventDefAddParam( enum gtg_paje_evtdef_e event, const char *name, enum gtg_paje_fieldtype_e type ) { gtg_paje_edp_t *node = (gtg_paje_edp_t*)malloc(sizeof(gtg_paje_edp_t)); if (_is_paje_header_written) { fprintf(stderr, "GTG [PAJE/VITE]: You cannot add parameters to definitions after the header has been written to the file\n"); return; } node->next = NULL; node->name = strdup(name); node->type = type; if( paje_eventdefs[event].first == NULL ) { paje_eventdefs[event].first = node; paje_eventdefs[event].last = node; } else { paje_eventdefs[event].last->next = node; paje_eventdefs[event].last = node; } } void pajeEventDefDeleteParams( enum gtg_paje_evtdef_e event ) { gtg_paje_edp_t *e, *n; for( e = paje_eventdefs[event].first; e != NULL; ) { n = e->next; free(e->name); free(e); e = n; } paje_eventdefs[event].first = NULL; paje_eventdefs[event].last = NULL; } void pajeEventDefClean() { int i; for(i=0; i #include #include #include /* 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 #include #include #include /* 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. \n 1 for paje, 2 for otf. \n"); exit (-1); } switch (atoi (argv[1])){ case 1 : traceT = PAJE; break; case 2 : traceT = OTF; break; default : traceT = PAJE; break; } gtg_flag_t flags = GTG_FLAG_NONE; if(getenv("GTG_FLAG_PAJE_MULTIPLE_FILES")) { flags |= GTG_FLAG_PAJE_MULTIPLE_FILES; } /* Initialisation */ setTraceType (traceT); CHECK_RETURN (initTrace ("testEvent", 0, flags)); /* 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)); /* Adding event types */ 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++){ clear (name, TXTSIZE); clear (proc, TXTSIZE); 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)); clear (name, TXTSIZE); clear (proc, TXTSIZE); if (i%5){ sprintf (name, "E_%d", i%2); sprintf (proc, "C_P%d", i%6); sprintf (key , "%d", i%13); CHECK_RETURN (addEvent (time+0.5, name, proc, key)); /* Adding events */ } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testEvent_mpi.c000066400000000000000000000116241446421307700173550ustar00rootroot00000000000000/* * Small test of the events generation using MPI (for VITE,Paje and OTF formats) * Author Kevin Coulomb */ #include #include #include #include #include /* 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. \n 1 for vite, 2 for otf, 3 for paje. \n"); exit (-1); } MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &size); if (size != 6){ fprintf (stderr, "Error you need to run this test on 6 procs. Leaving \n"); return; } MPI_Comm_rank (MPI_COMM_WORLD, &rank); switch (atoi (argv[1])){ case 1 : traceT = VITE; break; case 2 : traceT = OTF; break; case 3 : traceT = PAJE; break; default : traceT = VITE; break; } /* Initialisation */ setTraceType (traceT); fprintf (stderr, "Rank : %d \n", rank); CHECK_RETURN (initTrace ("testEvent_mpi", rank, GTG_FLAG_USE_MPI|GTG_FLAG_NOTBUF)); if (rank==0){ /* 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)); /* Adding event types */ 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", "")); CHECK_RETURN (addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "")); CHECK_RETURN (addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", getName (0))); CHECK_RETURN (addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", getName (1))); CHECK_RETURN (addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", getName (2))); CHECK_RETURN (addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "")); CHECK_RETURN (addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", getName (3))); CHECK_RETURN (addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", getName (4))); CHECK_RETURN (addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", getName (5))); } MPI_Barrier (MPI_COMM_WORLD); clear (txt, TXTSIZE); time = 1.00000000; for (i=0; i<200; i++){ clear (name, TXTSIZE); clear (proc, TXTSIZE); 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); } if (i%6==rank) CHECK_RETURN (setState (time, txt, proc, name)); clear (name, TXTSIZE); clear (proc, TXTSIZE); if (i%6==rank){ sprintf (name, "E_%d", i%2); sprintf (proc, "C_P%d", i%6); sprintf (key , "%d", i%13); CHECK_RETURN (addEvent (time+0.125, name, proc, key)); /* Adding events */ } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); MPI_Finalize (); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testEvent_parall.c000077500000000000000000000120101446421307700200340ustar00rootroot00000000000000/* * Small test of the events generation in parallel (for VITE,Paje and OTF formats) * Author Kevin Coulomb, Francois Trahay */ #include #include #include #include #include /* 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. \n 1 for vite, 2 for otf, 3 for paje. \n"); exit (-1); } MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &size); if (size != 6){ fprintf (stderr, "Error you need to run this test on 6 procs. Leaving \n"); return; } MPI_Comm_rank (MPI_COMM_WORLD, &rank); switch (atoi (argv[1])){ case 1 : traceT = VITE; break; case 2 : traceT = OTF; break; case 3 : traceT = PAJE; break; default : traceT = VITE; break; } /* Initialisation */ setTraceType (traceT); fprintf (stderr, "Rank : %d \n", rank); CHECK_RETURN (initTrace ("testEvent_parallel", rank, GTG_FLAG_PAJE_MULTIPLE_FILES|GTG_FLAG_NOTBUF)); if (rank==0){ /* 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)); /* Adding event types */ 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", "")); CHECK_RETURN (addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "")); CHECK_RETURN (addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "")); } switch(rank){ case 0: CHECK_RETURN (addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", NULL)); break; case 1: CHECK_RETURN (addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", NULL)); break; case 2: CHECK_RETURN (addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", NULL)); break; case 3: CHECK_RETURN (addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", NULL)); break; case 4: CHECK_RETURN (addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", NULL)); break; case 5: CHECK_RETURN (addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", NULL)); break; } MPI_Barrier (MPI_COMM_WORLD); clear (txt, TXTSIZE); time = 1.00000000; for (i=0; i<200; i++){ clear (name, TXTSIZE); clear (proc, TXTSIZE); 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); } if (i%6==rank) CHECK_RETURN (setState (time, txt, proc, name)); clear (name, TXTSIZE); clear (proc, TXTSIZE); if (i%6==rank){ sprintf (name, "E_%d", i%2); sprintf (proc, "C_P%d", i%6); sprintf (key , "%d", i%13); CHECK_RETURN (addEvent (time+0.125, name, proc, key)); /* Adding events */ } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); MPI_Finalize (); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testLink.c000077500000000000000000000110151446421307700163210ustar00rootroot00000000000000/* * Small test of the link trace generation * Author Kevin Coulomb */ #include #include #include #include /* 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. \n 1 for paje, 2 for otf. \n"); exit (-1); } switch (atoi (argv[1])){ case 1 : traceT = PAJE; break; case 2 : traceT = OTF; break; default : traceT = PAJE; break; } /* Initialisation */ setTraceType (traceT); CHECK_RETURN (initTrace ("testLink", 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)); /* Creating comm types */ CHECK_RETURN (addLinkType ("L_0", "Fanin", "CT_NET", "CT_PROC", "CT_PROC")); CHECK_RETURN (addLinkType ("L_1", "Bloc", "CT_NET", "CT_PROC", "CT_PROC")); /* 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++){ clear (txt , TXTSIZE); clear (proc, TXTSIZE); clear (name, TXTSIZE); 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)); clear (txt , TXTSIZE); clear (proc, TXTSIZE); clear (name, TXTSIZE); if (i%4){ 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 */ CHECK_RETURN (startLink (time, name, txt, src, dest, proc, key)); CHECK_RETURN (endLink (time+2, name, txt, src, dest, proc, key)); } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testState.c000077500000000000000000000072271446421307700165160ustar00rootroot00000000000000/* * Small test of the state generation * Author Kevin Coulomb */ #include #include #include #include /* 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. \n 1 for paje, 2 for otf. \n"); exit (-1); } switch (atoi (argv[1])){ case 1 : traceT = PAJE; break; case 2 : traceT = OTF; break; default : traceT = PAJE; break; } /* Initialisation */ setTraceType (traceT); CHECK_RETURN (initTrace ("testState", 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)); /* 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)); time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testState_parall.c000077500000000000000000000106171446421307700200460ustar00rootroot00000000000000/* * Small test of the state generation in parallel (for ViTE, Paje and OTF format) * Author Kevin Coulomb */ #include #include #include #include #include /* 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. \n 1 for vite, 2 for otf 3 for paje. \n"); exit (-1); } MPI_Init (&argc, &argv); MPI_Comm_size (MPI_COMM_WORLD, &size); if (size != 6){ fprintf (stderr, "Error you need to run this test on 6 procs. Leaving \n"); return; } MPI_Comm_rank (MPI_COMM_WORLD, &rank); switch (atoi (argv[1])){ case 1 : traceT = VITE; break; case 2 : traceT = OTF; break; case 3 : traceT = PAJE; break; default : traceT = VITE; break; } /* Initialisation */ setTraceType (traceT); // fprintf (stderr, "Mon rang est %d \n", rank); CHECK_RETURN (initTrace ("testState_parall", rank, GTG_FLAG_USE_MPI|GTG_FLAG_NOTBUF)); if (rank==0){ /* 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)); /* Building containers tree */ CHECK_RETURN (addContainer (0.00000, "C_Net0", "CT_NET", "0", "Ensemble0", "")); CHECK_RETURN (addContainer (0.00000, "C_N0", "CT_NODE", "C_Net0", "Node0", "")); CHECK_RETURN (addContainer (0.00000, "C_P0", "CT_PROC", "C_N0", "Proc0", getName (0))); CHECK_RETURN (addContainer (0.00000, "C_P1", "CT_PROC", "C_N0", "Proc1", getName (1))); CHECK_RETURN (addContainer (0.00000, "C_P2", "CT_PROC", "C_N0", "Proc2", getName (2))); CHECK_RETURN (addContainer (0.00000, "C_N1", "CT_NODE", "C_Net0", "Node1", "")); CHECK_RETURN (addContainer (0.00000, "C_P3", "CT_PROC", "C_N1", "Proc3", getName (3))); CHECK_RETURN (addContainer (0.00000, "C_P4", "CT_PROC", "C_N1", "Proc4", getName (4))); CHECK_RETURN (addContainer (0.00000, "C_P5", "CT_PROC", "C_N1", "Proc5", getName (5))); } MPI_Barrier (MPI_COMM_WORLD); 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); } if (i%6==rank){ CHECK_RETURN (setState (time, txt, proc, name)); } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); MPI_Finalize (); return EXIT_SUCCESS; } gtg-trace-0.2-3/test/testVar.c000077500000000000000000000104241446421307700161570ustar00rootroot00000000000000/* * Small test of the variable generation * Author Kevin Coulomb */ #include #include #include #include /* 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. \n 1 for paje, 2 for otf. \n"); exit (-1); } switch (atoi (argv[1])){ case 1 : traceT = PAJE; break; case 2 : traceT = OTF; break; default : traceT = PAJE; break; } /* Initialisation */ setTraceType (traceT); CHECK_RETURN (initTrace ("testVar", 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 (addVarType ("V_Mem", "Memoire", "CT_NODE")); /* 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++){ clear (txt, TXTSIZE); 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)); clear (txt, TXTSIZE); if (i%3==1){ sprintf (txt, "C_N%d", i%2); CHECK_RETURN (setVar (time, "V_Mem", txt, i%5)); /* Setting the variables */ } else if (i%3==2){ sprintf (txt, "C_N%d", i%2); CHECK_RETURN (addVar (time, "V_Mem", txt, 1)); /* Incremmenting the variables */ } else{ sprintf (txt, "C_N%d", i%2); CHECK_RETURN (subVar (time, "V_Mem", txt, 1)); /* Decrementing the variables */ } time += 0.25; } /* Ending the trace */ CHECK_RETURN (endTrace ()); return EXIT_SUCCESS; }