~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to pvm3/src/tevmac.h

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* $Id: tevmac.h,v 1.6 1997/12/23 20:24:43 pvmsrc Exp $ */
 
3
 
 
4
/*
 
5
 *         PVM version 3.4:  Parallel Virtual Machine System
 
6
 *               University of Tennessee, Knoxville TN.
 
7
 *           Oak Ridge National Laboratory, Oak Ridge TN.
 
8
 *                   Emory University, Atlanta GA.
 
9
 *      Authors:  J. J. Dongarra, G. E. Fagg, M. Fischer
 
10
 *          G. A. Geist, J. A. Kohl, R. J. Manchek, P. Mucci,
 
11
 *         P. M. Papadopoulos, S. L. Scott, and V. S. Sunderam
 
12
 *                   (C) 1997 All Rights Reserved
 
13
 *
 
14
 *                              NOTICE
 
15
 *
 
16
 * Permission to use, copy, modify, and distribute this software and
 
17
 * its documentation for any purpose and without fee is hereby granted
 
18
 * provided that the above copyright notice appear in all copies and
 
19
 * that both the copyright notice and this permission notice appear in
 
20
 * supporting documentation.
 
21
 *
 
22
 * Neither the Institutions (Emory University, Oak Ridge National
 
23
 * Laboratory, and University of Tennessee) nor the Authors make any
 
24
 * representations about the suitability of this software for any
 
25
 * purpose.  This software is provided ``as is'' without express or
 
26
 * implied warranty.
 
27
 *
 
28
 * PVM version 3 was funded in part by the U.S. Department of Energy,
 
29
 * the National Science Foundation and the State of Tennessee.
 
30
 */
 
31
 
 
32
/*
 
33
 *      tevmac.h
 
34
 *
 
35
 *      Tracing defs.
 
36
 *
 
37
$Log: tevmac.h,v $
 
38
 * Revision 1.6  1997/12/23  20:24:43  pvmsrc
 
39
 * Added new TEV_PUSHTOP, TEV_AMPUSHED and TEV_POPTOP macros.
 
40
 *      - to fake top level tracing, i.e. "push" the current tracing
 
41
 *              depth and turn on full tracing again (until next "pop").
 
42
 *      - for things like message handler functions whose whole existence
 
43
 *              is inside another PVM call.
 
44
 * Renamed "xamtraced" local trace var (TEV_DECLS).
 
45
 *      -> "pvmamtraced", no chance of name clashes... (ha ha)
 
46
 * (Spanker=kohl)
 
47
 *
 
48
 * Revision 1.5  1997/06/25  22:11:13  pvmsrc
 
49
 * Markus adds his frigging name to the author list of
 
50
 *      every file he ever looked at...
 
51
 *
 
52
 * Revision 1.4  1997/04/30  21:33:25  pvmsrc
 
53
 * SGI Compiler Warning Cleanup.
 
54
 *      - stupid ##@%&@(...  made explicit boolean expressions out of
 
55
 *              assignments inside TEV_EXCLUSIVE conditional.  :-Q
 
56
 *
 
57
 * Revision 1.3  1997/01/28  19:28:35  pvmsrc
 
58
 * New Copyright Notice & Authors.
 
59
 *
 
60
 * Revision 1.2  1996/10/24  21:49:50  pvmsrc
 
61
 * Modified for New Tracing Facility:
 
62
 *      - added new struct pvmtrcencvec for trace event packing.
 
63
 *      - modified tracing macros:
 
64
 *              * TEV_DO_TRACE() requires 2 args now, kind & entry_exit.
 
65
 *              * TEV_FIN(), tev_fin() now requires no args.
 
66
 *              * TEV_DECLS, no need for xtrcbuf, xtrcsbf now.
 
67
 *      - added TEV_PACK_*() macros for trace event contents,
 
68
 *              for performance, uses enc_*() routines directly.
 
69
 *
 
70
 * Revision 1.1  1996/09/23  23:43:37  pvmsrc
 
71
 * Initial revision
 
72
 *
 
73
 * Revision 1.1  1994/06/03  20:38:32  manchek
 
74
 * Initial revision
 
75
 *
 
76
 */
 
77
 
 
78
 
 
79
/*****************************
 
80
 **  Internal Trace Structs **
 
81
 **                         **
 
82
 *****************************/
 
83
 
 
84
struct pvmtrcencvec {
 
85
        int (*enc_byte)();
 
86
        int (*enc_cplx)();
 
87
        int (*enc_dcplx)();
 
88
        int (*enc_double)();
 
89
        int (*enc_float)();
 
90
        int (*enc_int)();
 
91
        int (*enc_uint)();
 
92
        int (*enc_long)();
 
93
        int (*enc_ulong)();
 
94
        int (*enc_short)();
 
95
        int (*enc_ushort)();
 
96
        int (*enc_str)();
 
97
};
 
98
 
 
99
 
 
100
void tev_init();
 
101
void tev_flush();
 
102
 
 
103
 
 
104
/*****************************
 
105
 **  Internal Trace Macros  **
 
106
 **                         **
 
107
 *****************************/
 
108
 
 
109
/* to check that task is connected without a function call */
 
110
 
 
111
#define BEATASK ( pvmmytid == -1 ? pvmbeatask() : 0 )
 
112
 
 
113
/* check tracing on event kind */
 
114
 
 
115
#define TEV_CHECK_TRACE( _kind ) \
 
116
        ( !BEATASK && pvmtrc.trctid > 0 && pvmtrc.trctid != pvmmytid \
 
117
                && TEV_MASK_CHECK( pvmtrc.tmask, _kind ) )
 
118
 
 
119
/* check tracing and generate start message */
 
120
 
 
121
#define TEV_DO_TRACE( _kind, _entry_exit ) \
 
122
        ( TEV_CHECK_TRACE( _kind ) && tev_begin( _kind, _entry_exit ) )
 
123
 
 
124
#define TEV_FIN tev_fin()
 
125
 
 
126
#define TEV_DECLS               int pvmamtraced; \
 
127
                                                int pvmampushed; \
 
128
                                                int pvmtoplvlsave;
 
129
 
 
130
#define TEV_EXCLUSIVE   ( (pvmamtraced = pvmtoplvl) != 0 \
 
131
                                                        && (pvmtoplvl = 0) == 0 )
 
132
#define TEV_AMEXCL              pvmamtraced
 
133
#define TEV_ENDEXCL             ( pvmtoplvl = pvmamtraced )
 
134
 
 
135
#define TEV_PUSHTOP             ( pvmtoplvlsave = pvmtoplvl, pvmtoplvl = 1, \
 
136
                                                        pvmampushed = 1 )
 
137
#define TEV_AMPUSHED    pvmampushed
 
138
#define TEV_POPTOP              ( pvmtoplvl = pvmtoplvlsave, pvmampushed = 0 )
 
139
 
 
140
/* packing macros */
 
141
 
 
142
#define TEV_PACK_BYTE( _did, _array, _datap, _cnt, _std ) \
 
143
        (pvmtrccodef->enc_byte)( _did, _array, \
 
144
                (void *)(_datap), _cnt, _std )
 
145
 
 
146
#define TEV_PACK_CPLX( _did, _array, _datap, _cnt, _std ) \
 
147
        (pvmtrccodef->enc_cplx)( _did, _array, \
 
148
                (void *)(_datap), _cnt, _std )
 
149
 
 
150
#define TEV_PACK_DCPLX( _did, _array, _datap, _cnt, _std ) \
 
151
        (pvmtrccodef->enc_dcplx)( _did, _array, \
 
152
                (void *)(_datap), _cnt, _std )
 
153
 
 
154
#define TEV_PACK_DOUBLE( _did, _array, _datap, _cnt, _std ) \
 
155
        (pvmtrccodef->enc_double)( _did, _array, \
 
156
                (void *)(_datap), _cnt, _std )
 
157
 
 
158
#define TEV_PACK_FLOAT( _did, _array, _datap, _cnt, _std ) \
 
159
        (pvmtrccodef->enc_float)( _did, _array, \
 
160
                (void *)(_datap), _cnt, _std )
 
161
 
 
162
#define TEV_PACK_INT( _did, _array, _datap, _cnt, _std ) \
 
163
        (pvmtrccodef->enc_int)( _did, _array, \
 
164
                (void *)(_datap), _cnt, _std )
 
165
 
 
166
#define TEV_PACK_UINT( _did, _array, _datap, _cnt, _std ) \
 
167
        (pvmtrccodef->enc_uint)( _did, _array, \
 
168
                (void *)(_datap), _cnt, _std )
 
169
 
 
170
#define TEV_PACK_LONG( _did, _array, _datap, _cnt, _std ) \
 
171
        (pvmtrccodef->enc_long)( _did, _array, \
 
172
                (void *)(_datap), _cnt, _std )
 
173
 
 
174
#define TEV_PACK_ULONG( _did, _array, _datap, _cnt, _std ) \
 
175
        (pvmtrccodef->enc_ulong)( _did, _array, \
 
176
                (void *)(_datap), _cnt, _std )
 
177
 
 
178
#define TEV_PACK_SHORT( _did, _array, _datap, _cnt, _std ) \
 
179
        (pvmtrccodef->enc_short)( _did, _array, \
 
180
                (void *)(_datap), _cnt, _std )
 
181
 
 
182
#define TEV_PACK_USHORT( _did, _array, _datap, _cnt, _std ) \
 
183
        (pvmtrccodef->enc_ushort)( _did, _array, \
 
184
                (void *)(_datap), _cnt, _std )
 
185
 
 
186
#define TEV_PACK_STRING( _did, _array, _datap, _cnt, _std ) \
 
187
        (pvmtrccodef->enc_str)( _did, _array, \
 
188
                (void *)(_datap), _cnt, _std )
 
189