Skip to content

Commit

Permalink
Merge pull request #621 from E3SM-Project/jayeshkrishna/fix_nc_del_ad…
Browse files Browse the repository at this point in the history
…ios_sym

Avoiding using NetCDF delete function to delete ADIOS BP
output symlinks
  • Loading branch information
jayeshkrishna authored Nov 7, 2024
2 parents e40f1cb + 3e0707c commit 9d8c58a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/clib/pio_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,11 +1161,6 @@ int PIOc_deletefile_impl(int iosysid, const char *filename)

if (!mpierr && ios->io_rank == 0)
{
#ifdef _NETCDF
ierr = nc_delete(filename);
#else /* Assume that _PNETCDF is defined. */
ierr = ncmpi_delete(filename, MPI_INFO_NULL);
#endif
#ifdef _ADIOS2
/* Append ".bp" to filename for the corresponding ADIOS BP filename */
static const char adios_bp_filename_extn[] = ".bp";
Expand All @@ -1186,6 +1181,15 @@ int PIOc_deletefile_impl(int iosysid, const char *filename)
spio_remove_directory(adios_bp_filename);
}
free(adios_bp_filename);

/* Delete the file (for ADIOS BP files, delete the symlink file) */
ierr = unlink(filename);
#elif defined(_PNETCDF)
ierr = ncmpi_delete(filename, MPI_INFO_NULL);
#elif defined(_NETCDF)
ierr = nc_delete(filename);
#else
ierr = unlink(filename);
#endif
}

Expand Down

0 comments on commit 9d8c58a

Please sign in to comment.