.\" This manpage has been automatically generated by docbook2man
.\" from a DocBook document. This tool can be found at:
.\"
.\" Please send any bug reports, improvements, comments, patches,
.\" etc. to Steve Cheng .
.TH "GFS_PIO_SET_VIEW_INDEX" "3" "06 September 2005" "Gfarm" ""
.SH NAME
gfs_pio_set_view_index \- change file view to an individual fragment
.SH SYNOPSIS
.sp
\fB#include
.sp
char *gfs_pio_set_view_index (GFS_File \fIgf\fB, int \fIfragment_number\fB, int \fIfragment_index\fB, char *\fIhost\fB, int \fIflags\fB);
\fR
.SH "DESCRIPTION"
.PP
\fBgfs_pio_set_view_index()\fR changes the process's view of the data
in the file specified by \fIgf\fR to a file fragment with the index
\fIfragment_index\fR.
.PP
When creating a new file, it is necessary to specify the total number
of file fragments \fIfragment_number\fR. Every parallel process
should specify the same \fIfragment_number\fR for the corresponding
file. When the file exists, GFARM_FILE_DONTCARE can be
specified. If \fIfragment_number\fR is different from the total
fragment number of the existent file, it is erroneous.
.PP
\fIhost\fR is used for explicitly specifying a filesystem node. If
\fIhost\fR is NULL, appropriate filesystem node is chosen.
.PP
Values of \fIflag\fR are constructed by a bitwise-inclusive-OR of
the following list.
.TP
\fBGFARM_FILE_SEQUENTIAL\fR
File will be accessed sequentially.
.TP
\fBGFARM_FILE_REPLICATE\fR
File may be replicated to a local filesystem when accessing remotely.
This flag cannot be specified with GFARM_FILE_NOT_REPLICATE.
.TP
\fBGFARM_FILE_NOT_REPLICATE\fR
File may not be replicated to a local filesystem when accessing
remotely. This flag cannot be specified with
GFARM_FILE_REPLICATE.
.PP
By default, Gfarm files are accessed as a whole file in global file
view where each fragment can be seamlessly accessed.
.SH "RETURN VALUES"
.TP
\fBNULL\fR
The function terminated successfully.
.TP
\fBGFARM_ERR_NO_MEMORY\fR
Insufficient memory was available.
.TP
\fBGFARM_ERR_OPERATION_NOT_PERMITTED\fR
The file is not a regular fragmented file.
.TP
\fBGFARM_ERR_FRAGMENT_NUMBER_DOES_NOT_MATCH\fR
The total number of file fragments is different from the existence
one.
.TP
\fBGFARM_ERR_INVALID_ARGUMENT\fR
Invalid arguments are specified, for instance,
GFARM_FILE_DONTCARE is specified as the total number of
fragments of a newly created file.
.TP
\fBOthers\fR
An error except the above occurred. The reason is shown by its
pointed strings.
.SH "SEE ALSO"
.PP
\fBgfs_pio_create\fR(3),
\fBgfs_pio_open\fR(3),
\fBgfs_pio_set_view_local\fR(3)