[mpich-discuss] error class MPI_ERR_NO_SUCH_FILE thrown by MPI_File_delete

Wei-keng Liao wkliao at eecs.northwestern.edu
Sat Apr 5 15:13:02 CDT 2014


Sorry, the code should check errno instead of err.

 19     err = unlink(filename);
        if (err == -1) {
            int err_class = MPI_ERR_IO;
            if (errno == ENOENT)
                err_class = MPI_ERR_NO_SUCH_FILE;

            *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
                                               myname, __LINE__, err_class, "**io",
                                               "**io %s", strerror(errno));
            return;
        }

Wei-keng

On Apr 5, 2014, at 2:48 PM, Wei-keng Liao wrote:

> In MPI-2 standard has the sentence below for MPI_File_delete.
> "If the file does not exist, MPI_FILE_DELETE raises an error in the class MPI_ERR_NO_SUCH_FILE."
> 
> But in src/mpi/romio/adio/common/ad_delete.c, the return code of unlink() is not checked
> for this error (only MPI_ERR_IO class is thrown.) May I suggest to add a check, so the
> MPI_ERR_NO_SUCH_FILE class can reported.
> 
>  19     err = unlink(filename);
>         if (err == ENOENT) {
>             *error_code = MPIO_Err_create_code(MPI_SUCCESS, MPIR_ERR_RECOVERABLE,
>                                                myname, __LINE__, MPI_ERR_NO_SUCH_FILE, "**io",
>                                                "**io %s", strerror(errno));
>             return;
>         }
>         else if (err == -1) {
>         ...
> 
> Wei-keng
> 
> _______________________________________________
> 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