1
1

Add timer support for Catamount

This commit was SVN r18729.
Этот коммит содержится в:
Brian Barrett 2008-06-24 22:13:34 +00:00
родитель edad3b66a2
Коммит e7a299d046
6 изменённых файлов: 241 добавлений и 1 удалений

Просмотреть файл

@ -6,7 +6,7 @@ enable_pretty_print_stacktrace=no
enable_dlopen=no
with_portals_config=redstorm
with_memory_manager=none
enable_mca_no_build=carto-file,maffinity,paffinity,timer,btl-sm,btl-self,coll-hierarch,coll-sm,common-sm,mpool-sm,pml-dr
enable_mca_no_build=carto-file,maffinity,paffinity,btl-sm,btl-self,coll-hierarch,coll-sm,common-sm,mpool-sm,pml-dr
enable_contrib_no_build=libnbc,vt
with_rte_support=no
enable_heterogeneous=no

23
opal/mca/timer/catamount/Makefile.am Обычный файл
Просмотреть файл

@ -0,0 +1,23 @@
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. 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$
#
noinst_LTLIBRARIES = libmca_timer_catamount.la
libmca_timer_catamount_la_SOURCES = \
timer_catamount.h \
timer_catamount_component.c

68
opal/mca/timer/catamount/configure.m4 Обычный файл
Просмотреть файл

@ -0,0 +1,68 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. 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$
#
AC_DEFUN([MCA_timer_catamount_COMPILE_MODE], [
AC_MSG_CHECKING([for MCA component $2:$3 compile mode])
$4="static"
AC_MSG_RESULT([$$4])
])
# MCA_timer_catamount_CONFIG(action-if-can-compile,
# [action-if-cant-compile])
# ------------------------------------------------
AC_DEFUN([MCA_timer_catamount_CONFIG],[
AC_ARG_WITH([timer],
[AC_HELP_STRING([--with-timer=TYPE],
[Build high resolution timer component TYPE])])
AS_IF([test "$with_timer" = "catamount"],
[timer_catamount_happy="yes"
timer_catamount_should_use=1],
[timer_catamount_should_use=0
AS_IF([test "$with_timer" = ""],
[timer_catamount_happy="yes"],
[timer_catamount_happy="no"])])
AS_IF([test "$timer_catamount_happy" = "yes"],
[AC_CHECK_HEADERS([catamount/dclock.h], [],
[timer_catamount_happy=no])])
AS_IF([test "$timer_catamount_happy" = "yes"],
[AC_CACHE_CHECK([for __cpu_mhz],
[ompi_cv_have___cpu_mhz],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <catamount/dclock.h>
],[
unsigned int a = __cpu_mhz;
])],
[ompi_cv_have___cpu_mhz=yes],
[ompi_cv_have___cpu_mhz=no])])
AS_IF([test "$ompi_cv_have___cpu_mhz" = "no"],
[timer_catamount_happy="no"])])
AS_IF([test "$timer_catamount_happy" = "no" -a \
"$timer_catamount_should_use" = "1"],
[AC_MSG_ERROR([Catamount timer requested but not available. Aborting.])])
AS_IF([test "$timer_catamount_happy" = "yes"],
[timer_base_include="catamount/timer_catamount.h"
$1],
[$2])
])

23
opal/mca/timer/catamount/configure.params Обычный файл
Просмотреть файл

@ -0,0 +1,23 @@
# -*- shell-script -*-
#
# Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
# University Research and Technology
# Corporation. All rights reserved.
# Copyright (c) 2004-2005 The University of Tennessee and The University
# of Tennessee Research Foundation. 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$
#
# Specific to this module
PARAM_CONFIG_PRIORITY=100
PARAM_CONFIG_FILES="Makefile"

62
opal/mca/timer/catamount/timer_catamount.h Обычный файл
Просмотреть файл

@ -0,0 +1,62 @@
/*
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. 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$
*/
#ifndef OPAL_MCA_TIMER_CATAMOUNT_TIMER_CATAMOUNT_H
#define OPAL_MCA_TIMER_CATAMOUNT_TIMER_CATAMOUNT_H
#include "opal_config.h"
#include <opal/sys/timer.h>
OPAL_DECLSPEC extern opal_timer_t opal_timer_catamount_freq;
static inline opal_timer_t
opal_timer_base_get_cycles(void)
{
#if OPAL_HAVE_SYS_TIMER_GET_CYCLES
return opal_sys_timer_get_cycles();
#else
return 0;
#endif
}
static inline opal_timer_t
opal_timer_base_get_usec(void)
{
#if OPAL_HAVE_SYS_TIMER_GET_CYCLES
/* freq is in Hz, so this gives usec */
return opal_sys_timer_get_cycles() * 1000000 / opal_timer_catamount_freq;
#else
return 0;
#endif
}
static inline opal_timer_t
opal_timer_base_get_freq(void)
{
return opal_timer_catamount_freq;
}
#define OPAL_TIMER_CYCLE_NATIVE OPAL_HAVE_SYS_TIMER_GET_CYCLES
#define OPAL_TIMER_CYCLE_SUPPORTED OPAL_HAVE_SYS_TIMER_GET_CYCLES
#define OPAL_TIMER_USEC_NATIVE 0
#define OPAL_TIMER_USEC_SUPPORTED OPAL_HAVE_SYS_TIMER_GET_CYCLES
#endif

Просмотреть файл

@ -0,0 +1,64 @@
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
* Corporation. All rights reserved.
* Copyright (c) 2004-2005 The University of Tennessee and The University
* of Tennessee Research Foundation. 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 "opal_config.h"
#include <catamount/dclock.h>
#include "opal/mca/timer/timer.h"
#include "opal/mca/timer/catamount/timer_catamount.h"
#include "opal/constants.h"
opal_timer_t opal_timer_catamount_freq;
static int opal_timer_catamount_open(void);
const opal_timer_base_component_1_0_0_t mca_timer_catamount_component = {
/* First, the mca_component_t struct containing meta information
about the component itself */
{
/* Indicate that we are a timer v1.0.0 component (which also
implies a specific MCA version) */
OPAL_TIMER_BASE_VERSION_1_0_0,
/* Component name and version */
"catamount",
OPAL_MAJOR_VERSION,
OPAL_MINOR_VERSION,
OPAL_RELEASE_VERSION,
/* Component open and close functions */
opal_timer_catamount_open,
NULL
},
/* Next the MCA v1.0.0 component meta data */
{
/* The component is checkpoint ready */
MCA_BASE_METADATA_PARAM_CHECKPOINT
},
};
int
opal_timer_catamount_open(void)
{
opal_timer_catamount_freq = __cpu_mhz;
opal_timer_catamount_freq *= (1000 * 1000);
return OPAL_SUCCESS;
}