本文整理汇总了C++中MPIO_Err_return_file函数的典型用法代码示例。如果您正苦于以下问题:C++ MPIO_Err_return_file函数的具体用法?C++ MPIO_Err_return_file怎么用?C++ MPIO_Err_return_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MPIO_Err_return_file函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handle
/*@
MPI_File_set_size - Sets the file size
Input Parameters:
. fh - file handle (handle)
. size - size to truncate or expand file (nonnegative integer)
.N fortran
@*/
int MPI_File_set_size(MPI_File mpi_fh, MPI_Offset size)
{
int error_code;
ADIO_File fh;
static char myname[] = "MPI_FILE_SET_SIZE";
MPI_Offset tmp_sz;
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILESETSIZE, TRDTBLOCK, fh,
MPI_DATATYPE_NULL, -1);
#endif /* MPI_hpux */
MPID_CS_ENTER();
MPIR_Nest_incr();
fh = MPIO_File_resolve(mpi_fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
if (size < 0) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadsize", 0);
error_code = MPIO_Err_return_file(fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
tmp_sz = size;
MPI_Bcast(&tmp_sz, 1, ADIO_OFFSET, 0, fh->comm);
/* --BEGIN ERROR HANDLING-- */
if (tmp_sz != size) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**notsame", 0);
error_code = MPIO_Err_return_file(fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
ADIOI_TEST_DEFERRED(fh, "MPI_File_set_size", &error_code);
ADIO_Resize(fh, size, &error_code);
/* TODO: what to do with error code? */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, fh, MPI_DATATYPE_NULL, -1);
#endif /* MPI_hpux */
fn_exit:
MPIR_Nest_decr();
MPID_CS_EXIT();
return error_code;
}
示例2: delete
/*@
MPI_File_delete - Deletes a file
Input Parameters:
. filename - name of file to delete (string)
. info - info object (handle)
.N fortran
@*/
int MPI_File_delete(ROMIO_CONST char *filename, MPI_Info info)
{
int error_code, file_system;
char *tmp;
ADIOI_Fns *fsops;
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEDELETE, TRDTBLOCK,
MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
#endif /* MPI_hpux */
MPIU_UNREFERENCED_ARG(info);
MPIU_THREAD_CS_ENTER(ALLFUNC,);
MPIR_MPIOInit(&error_code);
if (error_code != MPI_SUCCESS) goto fn_exit;
/* resolve file system type from file name; this is a collective call */
ADIO_ResolveFileType(MPI_COMM_SELF, filename, &file_system, &fsops,
&error_code);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
{
/* ADIO_ResolveFileType() will print as informative a message as it
* possibly can or call MPIR_Err_setmsg. We just need to propagate
* the error up. In the PRINT_ERR_MSG case MPI_Abort has already
* been called as well, so we probably didn't even make it this far.
*/
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
/* skip prefixes on file names if they have more than one character;
* single-character prefixes are assumed to be windows drive
* specifications (e.g. c:\foo) and are left alone.
*/
tmp = strchr(filename, ':');
if (tmp > filename + 1)
filename = tmp + 1;
/* call the fs-specific delete function */
(fsops->ADIOI_xxx_Delete)(filename, &error_code);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, MPI_FILE_NULL, MPI_DATATYPE_NULL, -1);
#endif /* MPI_hpux */
fn_exit:
MPIU_THREAD_CS_EXIT(ALLFUNC,);
return error_code;
}
示例3: MPIOI_File_read_all_begin
int MPIOI_File_read_all_begin(MPI_File mpi_fh,
MPI_Offset offset,
int file_ptr_type,
void *buf,
int count,
MPI_Datatype datatype,
char *myname)
{
int error_code, datatype_size;
ADIO_File fh;
MPID_CS_ENTER();
MPIR_Nest_incr();
fh = MPIO_File_resolve(mpi_fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
MPIO_CHECK_COUNT(fh, count, myname, error_code);
MPIO_CHECK_DATATYPE(fh, datatype, myname, error_code);
if (file_ptr_type == ADIO_EXPLICIT_OFFSET && offset < 0)
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadoffset", 0);
error_code = MPIO_Err_return_file(fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
MPI_Type_size(datatype, &datatype_size);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_INTEGRAL_ETYPE(fh, count, datatype_size, myname, error_code);
MPIO_CHECK_READABLE(fh, myname, error_code);
MPIO_CHECK_NOT_SEQUENTIAL_MODE(fh, myname, error_code);
if (fh->split_coll_count) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_IO,
"**iosplitcoll", 0);
error_code = MPIO_Err_return_file(fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
fh->split_coll_count = 1;
ADIO_ReadStridedColl(fh, buf, count, datatype, file_ptr_type,
offset, &fh->split_status, &error_code);
fn_exit:
MPIR_Nest_decr();
MPID_CS_EXIT();
return error_code;
}
示例4: handle
/*@
MPI_File_set_atomicity - Sets the atomicity mode
Input Parameters:
. fh - file handle (handle)
. flag - true to set atomic mode, false to set nonatomic mode (logical)
.N fortran
@*/
int MPI_File_set_atomicity(MPI_File fh, int flag)
{
int error_code, tmp_flag;
static char myname[] = "MPI_FILE_SET_ATOMICITY";
ADIO_Fcntl_t *fcntl_struct;
ADIO_File adio_fh;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
/* --END ERROR HANDLING-- */
ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code);
if (flag) flag = 1; /* take care of non-one values! */
/* check if flag is the same on all processes */
tmp_flag = flag;
MPI_Bcast(&tmp_flag, 1, MPI_INT, 0, adio_fh->comm);
/* --BEGIN ERROR HANDLING-- */
if (tmp_flag != flag) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**notsame", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
if (adio_fh->atomicity == flag){
error_code = MPI_SUCCESS;
goto fn_exit;
}
fcntl_struct = (ADIO_Fcntl_t *) ADIOI_Malloc(sizeof(ADIO_Fcntl_t));
fcntl_struct->atomicity = flag;
ADIO_Fcntl(adio_fh, ADIO_FCNTL_SET_ATOMICITY, fcntl_struct, &error_code);
/* TODO: what do we do with this error code? */
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(adio_fh, error_code);
/* --END ERROR HANDLING-- */
ADIOI_Free(fcntl_struct);
fn_exit:
MPIU_THREAD_CS_EXIT(ALLFUNC,);
return error_code;
}
示例5: handle
/*@
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
@*/
int MPI_File_set_info(MPI_File fh, MPI_Info info)
{
int error_code;
static char myname[] = "MPI_FILE_SET_INFO";
ADIO_File adio_fh;
MPIU_THREAD_CS_ENTER(ALLFUNC,);
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
/* --END ERROR HANDLING-- */
/* set new info */
ADIO_SetInfo(adio_fh, info, &error_code);
fn_exit:
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(adio_fh, error_code);
/* --END ERROR HANDLING-- */
MPIU_THREAD_CS_EXIT(ALLFUNC,);
return error_code;
}
示例6: MPIOI_File_read_all_end
int MPIOI_File_read_all_end(MPI_File fh,
void *buf,
char *myname,
MPI_Status *status)
{
int error_code = MPI_SUCCESS;
ADIO_File adio_fh;
MPIU_UNREFERENCED_ARG(buf);
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
if (!(adio_fh->split_coll_count)) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_IO,
"**iosplitcollnone", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
#ifdef HAVE_STATUS_SET_BYTES
if (status != MPI_STATUS_IGNORE)
*status = adio_fh->split_status;
#endif
adio_fh->split_coll_count = 0;
fn_exit:
return error_code;
}
示例7: MPI_File_iwrite
int MPI_File_iwrite(MPI_File mpi_fh, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
int error_code=MPI_SUCCESS;
static char myname[] = "MPI_FILE_IWRITE";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITE, TRDTSYSTEM, mpi_fh, datatype,
count);
#endif /* MPI_hpux */
MPIU_THREAD_CS_ENTER(ALLFUNC,);
error_code = MPIOI_File_iwrite(mpi_fh, (MPI_Offset) 0, ADIO_INDIVIDUAL,
buf, count, datatype, myname, request);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(mpi_fh, error_code);
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, mpi_fh, datatype, count);
#endif /* MPI_hpux */
MPIU_THREAD_CS_EXIT(ALLFUNC,);
return error_code;
}
示例8: MPIR_MPIOInit
void MPIR_MPIOInit(int * error_code) {
int flag;
char myname[] = "MPIR_MPIOInit";
/* first check if ADIO has been initialized. If not, initialize it */
if (ADIO_Init_keyval == MPI_KEYVAL_INVALID) {
MPI_Initialized(&flag);
/* --BEGIN ERROR HANDLING-- */
if (!flag) {
*error_code = MPIO_Err_create_code(MPI_SUCCESS,
MPIR_ERR_RECOVERABLE, myname, __LINE__,
MPI_ERR_OTHER, "**initialized", 0);
*error_code = MPIO_Err_return_file(MPI_FILE_NULL, *error_code);
return;
}
/* --END ERROR HANDLING-- */
MPI_Keyval_create(MPI_NULL_COPY_FN, ADIOI_End_call, &ADIO_Init_keyval,
(void *) 0);
/* put a dummy attribute on MPI_COMM_SELF, because we want the delete
function to be called when MPI_COMM_SELF is freed. Clarified
in MPI-2 section 4.8, the standard mandates that attributes on
MPI_COMM_SELF get cleaned up early in MPI_Finalize */
MPI_Attr_put(MPI_COMM_SELF, ADIO_Init_keyval, (void *) 0);
/* initialize ADIO */
ADIO_Init( (int *)0, (char ***)0, error_code);
}
*error_code = MPI_SUCCESS;
}
示例9: handle
/*@
MPI_File_get_position_shared - Returns the current position of the
shared file pointer in etype units relative to the current view
Input Parameters:
. fh - file handle (handle)
Output Parameters:
. offset - offset of shared file pointer (nonnegative integer)
.N fortran
@*/
int MPI_File_get_position_shared(MPI_File fh, MPI_Offset *offset)
{
int error_code;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_GET_POSITION_SHARED";
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
MPIO_CHECK_FS_SUPPORTS_SHARED(adio_fh, myname, error_code);
/* --END ERROR HANDLING-- */
ADIOI_TEST_DEFERRED(adio_fh, myname, &error_code);
ADIO_Get_shared_fp(adio_fh, 0, offset, &error_code);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(adio_fh, error_code);
/* --END ERROR HANDLING-- */
fn_exit:
return error_code;
}
示例10: MPI_File_iwrite_at
int MPI_File_iwrite_at(MPI_File mpi_fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype,
MPIO_Request *request)
{
int error_code;
ADIO_File fh;
static char myname[] = "MPI_FILE_IWRITE_AT";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEIWRITEAT, TRDTSYSTEM,
mpi_fh, datatype, count);
#endif /* MPI_hpux */
fh = MPIO_File_resolve(mpi_fh);
error_code = MPIOI_File_iwrite(fh, offset, ADIO_EXPLICIT_OFFSET, buf,
count, datatype, myname, request);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(fh, error_code);
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, mpi_fh, datatype, count)
#endif /* MPI_hpux */
return error_code;
}
示例11: handle
/*@
MPI_File_iread_all - Nonblocking collective read using individual file pointer
Input Parameters:
. fh - file handle (handle)
. count - number of elements in buffer (nonnegative integer)
. datatype - datatype of each buffer element (handle)
Output Parameters:
. buf - initial address of buffer (choice)
. request - request object (handle)
.N fortran
@*/
int MPI_File_iread_all(MPI_File fh, void *buf, int count,
MPI_Datatype datatype, MPI_Request *request)
{
int error_code;
static char myname[] = "MPI_FILE_IREAD_ALL";
#ifdef MPI_hpux
int fl_xmpi;
HPMP_IO_START(fl_xmpi, BLKMPIFILEREADALL, TRDTBLOCK, fh, datatype, count);
#endif /* MPI_hpux */
error_code = MPIOI_File_iread_all(fh, (MPI_Offset)0,
ADIO_INDIVIDUAL, buf,
count, datatype, myname, request);
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS) {
error_code = MPIO_Err_return_file(fh, error_code);
}
/* --END ERROR HANDLING-- */
#ifdef MPI_hpux
HPMP_IO_END(fl_xmpi, fh, datatype, count);
#endif /* MPI_hpux */
return error_code;
}
示例12: handle
/*@
MPI_File_get_byte_offset - Returns the absolute byte position in
the file corresponding to "offset" etypes relative to
the current view
Input Parameters:
. fh - file handle (handle)
. offset - offset (nonnegative integer)
Output Parameters:
. disp - absolute byte position of offset (nonnegative integer)
.N fortran
@*/
int MPI_File_get_byte_offset(MPI_File fh, MPI_Offset offset, MPI_Offset *disp)
{
int error_code;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_GET_BYTE_OFFSET";
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
if (offset < 0)
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadoffset", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
MPIO_CHECK_NOT_SEQUENTIAL_MODE(adio_fh, myname, error_code);
/* --END ERROR HANDLING-- */
ADIOI_Get_byte_offset(adio_fh, offset, disp);
fn_exit:
return MPI_SUCCESS;
}
示例13: handle
/*@
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
@*/
int MPI_File_set_info(MPI_File mpi_fh, MPI_Info info)
{
int error_code;
static char myname[] = "MPI_FILE_SET_INFO";
ADIO_File fh;
MPIU_THREAD_SINGLE_CS_ENTER("io");
MPIR_Nest_incr();
fh = MPIO_File_resolve(mpi_fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(fh, myname, error_code);
/* --END ERROR HANDLING-- */
/* set new info */
ADIO_SetInfo(fh, info, &error_code);
/* TODO: what to do with error code? */
/* --BEGIN ERROR HANDLING-- */
if (error_code != MPI_SUCCESS)
error_code = MPIO_Err_return_file(fh, error_code);
/* --END ERROR HANDLING-- */
fn_exit:
MPIR_Nest_decr();
MPIU_THREAD_SINGLE_CS_EXIT("io");
return error_code;
}
示例14: handle
/*@
MPI_File_get_errhandler - Returns the error handler for a file
Input Parameters:
. fh - file handle (handle)
Output Parameters:
. errhandler - error handler (handle)
.N fortran
@*/
int MPI_File_get_errhandler(MPI_File mpi_fh, MPI_Errhandler *errhandler)
{
int error_code = MPI_SUCCESS;
ADIO_File fh;
static char myname[] = "MPI_FILE_GET_ERRHANDLER";
MPID_THREADPRIV_DECL;
if (mpi_fh == MPI_FILE_NULL) {
*errhandler = ADIOI_DFLT_ERR_HANDLER;
}
else {
fh = MPIO_File_resolve(mpi_fh);
/* --BEGIN ERROR HANDLING-- */
if ((fh <= (MPI_File) 0) || ((fh)->cookie != ADIOI_FILE_COOKIE))
{
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG,
"**iobadfh", 0);
error_code = MPIO_Err_return_file(MPI_FILE_NULL, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
*errhandler = fh->err_handler;
}
fn_exit:
return MPI_SUCCESS;
}
示例15: handle
/*@
MPI_File_get_view - Returns the file view
Input Parameters:
. fh - file handle (handle)
Output Parameters:
. disp - displacement (nonnegative integer)
. etype - elementary datatype (handle)
. filetype - filetype (handle)
. datarep - data representation (string)
.N fortran
@*/
int MPI_File_get_view(MPI_File fh, MPI_Offset * disp, MPI_Datatype * etype,
MPI_Datatype * filetype, char *datarep)
{
int error_code;
ADIO_File adio_fh;
static char myname[] = "MPI_FILE_GET_VIEW";
int i, j, k, combiner;
MPI_Datatype copy_etype, copy_filetype;
ROMIO_THREAD_CS_ENTER();
adio_fh = MPIO_File_resolve(fh);
/* --BEGIN ERROR HANDLING-- */
MPIO_CHECK_FILE_HANDLE(adio_fh, myname, error_code);
if (datarep == NULL) {
error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
myname, __LINE__, MPI_ERR_ARG, "**iodatarepnomem", 0);
error_code = MPIO_Err_return_file(adio_fh, error_code);
goto fn_exit;
}
/* --END ERROR HANDLING-- */
*disp = adio_fh->disp;
ADIOI_Strncpy(datarep,
(adio_fh->is_external32 ? "external32" : "native"), MPI_MAX_DATAREP_STRING);
MPI_Type_get_envelope(adio_fh->etype, &i, &j, &k, &combiner);
if (combiner == MPI_COMBINER_NAMED)
*etype = adio_fh->etype;
else {
/* FIXME: It is wrong to use MPI_Type_contiguous; the user could choose to
* re-implement MPI_Type_contiguous in an unexpected way. Either use
* MPID_Barrier as in MPICH or PMPI_Type_contiguous */
MPI_Type_contiguous(1, adio_fh->etype, ©_etype);
/* FIXME: Ditto for MPI_Type_commit - use NMPI or PMPI */
MPI_Type_commit(©_etype);
*etype = copy_etype;
}
/* FIXME: Ditto for MPI_Type_xxx - use NMPI or PMPI */
MPI_Type_get_envelope(adio_fh->filetype, &i, &j, &k, &combiner);
if (combiner == MPI_COMBINER_NAMED)
*filetype = adio_fh->filetype;
else {
MPI_Type_contiguous(1, adio_fh->filetype, ©_filetype);
MPI_Type_commit(©_filetype);
*filetype = copy_filetype;
}
fn_exit:
ROMIO_THREAD_CS_EXIT();
return MPI_SUCCESS;
}