- use a unique pid for each process as requested by the API
- sync the file before closing it - use plfs_access() instead of access() before closing the file
Этот коммит содержится в:
родитель
6d073a8da4
Коммит
da309ac962
@ -49,7 +49,9 @@ mca_fs_plfs_file_close (mca_io_ompio_file_t *fh)
|
||||
getcwd( wpath, sizeof(wpath) );
|
||||
sprintf( wpath,"%s/%s",wpath,fh->f_filename );
|
||||
|
||||
if(-1 == access(fh->f_filename, F_OK)) {
|
||||
plfs_ret = plfs_access(wpath, F_OK);
|
||||
if ( PLFS_SUCCESS != plfs_ret ) {
|
||||
opal_output(0, "fs_plfs_file_close: Error in plfs_access:\n%s\n", strplfserr(plfs_ret));
|
||||
return OMPI_ERROR; // file doesn't exist
|
||||
}
|
||||
|
||||
@ -66,7 +68,14 @@ mca_fs_plfs_file_close (mca_io_ompio_file_t *fh)
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
plfs_ret = plfs_close(fh->f_fs_ptr, 0, 0, amode ,NULL, &flags);
|
||||
plfs_ret = plfs_sync(fh->f_fs_ptr);
|
||||
if (PLFS_SUCCESS != plfs_ret) {
|
||||
opal_output(0, "fs_plfs_file_close: Error in plfs_sync:\n%s\n", strplfserr(plfs_ret));
|
||||
return OMPI_ERROR;
|
||||
}
|
||||
|
||||
|
||||
plfs_ret = plfs_close(fh->f_fs_ptr, fh->f_rank, 0, amode ,NULL, &flags);
|
||||
if (PLFS_SUCCESS != plfs_ret) {
|
||||
opal_output(0, "fs_plfs_file_close: Error in plfs_close:\n%s\n", strplfserr(plfs_ret));
|
||||
return OMPI_ERROR;
|
||||
|
@ -89,7 +89,7 @@ mca_fs_plfs_file_open (struct ompi_communicator_t *comm,
|
||||
if (access_mode & MPI_MODE_CREATE)
|
||||
amode = amode | O_CREAT;
|
||||
|
||||
plfs_ret = plfs_open( &pfd, wpath, amode, 0, perm, NULL );
|
||||
plfs_ret = plfs_open( &pfd, wpath, amode, fh->f_rank, perm, NULL );
|
||||
fh->f_fs_ptr = pfd;
|
||||
}
|
||||
|
||||
@ -99,7 +99,7 @@ mca_fs_plfs_file_open (struct ompi_communicator_t *comm,
|
||||
}
|
||||
|
||||
if (0 != rank) {
|
||||
plfs_ret = plfs_open( &pfd, wpath, amode, 0, perm, NULL );
|
||||
plfs_ret = plfs_open( &pfd, wpath, amode, fh->f_rank, perm, NULL );
|
||||
if (PLFS_SUCCESS != plfs_ret) {
|
||||
opal_output(0, "fs_plfs_file_open: Error in plfs_open:\n%s\n", strplfserr(plfs_ret));
|
||||
return OMPI_ERROR;
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user