|
Packit Service |
c5cf8c |
/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
|
|
Packit Service |
c5cf8c |
/*
|
|
Packit Service |
c5cf8c |
*
|
|
Packit Service |
c5cf8c |
* Copyright (C) 1997 University of Chicago.
|
|
Packit Service |
c5cf8c |
* See COPYRIGHT notice in top-level directory.
|
|
Packit Service |
c5cf8c |
*/
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#include "mpioimpl.h"
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#ifdef HAVE_WEAK_SYMBOLS
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
#if defined(HAVE_PRAGMA_WEAK)
|
|
Packit Service |
c5cf8c |
#pragma weak MPI_File_get_view = PMPI_File_get_view
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_HP_SEC_DEF)
|
|
Packit Service |
c5cf8c |
#pragma _HP_SECONDARY_DEF PMPI_File_get_view MPI_File_get_view
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_PRAGMA_CRI_DUP)
|
|
Packit Service |
c5cf8c |
#pragma _CRI duplicate MPI_File_get_view as PMPI_File_get_view
|
|
Packit Service |
c5cf8c |
/* end of weak pragmas */
|
|
Packit Service |
c5cf8c |
#elif defined(HAVE_WEAK_ATTRIBUTE)
|
|
Packit Service |
c5cf8c |
int MPI_File_get_view(MPI_File fh, MPI_Offset * disp, MPI_Datatype * etype, MPI_Datatype * filetype,
|
|
Packit Service |
c5cf8c |
char *datarep) __attribute__ ((weak, alias("PMPI_File_get_view")));
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* Include mapping from MPI->PMPI */
|
|
Packit Service |
c5cf8c |
#define MPIO_BUILD_PROFILING
|
|
Packit Service |
c5cf8c |
#include "mpioprof.h"
|
|
Packit Service |
c5cf8c |
#endif
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/*@
|
|
Packit Service |
c5cf8c |
MPI_File_get_view - Returns the file view
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Input Parameters:
|
|
Packit Service |
c5cf8c |
. fh - file handle (handle)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
Output Parameters:
|
|
Packit Service |
c5cf8c |
. disp - displacement (nonnegative integer)
|
|
Packit Service |
c5cf8c |
. etype - elementary datatype (handle)
|
|
Packit Service |
c5cf8c |
. filetype - filetype (handle)
|
|
Packit Service |
c5cf8c |
. datarep - data representation (string)
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
.N fortran
|
|
Packit Service |
c5cf8c |
@*/
|
|
Packit Service |
c5cf8c |
int MPI_File_get_view(MPI_File fh, MPI_Offset * disp, MPI_Datatype * etype,
|
|
Packit Service |
c5cf8c |
MPI_Datatype * filetype, char *datarep)
|
|
Packit Service |
c5cf8c |
{
|
|
Packit Service |
c5cf8c |
int error_code;
|
|
Packit Service |
c5cf8c |
ADIO_File adio_fh;
|
|
Packit Service |
c5cf8c |
static char myname[] = "MPI_FILE_GET_VIEW";
|
|
Packit Service |
c5cf8c |
int i, j, k, combiner;
|
|
Packit Service |
c5cf8c |
MPI_Datatype copy_etype, copy_filetype;
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_ENTER();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
adio_fh = MPIO_File_resolve(fh);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* --BEGIN ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
if (datarep == NULL) {
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
|
|
Packit Service |
c5cf8c |
myname, __LINE__, MPI_ERR_ARG, "**iodatarepnomem", 0);
|
|
Packit Service |
c5cf8c |
error_code = MPIO_Err_return_file(adio_fh, error_code);
|
|
Packit Service |
c5cf8c |
goto fn_exit;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* --END ERROR HANDLING-- */
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
*disp = adio_fh->disp;
|
|
Packit Service |
c5cf8c |
ADIOI_Strncpy(datarep,
|
|
Packit Service |
c5cf8c |
(adio_fh->is_external32 ? "external32" : "native"), MPI_MAX_DATAREP_STRING);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Type_get_envelope(adio_fh->etype, &i, &j, &k, &combiner);
|
|
Packit Service |
c5cf8c |
if (combiner == MPI_COMBINER_NAMED)
|
|
Packit Service |
c5cf8c |
*etype = adio_fh->etype;
|
|
Packit Service |
c5cf8c |
else {
|
|
Packit Service |
c5cf8c |
/* FIXME: It is wrong to use MPI_Type_contiguous; the user could choose to
|
|
Packit Service |
c5cf8c |
* re-implement MPI_Type_contiguous in an unexpected way. Either use
|
|
Packit Service |
c5cf8c |
* MPID_Barrier as in MPICH or PMPI_Type_contiguous */
|
|
Packit Service |
c5cf8c |
MPI_Type_contiguous(1, adio_fh->etype, ©_etype);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
/* FIXME: Ditto for MPI_Type_commit - use NMPI or PMPI */
|
|
Packit Service |
c5cf8c |
MPI_Type_commit(©_etype);
|
|
Packit Service |
c5cf8c |
*etype = copy_etype;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
/* FIXME: Ditto for MPI_Type_xxx - use NMPI or PMPI */
|
|
Packit Service |
c5cf8c |
MPI_Type_get_envelope(adio_fh->filetype, &i, &j, &k, &combiner);
|
|
Packit Service |
c5cf8c |
if (combiner == MPI_COMBINER_NAMED)
|
|
Packit Service |
c5cf8c |
*filetype = adio_fh->filetype;
|
|
Packit Service |
c5cf8c |
else {
|
|
Packit Service |
c5cf8c |
MPI_Type_contiguous(1, adio_fh->filetype, ©_filetype);
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
MPI_Type_commit(©_filetype);
|
|
Packit Service |
c5cf8c |
*filetype = copy_filetype;
|
|
Packit Service |
c5cf8c |
}
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
fn_exit:
|
|
Packit Service |
c5cf8c |
ROMIO_THREAD_CS_EXIT();
|
|
Packit Service |
c5cf8c |
|
|
Packit Service |
c5cf8c |
return MPI_SUCCESS;
|
|
Packit Service |
c5cf8c |
}
|