~ubuntu-branches/ubuntu/vivid/mpich/vivid-proposed

« back to all changes in this revision

Viewing changes to src/mpi_t/cat_get_pv.c

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2014-04-01 20:24:20 UTC
  • mfrom: (5.2.4 sid)
  • Revision ID: package-import@ubuntu.com-20140401202420-t5ey1ia2klt5dkq3
Tags: 3.1-4
* [c3e3398] Disable test_primitives, which is unreliable on some platforms.
            (Closes: #743047)
* [265a699] Add minimal autotest.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2
 
/*
3
 
 *  (C) 2011 by Argonne National Laboratory.
4
 
 *      See COPYRIGHT in top-level directory.
5
 
 */
6
 
 
7
 
#include "mpiimpl.h"
8
 
 
9
 
/* -- Begin Profiling Symbol Block for routine MPI_T_category_get_pvars */
10
 
#if defined(HAVE_PRAGMA_WEAK)
11
 
#pragma weak MPI_T_category_get_pvars = PMPI_T_category_get_pvars
12
 
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
13
 
#pragma _HP_SECONDARY_DEF PMPI_T_category_get_pvars  MPI_T_category_get_pvars
14
 
#elif defined(HAVE_PRAGMA_CRI_DUP)
15
 
#pragma _CRI duplicate MPI_T_category_get_pvars as PMPI_T_category_get_pvars
16
 
#endif
17
 
/* -- End Profiling Symbol Block */
18
 
 
19
 
/* Define MPICH_MPI_FROM_PMPI if weak symbols are not supported to build
20
 
   the MPI routines */
21
 
#ifndef MPICH_MPI_FROM_PMPI
22
 
#undef MPI_T_category_get_pvars
23
 
#define MPI_T_category_get_pvars PMPI_T_category_get_pvars
24
 
 
25
 
/* any non-MPI functions go here, especially non-static ones */
26
 
 
27
 
#undef FUNCNAME
28
 
#define FUNCNAME MPIR_T_category_get_pvars_impl
29
 
#undef FCNAME
30
 
#define FCNAME MPIU_QUOTE(FUNCNAME)
31
 
int MPIR_T_category_get_pvars_impl(int cat_index, int len, int indices[])
32
 
{
33
 
    int mpi_errno = MPI_SUCCESS;
34
 
 
35
 
    /* TODO implement this function */
36
 
 
37
 
fn_exit:
38
 
    return mpi_errno;
39
 
fn_fail:
40
 
    goto fn_exit;
41
 
}
42
 
 
43
 
#endif /* MPICH_MPI_FROM_PMPI */
44
 
 
45
 
#undef FUNCNAME
46
 
#define FUNCNAME MPI_T_category_get_pvars
47
 
#undef FCNAME
48
 
#define FCNAME MPIU_QUOTE(FUNCNAME)
49
 
/*@
50
 
MPI_T_category_get_pvars - XXX description here
51
 
 
52
 
Input Parameters:
53
 
+ cat_index - index of the category to be queried, in the range [0,N-1] (integer)
54
 
- len - the length of the indices array (integer)
55
 
 
56
 
Output Parameters:
57
 
. indices - an integer array of size len, indicating performance variable indices (array of integers)
58
 
 
59
 
.N ThreadSafe
60
 
 
61
 
.N Fortran
62
 
 
63
 
.N Errors
64
 
@*/
65
 
int MPI_T_category_get_pvars(int cat_index, int len, int indices[])
66
 
{
67
 
    int mpi_errno = MPI_SUCCESS;
68
 
    MPID_MPI_STATE_DECL(MPID_STATE_MPI_T_CATEGORY_GET_PVARS);
69
 
 
70
 
    MPIU_THREAD_CS_ENTER(ALLFUNC,);
71
 
    MPID_MPI_FUNC_ENTER(MPID_STATE_MPI_T_CATEGORY_GET_PVARS);
72
 
 
73
 
    /* Validate parameters, especially handles needing to be converted */
74
 
#   ifdef HAVE_ERROR_CHECKING
75
 
    {
76
 
        MPID_BEGIN_ERROR_CHECKS
77
 
        {
78
 
 
79
 
            /* TODO more checks may be appropriate */
80
 
            if (mpi_errno != MPI_SUCCESS) goto fn_fail;
81
 
        }
82
 
        MPID_END_ERROR_CHECKS
83
 
    }
84
 
#   endif /* HAVE_ERROR_CHECKING */
85
 
 
86
 
    /* Convert MPI object handles to object pointers */
87
 
 
88
 
    /* Validate parameters and objects (post conversion) */
89
 
#   ifdef HAVE_ERROR_CHECKING
90
 
    {
91
 
        MPID_BEGIN_ERROR_CHECKS
92
 
        {
93
 
            /* TODO more checks may be appropriate (counts, in_place, buffer aliasing, etc) */
94
 
            if (mpi_errno != MPI_SUCCESS) goto fn_fail;
95
 
        }
96
 
        MPID_END_ERROR_CHECKS
97
 
    }
98
 
#   endif /* HAVE_ERROR_CHECKING */
99
 
 
100
 
    /* ... body of routine ...  */
101
 
 
102
 
    mpi_errno = MPIR_T_category_get_pvars_impl(cat_index, len, indices);
103
 
    if (mpi_errno) MPIU_ERR_POP(mpi_errno);
104
 
 
105
 
    /* ... end of body of routine ... */
106
 
 
107
 
fn_exit:
108
 
    MPID_MPI_FUNC_EXIT(MPID_STATE_MPI_T_CATEGORY_GET_PVARS);
109
 
    MPIU_THREAD_CS_EXIT(ALLFUNC,);
110
 
    return mpi_errno;
111
 
 
112
 
fn_fail:
113
 
    /* --BEGIN ERROR HANDLING-- */
114
 
#   ifdef HAVE_ERROR_CHECKING
115
 
    {
116
 
        mpi_errno = MPIR_Err_create_code(
117
 
            mpi_errno, MPIR_ERR_RECOVERABLE, FCNAME, __LINE__, MPI_ERR_OTHER,
118
 
            "**mpi_t_category_get_pvars", "**mpi_t_category_get_pvars %d %d %p", cat_index, len, indices);
119
 
    }
120
 
#   endif
121
 
    mpi_errno = MPIR_Err_return_comm(NULL, FCNAME, mpi_errno);
122
 
    goto fn_exit;
123
 
    /* --END ERROR HANDLING-- */
124
 
}