set_info.c 1.63 KB
Newer Older
1
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 
 *
 *   Copyright (C) 1997 University of Chicago. 
 *   See COPYRIGHT notice in top-level directory.
 */

#include "mpioimpl.h"

#ifdef HAVE_WEAK_SYMBOLS

#if defined(HAVE_PRAGMA_WEAK)
#pragma weak MPI_File_set_info = PMPI_File_set_info
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
#pragma _HP_SECONDARY_DEF PMPI_File_set_info MPI_File_set_info
#elif defined(HAVE_PRAGMA_CRI_DUP)
#pragma _CRI duplicate MPI_File_set_info as PMPI_File_set_info
/* end of weak pragmas */
19
20
#elif defined(HAVE_WEAK_ATTRIBUTE)
int MPI_File_set_info(MPI_File fh, MPI_Info info) __attribute__((weak,alias("PMPI_File_set_info")));
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#endif

/* Include mapping from MPI->PMPI */
#define MPIO_BUILD_PROFILING
#include "mpioprof.h"
#endif

/*@
    MPI_File_set_info - Sets new values for the hints associated with a file

Input Parameters:
. fh - file handle (handle)
. info - info object (handle)

.N fortran
@*/
37
int MPI_File_set_info(MPI_File fh, MPI_Info info)
38
39
40
{
    int error_code;
    static char myname[] = "MPI_FILE_SET_INFO";
41
    ADIO_File adio_fh;
42

43
    MPIU_THREAD_CS_ENTER(ALLFUNC,);
44

45
    adio_fh = MPIO_File_resolve(fh);
46
47

    /* --BEGIN ERROR HANDLING-- */
48
    MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
49
    MPIO_CHECK_INFO_ALL(info, error_code, fh->comm);
50
51
52
    /* --END ERROR HANDLING-- */

    /* set new info */
53
    ADIO_SetInfo(adio_fh, info, &error_code);
54

55
fn_exit:
56
57
    /* --BEGIN ERROR HANDLING-- */
    if (error_code != MPI_SUCCESS)
58
	error_code = MPIO_Err_return_file(adio_fh, error_code);
59
60
    /* --END ERROR HANDLING-- */

61
    MPIU_THREAD_CS_EXIT(ALLFUNC,);
62
63

    return error_code;
64
65
fn_fail:
    goto fn_exit;
66
}