- the memory chunk that has to be allocated for the llapi_get_stripe function seems to have changed compared to earlier version. This implementation now follows the code snipplet from the man pages.
- implementation of file_get_size and set_size
Этот коммит содержится в:
родитель
6eba52a121
Коммит
217dcca853
@ -33,9 +33,18 @@
|
|||||||
* Returns: - Success if size is get
|
* Returns: - Success if size is get
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
mca_fs_lustre_file_get_size (mca_io_ompio_file_t *file_handle,
|
mca_fs_lustre_file_get_size (mca_io_ompio_file_t *fh,
|
||||||
OMPI_MPI_OFFSET_TYPE *size)
|
OMPI_MPI_OFFSET_TYPE *size)
|
||||||
{
|
{
|
||||||
printf ("LUSTRE GET SIZE\n");
|
*size = lseek(fh->fd, 0, SEEK_END);
|
||||||
|
if (-1 == *size) {
|
||||||
|
perror ("lseek");
|
||||||
|
return OMPI_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (-1 == (lseek(fh->fd, fh->f_offset, SEEK_SET))) {
|
||||||
|
perror ("lseek");
|
||||||
|
return OMPI_ERROR;
|
||||||
|
}
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -33,9 +33,21 @@
|
|||||||
* Returns: - Success if size is set
|
* Returns: - Success if size is set
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
mca_fs_lustre_file_set_size (mca_io_ompio_file_t *file_handle,
|
mca_fs_lustre_file_set_size (mca_io_ompio_file_t *fh,
|
||||||
OMPI_MPI_OFFSET_TYPE size)
|
OMPI_MPI_OFFSET_TYPE size)
|
||||||
{
|
{
|
||||||
printf ("LUSTRE SET SIZE\n");
|
int err = 0;
|
||||||
|
|
||||||
|
err = ftruncate(fh->fd, size);
|
||||||
|
|
||||||
|
fh->f_comm->c_coll.coll_bcast (&err,
|
||||||
|
1,
|
||||||
|
MPI_INT,
|
||||||
|
OMPIO_ROOT,
|
||||||
|
fh->f_comm,
|
||||||
|
fh->f_comm->c_coll.coll_bcast_module);
|
||||||
|
if (-1 == err) {
|
||||||
|
return OMPI_ERROR;
|
||||||
|
}
|
||||||
return OMPI_SUCCESS;
|
return OMPI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user