1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
/*
* Copyright 1998-1999, University of Notre Dame.
* Authors: Brian W. Barrett, Arun F. Rodrigues, Jeffrey M. Squyres,
* and Andrew Lumsdaine
*
* This file is part of XMPI
*
* You should have received a copy of the License Agreement for XMPI
* along with the software; see the file LICENSE. If not, contact
* Office of Research, University of Notre Dame, Notre Dame, IN 46556.
*
* Permission to modify the code and to distribute modified code is
* granted, provided the text of this NOTICE is retained, a notice that
* the code was modified is included with the above COPYRIGHT NOTICE and
* with the COPYRIGHT NOTICE in the LICENSE file, and that the LICENSE
* file is distributed with the modified code.
*
* LICENSOR MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED.
* By way of example, but not limitation, Licensor MAKES NO
* REPRESENTATIONS OR WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY
* PARTICULAR PURPOSE OR THAT THE USE OF THE LICENSED SOFTWARE COMPONENTS
* OR DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS
* OR OTHER RIGHTS.
*
* Additional copyrights may follow.
*
* $Id: lamtrace.h,v 1.2 1999/11/08 06:20:20 bbarrett Exp $
*
* Function: - macros for reading LAM traces and
* extracting components
*/
#ifndef _LAMTRACE_H
#define _LAMTRACE_H
#include <stdio.h>
#include "app_mgmt.h"
#include "lam.h"
#define lamtr_raw_cid_m(c) lamtr_read(&(c), sizeof(struct trcid), 1)
#define lamtr_raw_src_m(s) lamtr_read(&(s), sizeof(struct trsrc), 1)
#define lamtr_raw_rthdr_m(r) lamtr_read(&(r), sizeof(struct trrthdr), 1)
#define lamtr_raw_init_m(i) lamtr_read(&(i), sizeof(struct trinit), 1)
#define lamtr_raw_onoff_m(o) lamtr_read(&(o), sizeof(struct tronoff), 1)
#define lamtr_raw_xchg_m(x) lamtr_read(&(x), sizeof(struct trxchg), 1)
#define lamtr_raw_msg_m(m) lamtr_read(&(m), sizeof(struct trmsg), 1)
#define lamtr_raw_dtype_m(d) lamtr_read(&(d), sizeof(struct trdtype), 1)
#define lamtr_xt_magic_m(t, m) ttoli4((int4 *) (t), (int4 *) (m))
#define lamtr_xt_nprocs_m(t, n) ttoli4((int4 *) (t), (int4 *) (n))
#define lamtr_xt_world_m(t, n, w) \
{ \
memcpy((char *) (w), (char *) (t), (n) * sizeof(struct _gps)); \
mttoli4((int4 *) (w), (n) * sizeof(struct _gps)/sizeof(int4)); \
}
#define lamtr_xt_src_m(t, n, p, l) \
{ \
ttoli4(&(t)->trs_node, (int4 *) (n)); \
ttoli4(&(t)->trs_pid, (int4 *) (p)); \
ttoli4(&(t)->trs_listno, (int4 *) (l)); \
}
#define lamtr_xt_cid_m(t, c, l, r) \
{ \
ttoli4(&(t)->trc_cid, (int4 *) (c)); \
ttoli4(&(t)->trc_nlg, (int4 *) (l)); \
ttoli4(&(t)->trc_nrg, (int4 *) (r)); \
}
#define lamtr_xt_dtype_m(t, d, l) \
{ \
ttoli4(&(t)->trd_dtype, (int4 *) (d)); \
ttoli4(&(t)->trd_length, (int4 *) (l)); \
}
#define lamtr_xt_rt_time_m(t, time) ttolf8(&(t)->trr_time, time)
#define lamtr_xt_rt_type_m(t, type) ttoli4(&(t)->trr_type, type)
#define lamtr_xt_init_skew_m(t, skew) ttolf8(&(t)->tri_skew, skew)
#define lamtr_xt_init_prog_m(t, prog) (prog = &(t)->tri_name[0])
#define lamtr_xt_onoff_num_m(t, n) ttoli4(&(t)->tro_trnum, n)
#define lamtr_xt_xchg_m(t, f, s) \
{ \
ttoli4(&(t)->trx_topfunc, f); \
ttoli4(&(t)->trx_sub, s); \
}
#define lamtr_xt_msg_cid_m(t, c) ttoli4(&(t)->trm_cid, c)
#define lamtr_xt_msg_peer_m(t, p) ttoli4(&(t)->trm_peer, m)
#define lamtr_xt_msg_msrc_m(t, msrc) ttoli4(&(t)->trm_mrank, msrc)
#define lamtr_xt_msg_tag_m(t, tag) ttoli4(&(t)->trm_tag, tag)
#define lamtr_xt_msg_mtag_m(t, tag) ttoli4(&(t)->trm_mtag, tag)
#define lamtr_xt_msg_dtype_m(t, d) ttoli4(&(t)->trm_dtype, d)
#define lamtr_xt_msg_top_m(t, f) ttoli4(&(t)->trm_topfunc, f)
#define lamtr_xt_msg_wrap_m(t, w) ttoli4(&(t)->trm_wrapfunc, w)
#define lamtr_xt_msg_seq_m(t, s) ttoli4(&(t)->trm_seqnum, s)
/*
* prototypes
*/
#ifndef __ARGS
#if __STDC__ || defined(c_plusplus) || defined(__cplusplus)
#define __ARGS(a) a
#else
#define __ARGS(a) ()
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern void lamtr_set_stream __ARGS((FILE *));
extern int lamtr_open_file __ARGS((char *));
extern int lamtr_read __ARGS((void *, size_t, size_t));
extern int lamtr_parse_world __ARGS((int4 *, struct _gps **));
extern int lamtr_raw_world __ARGS((int4 *, char **));
extern int lamtr_parse_comm __ARGS((int4 *, int4*, int4*, struct _gps **));
extern int lamtr_raw_comm __ARGS((char *, struct _gps **));
extern int lamtr_raw_dtype __ARGS((char **));
extern int lamtr_parse_dtype __ARGS((int4 *, char **));
extern int lamtr_find_rank __ARGS((int, struct _gps *, int, int));
#ifdef __cplusplus
}
#endif
#endif /* _LAMTRACE_H */
|