1 /*
2  * Copyright (C) by Argonne National Laboratory
3  *     See COPYRIGHT in top-level directory
4  */
5 
6 #include "mpiimpl.h"
7 
8 /* -- Begin Profiling Symbol Block for routine MPI_Wtick */
9 #if defined(HAVE_PRAGMA_WEAK)
10 #pragma weak MPI_Wtick = PMPI_Wtick
11 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
12 #pragma _HP_SECONDARY_DEF PMPI_Wtick  MPI_Wtick
13 #elif defined(HAVE_PRAGMA_CRI_DUP)
14 #pragma _CRI duplicate MPI_Wtick as PMPI_Wtick
15 #elif defined(HAVE_WEAK_ATTRIBUTE)
16 double MPI_Wtick(void) __attribute__ ((weak, alias("PMPI_Wtick")));
17 #endif
18 /* -- End Profiling Symbol Block */
19 
20 /* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
21    the MPI routines */
22 #ifndef MPICH_MPI_FROM_PMPI
23 #undef MPI_Wtick
24 #define MPI_Wtick PMPI_Wtick
25 
26 #endif
27 
28 
29 /*@
30   MPI_Wtick - Returns the resolution of MPI_Wtime
31 
32   Return value:
33   Time in seconds of resolution of MPI_Wtime
34 
35   Notes for Fortran:
36   This is a function, declared as 'DOUBLE PRECISION MPI_WTICK()' in Fortran.
37 
38 .see also: MPI_Wtime, MPI_Comm_get_attr, MPI_Attr_get
39 @*/
MPI_Wtick(void)40 double MPI_Wtick(void)
41 {
42     double tick;
43     MPIR_FUNC_TERSE_STATE_DECL(MPID_STATE_MPI_WTICK);
44 
45     MPIR_ERRTEST_INITIALIZED_ORDIE();
46 
47     MPIR_FUNC_TERSE_ENTER(MPID_STATE_MPI_WTICK);
48     MPL_wtick(&tick);
49     MPIR_FUNC_TERSE_EXIT(MPID_STATE_MPI_WTICK);
50 
51     return tick;
52 }
53