[mpich-discuss] file open error code checking
Wei-keng Liao
wkliao at eecs.northwestern.edu
Mon Apr 7 12:53:46 CDT 2014
In my opinion, it is best to do this checking in common code, e.g. common/ad_open etc.
For those file systems that their ADIO drivers make a call to open() and set
errno correctly (following POSIX convention), this is straightforward.
But for those file systems, such as PVFS2, that do not make calls to open(),
their drivers must take care of the errno separately. Fortunately, those file
systems are rare.
I can see this checking currently is all over places. For easy software management,
it will be great if ROMIO keeps it in ad_open only (assuming all ADIO drivers first
call ad_open before their platform-specific ad_xxx_open).
Wei-keng
On Apr 7, 2014, at 9:16 AM, Rob Latham wrote:
>
>
> On 04/06/2014 12:23 PM, Wei-keng Liao wrote:
>> I can see error codes EISDIR and EEXIST are checked in ad_ufs_open.c
>> and the corresponding MPI_ERR_BAD_FILE and MPI_ERR_FILE_EXISTS are generated.
>>
>> But this update does not appear on other file systems, such as Lustre and GPFS.
>> PnetCDF needs an MPI-IO that can return the MPI_ERR_FILE_EXISTS class when the
>> MPI_MODE_EXCL mode is set and the file exist. This class will correspond to
>> NC_EEXIST in PnetCDF (when NC_NOCLOBBER is set in ncmpi_create and file exists).
>>
>
> Thanks, Wei-keng. I wonder if we can do this error code setting up in common code so all the lower-level file system drivers get it automatically?
>
> ==rob
>
>
>>
>> ad_ufs_open.c
>>
>> 94 else if(errno == EISDIR) {
>> 95 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
>> 96 MPIR_ERR_RECOVERABLE, myname,
>> 97 __LINE__, MPI_ERR_BAD_FILE,
>> 98 "**filename", 0);
>> 99 }
>> 100 else if(errno == EEXIST) {
>> 101 *error_code = MPIO_Err_create_code(MPI_SUCCESS,
>> 102 MPIR_ERR_RECOVERABLE, myname,
>> 103 __LINE__, MPI_ERR_FILE_EXISTS,
>> 104 "**fileexist", 0);
>> 105
>> 106 }
>>
>>
>> Wei-keng
>>
>> _______________________________________________
>> discuss mailing list discuss at mpich.org
>> To manage subscription options or unsubscribe:
>> https://lists.mpich.org/mailman/listinfo/discuss
>>
>
> --
> Rob Latham
> Mathematics and Computer Science Division
> Argonne National Lab, IL USA
> _______________________________________________
> discuss mailing list discuss at mpich.org
> To manage subscription options or unsubscribe:
> https://lists.mpich.org/mailman/listinfo/discuss
More information about the discuss
mailing list