1
1
openmpi/opal/util/trace.c

51 строка
1.2 KiB
C
Исходник Обычный вид История

/* @file */
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University.
* All rights reserved.
* Copyright (c) 2004-2005 The Trustees of the University of Tennessee.
* All rights reserved.
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
* University of Stuttgart. All rights reserved.
* Copyright (c) 2004-2005 The Regents of the University of California.
* All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
*
* $HEADER$
*/
#include "ompi_config.h"
#include "opal/util/output.h"
#include "opal/util/trace.h"
int opal_trace_handle;
/*
* Local state
*/
static opal_output_stream_t tracer;
void opal_trace_init(void)
{
#if OPAL_ENABLE_TRACE
/* get a file setup for opal_output to use for the trace */
OBJ_CONSTRUCT(&tracer, opal_output_stream_t);
tracer.lds_file_suffix = "trace";
tracer.lds_want_file = true;
opal_trace_handle = opal_output_open(&tracer);
#endif
}
void opal_trace_finalize(void)
{
#if OPAL_ENABLE_TRACE
opal_output_close(opal_trace_handle);
OBJ_DESTRUCT(&tracer);
#endif
}