1
1

Back out r16691 and r16693 because the meat of them are upstream

already, and we're just about to do a ROMIO version refresh -- so the
less OMPI-specific code we have (e.g., indenting and whatnot), the
better. 

Refs trac:1370.

This commit was SVN r18821.

The following SVN revision numbers were found above:
  r16691 --> open-mpi/ompi@8dca19cb3b
  r16693 --> open-mpi/ompi@037a533752

The following Trac tickets were found above:
  Ticket 1370 --> https://svn.open-mpi.org/trac/ompi/ticket/1370
Этот коммит содержится в:
Jeff Squyres 2008-07-07 22:33:49 +00:00
родитель a6cfe0c574
Коммит 09ff80ff06

Просмотреть файл

@ -172,67 +172,34 @@ MPI_File ADIO_Open(MPI_Comm orig_comm,
*/ */
/* pvfs2 handles opens specially, so it is actually more efficent for that /* pvfs2 handles opens specially, so it is actually more efficent for that
* file system if we skip this optimization */ * file system if we skip this optimization */
/* NFS handles opens especially poorly, so we cannot use this optimization if (access_mode & ADIO_CREATE && fd->file_system != ADIO_PVFS2) {
* on that FS */ if(rank == fd->hints->ranklist[0]) {
if (fd->file_system == ADIO_NFS) { /* remove delete_on_close flag if set */
/* no optimizations for NFS: */ if (access_mode & ADIO_DELETE_ON_CLOSE)
if ((access_mode & ADIO_CREATE) && (access_mode & ADIO_EXCL)) { fd->access_mode = access_mode ^ ADIO_DELETE_ON_CLOSE;
/* the open should fail if the file exists. Only *1* process should else
check this. Otherwise, if all processes try to check and the file fd->access_mode = access_mode;
does not exist, one process will create the file and others who
reach later will return error. */
if(rank == fd->hints->ranklist[0]) {
fd->access_mode = access_mode;
(*(fd->fns->ADIOI_xxx_Open))(fd, error_code);
MPI_Bcast(error_code, 1, MPI_INT, \
fd->hints->ranklist[0], fd->comm);
/* if no error, close the file and reopen normally below */
if (*error_code == MPI_SUCCESS) {
(*(fd->fns->ADIOI_xxx_Close))(fd, error_code);
}
} else {
MPI_Bcast(error_code, 1, MPI_INT,
fd->hints->ranklist[0], fd->comm);
}
if (*error_code != MPI_SUCCESS) {
goto fn_exit;
} else {
/* turn off EXCL for real open */
access_mode = access_mode ^ ADIO_EXCL;
}
}
} else {
/* the actual optimized create on one, open on all */ (*(fd->fns->ADIOI_xxx_Open))(fd, error_code);
if (access_mode & ADIO_CREATE && fd->file_system != ADIO_PVFS2) { MPI_Bcast(error_code, 1, MPI_INT, \
if(rank == fd->hints->ranklist[0]) { fd->hints->ranklist[0], fd->comm);
/* remove delete_on_close flag if set */ /* if no error, close the file and reopen normally below */
if (access_mode & ADIO_DELETE_ON_CLOSE) if (*error_code == MPI_SUCCESS)
fd->access_mode = access_mode ^ ADIO_DELETE_ON_CLOSE; (*(fd->fns->ADIOI_xxx_Close))(fd, error_code);
else
fd->access_mode = access_mode;
(*(fd->fns->ADIOI_xxx_Open))(fd, error_code); fd->access_mode = access_mode; /* back to original */
MPI_Bcast(error_code, 1, MPI_INT, \ }
fd->hints->ranklist[0], fd->comm); else MPI_Bcast(error_code, 1, MPI_INT, fd->hints->ranklist[0], fd->comm);
/* if no error, close the file and reopen normally below */
if (*error_code == MPI_SUCCESS)
(*(fd->fns->ADIOI_xxx_Close))(fd, error_code);
fd->access_mode = access_mode; /* back to original */ if (*error_code != MPI_SUCCESS) {
} goto fn_exit;
else MPI_Bcast(error_code, 1, MPI_INT, fd->hints->ranklist[0], fd->comm); }
else {
if (*error_code != MPI_SUCCESS) { /* turn off CREAT (and EXCL if set) for real multi-processor open */
goto fn_exit; access_mode ^= ADIO_CREATE;
} if (access_mode & ADIO_EXCL)
else { access_mode ^= ADIO_EXCL;
/* turn off CREAT (and EXCL if set) for real multi-processor open */ }
access_mode ^= ADIO_CREATE;
if (access_mode & ADIO_EXCL)
access_mode ^= ADIO_EXCL;
}
}
} }
/* if we are doing deferred open, non-aggregators should return now */ /* if we are doing deferred open, non-aggregators should return now */