1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
2 /*
3  *
4  *   Copyright (C) 1997 University of Chicago.
5  *   See COPYRIGHT notice in top-level directory.
6  */
7 
8 #include "mpioimpl.h"
9 
10 #ifdef HAVE_WEAK_SYMBOLS
11 
12 #if defined(HAVE_PRAGMA_WEAK)
13 #pragma weak MPI_File_set_info = PMPI_File_set_info
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPI_File_set_info MPI_File_set_info
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPI_File_set_info as PMPI_File_set_info
18 /* end of weak pragmas */
19 #elif defined(HAVE_WEAK_ATTRIBUTE)
20 int MPI_File_set_info(MPI_File fh, MPI_Info info) __attribute__((weak,alias("PMPI_File_set_info")));
21 #endif
22 
23 /* Include mapping from MPI->PMPI */
24 #define MPIO_BUILD_PROFILING
25 #include "mpioprof.h"
26 #endif
27 
28 /*@
29     MPI_File_set_info - Sets new values for the hints associated with a file
30 
31 Input Parameters:
32 . fh - file handle (handle)
33 . info - info object (handle)
34 
35 .N fortran
36 @*/
MPI_File_set_info(MPI_File fh,MPI_Info info)37 int MPI_File_set_info(MPI_File fh, MPI_Info info)
38 {
39     int error_code;
40     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     /* --END ERROR HANDLING-- */
51 
52     /* set new info */
53     ADIO_SetInfo(adio_fh, info, &error_code);
54 
55 fn_exit:
56     /* --BEGIN ERROR HANDLING-- */
57     if (error_code != MPI_SUCCESS)
58 	error_code = MPIO_Err_return_file(adio_fh, error_code);
59     /* --END ERROR HANDLING-- */
60 
61     MPIU_THREAD_CS_EXIT(ALLFUNC,);
62 
63     return error_code;
64 fn_fail:
65     goto fn_exit;
66 }
67