Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if HDF5 "file" is a DAOS object #2021

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
f37fe57
added check for DAOS file
brtnfld Apr 24, 2020
8f2d3d5
added check for DAOS file
brtnfld Apr 24, 2020
05ba1b9
Merge branch 'master' into DAOS
brtnfld Jul 22, 2020
32ff909
Merged from master
brtnfld Jul 22, 2020
269c306
update
brtnfld Jul 22, 2020
146ddcb
Merge branch 'master' into DAOS
brtnfld Jul 30, 2020
75954b2
Merge branch 'master' into DAOS
brtnfld Aug 6, 2020
c18aabc
Merge branch 'master' into DAOS
brtnfld Aug 31, 2020
863347d
Merge branch 'DAOS' of https://github.com/brtnfld/netcdf-c into DAOS
brtnfld Sep 9, 2020
668fc7f
Merge branch 'master' into DAOS
brtnfld Sep 9, 2020
ab7a12f
Merge branch 'DAOS' of https://github.com/brtnfld/netcdf-c into DAOS
brtnfld Sep 9, 2020
ea4cfa4
removed used of DAOS VOL APIs
brtnfld Sep 25, 2020
b5d7b3c
Merge branch 'master' into DAOS
brtnfld Sep 25, 2020
deff6a5
debugging
brtnfld Sep 28, 2020
770caff
added timers
brtnfld Dec 28, 2020
0378a7f
Merge branch 'master' into DAOS
brtnfld Jun 16, 2021
5254a8f
removed timing and debugging
brtnfld Jun 16, 2021
0bc2506
removed timing and debugging
brtnfld Jun 16, 2021
f98eb86
removed timing and debugging
brtnfld Jun 16, 2021
e768f17
ifdef around HDF5
brtnfld Jun 16, 2021
ea5fa5d
ifdef around HDF5
brtnfld Jun 16, 2021
68897c2
ifdef around HDF5
brtnfld Jun 16, 2021
d44f353
ifdef around HDF5
brtnfld Jun 16, 2021
8b99b82
Merge branch 'Unidata:main' into DAOS_sync
brtnfld Dec 21, 2021
2add09a
Merge branch 'main' into DAOS_sync
WardF May 21, 2024
787ea1f
Merge remote-tracking branch 'upstream/main' into DAOS_sync
WardF Jun 25, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions libdispatch/dinfermodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* Copyright 2018 University Corporation for Atmospheric
* Research/Unidata. See COPYRIGHT file for more info.
*/

#include "config.h"
#include <stddef.h>
#include <stdlib.h>
Expand All @@ -34,6 +33,12 @@
#ifndef nulldup
#define nulldup(x) ((x)?strdup(x):(x))
#endif
#ifndef _WIN32
#ifdef USE_HDF5
#include <unistd.h>
#include <hdf5.h>
#endif /* USE_HDF5 */
#endif /* _WIN32 */

#undef DEBUG

Expand Down Expand Up @@ -846,9 +851,48 @@ NC_infermodel(const char* path, int* omodep, int iscreate, int useparallel, void
NClist* modeargs = nclistnew();
char* sfrag = NULL;
const char* modeval = NULL;

/* Check for a DAOS container */
#ifndef _WIN32
#ifdef USE_HDF5
#if H5_VERSION_GE(1,12,0)
hid_t fapl_id;
if ((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) goto done;
H5Pset_fapl_sec2(fapl_id);

htri_t accessible;
accessible = H5Fis_accessible(path, fapl_id);
if(accessible > 0) {
int rc=0;
FILE *fp;
char *cmd;
cmd = (char*)malloc((strlen(path)+28)*sizeof(char));
strcpy(cmd, "getfattr ");
strcat(cmd, path);
strcat(cmd, " | grep -c '.daos'");

if((fp = popen(cmd, "r")) != NULL) {
fscanf(fp, "%d", &rc);
pclose(fp);
}
free(cmd);
if(rc == 1) {
/* Is a DAOS container */
model->impl = NC_FORMATX_NC4;
model->format = NC_FORMAT_NETCDF4;
if (H5Pclose(fapl_id) < 0) goto done;
goto done;
}
}
if (H5Pclose(fapl_id) < 0) goto done;
#endif
#endif
#endif


char* abspath = NULL;
NClist* tmp = NULL;

/* Phase 1:
1. convert special protocols to http|https
2. begin collecting fragments
Expand Down
Loading