1 /* -*- Mode: C; c-basic-offset:4 ; -*- */
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_read_all_end = PMPI_File_read_all_end
14 #elif defined(HAVE_PRAGMA_HP_SEC_DEF)
15 #pragma _HP_SECONDARY_DEF PMPI_File_read_all_end MPI_File_read_all_end
16 #elif defined(HAVE_PRAGMA_CRI_DUP)
17 #pragma _CRI duplicate MPI_File_read_all_end as PMPI_File_read_all_end
18 /* end of weak pragmas */
19 #endif
20 
21 /* Include mapping from MPI->PMPI */
22 #define MPIO_BUILD_PROFILING
23 #include "mpioprof.h"
24 #endif
25 
26 /*@
27     MPI_File_read_all_end - Complete a split collective read using
28     individual file pointer
29 
30 Input Parameters:
31 . fh - file handle (handle)
32 
33 Output Parameters:
34 . buf - initial address of buffer (choice)
35 . status - status object (Status)
36 
37 .N fortran
38 @*/
MPI_File_read_all_end(MPI_File mpi_fh,void * buf,MPI_Status * status)39 int MPI_File_read_all_end(MPI_File mpi_fh, void *buf, MPI_Status *status)
40 {
41     int error_code;
42     static char myname[] = "MPI_FILE_IREAD";
43 
44     error_code = MPIOI_File_read_all_end(mpi_fh, buf, myname, status);
45 
46     return error_code;
47 }
48 
49 /* prevent multiple definitions of this routine */
50 #ifdef MPIO_BUILD_PROFILING
MPIOI_File_read_all_end(MPI_File mpi_fh,void * buf,char * myname,MPI_Status * status)51 int MPIOI_File_read_all_end(MPI_File mpi_fh,
52 			    void *buf,
53 			    char *myname,
54 			    MPI_Status *status)
55 {
56     int error_code = MPI_SUCCESS;
57     ADIO_File fh;
58 
59     MPIU_UNREFERENCED_ARG(buf);
60 
61     MPIU_THREAD_CS_ENTER(ALLFUNC,);
62 
63     fh = MPIO_File_resolve(mpi_fh);
64 
65     /* --BEGIN ERROR HANDLING-- */
66     MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
67 
68     if (!(fh->split_coll_count)) {
69 	error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
70 					  myname, __LINE__, MPI_ERR_IO,
71 					  "**iosplitcollnone", 0);
72 	error_code = MPIO_Err_return_file(fh, error_code);
73 	goto fn_exit;
74     }
75     /* --END ERROR HANDLING-- */
76 
77 #ifdef HAVE_STATUS_SET_BYTES
78     if (status != MPI_STATUS_IGNORE)
79        *status = fh->split_status;
80 #endif
81     fh->split_coll_count = 0;
82 
83 fn_exit:
84     MPIU_THREAD_CS_EXIT(ALLFUNC,);
85 
86     return error_code;
87 }
88 #endif
89