diff options
-rw-r--r-- | test/srb_append.c | 66 | ||||
-rw-r--r-- | test/srb_read.c | 64 | ||||
-rw-r--r-- | test/srb_write.c | 73 |
3 files changed, 178 insertions, 25 deletions
diff --git a/test/srb_append.c b/test/srb_append.c index fff7ac4..497f51b 100644 --- a/test/srb_append.c +++ b/test/srb_append.c @@ -1,3 +1,54 @@ +/* + * Copyright (C) 2000 NCSA + * All rights reserved. + * + * Programmer: Raymond Lu <slu@ncsa.uiuc.edu> + * April 14, 2000 + * + * Purpose: Test HDF-SRB if it is configured and compiled. Append an + * integer dataset to an existent HDF5 file with an integer array + * on SRB server. + * + * Usage: The HDF5 is built on the top of SRB. So you just need to + * activate a connection to SRB server by calling function + * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pcreate()). All server information is passed in through its + * parameter SRB_Info(a structure). Its fields are + * char *srbHost: SRB host address of server. If the input is + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. + * char *srbAuth: SRB Authentication-password. It is used to + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * int mode: File access mode, same definition with Unix. + * int size: File Size, only valid for HPSS, -1 is default + * + * Then you can open an HDF5 file by calling H5Fopen(). When + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. + */ #include <h5test.h> #ifndef H5_HAVE_SRB @@ -16,13 +67,14 @@ int main(void) int main(void) { - SRB_Info srb_info={ NULL, - NULL, - NULL, - 0, - 0600, - -1 - }; + SRB_Info srb_info={ NULL, /* Use the server name in ~/.srb/MdasEnv */ + NULL, /* Use the server port number in + * ~/.srb/MdasEnv */ + NULL, /* Use the password in ~/.srb/MdasAuth */ + 0, /* Using Unix storage system. */ + 0600, /* Open file for read and write for owner */ + -1 /* default */ + }; hid_t fapl =-1, file; hid_t dataspace, datatype, dataset; hsize_t dimsf[2]; diff --git a/test/srb_read.c b/test/srb_read.c index 6269243..1b4794b 100644 --- a/test/srb_read.c +++ b/test/srb_read.c @@ -1,3 +1,53 @@ +/* + * Copyright (C) 2000 NCSA + * All rights reserved. + * + * Programmer: Raymond Lu <slu@ncsa.uiuc.edu> + * April 14, 2000 + * + * Purpose: Test HDF-SRB if it is configured and compiled. Read a chunk of + * dataset of an HDF5 file with an integer array on SRB server, + * using hyperslab. + * Usage: The HDF5 is built on the top of SRB. So you just need to + * activate a connection to SRB server by calling function + * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pcreate()). All server information is passed in through its + * parameter SRB_Info(a structure). Its fields are + * char *srbHost: SRB host address of server. If the input is + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. + * char *srbAuth: SRB Authentication-password. It is used to + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * int mode: File access mode, same definition with Unix. + * int size: File Size, only valid for HPSS, -1 is default + * + * Then you can open an HDF5 file by calling H5Fopen(). When + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. + */ #include <h5test.h> #ifndef H5_HAVE_SRB @@ -40,12 +90,13 @@ int main(void) hsize_t count_out[3]; /* size of the hyperslab in memory */ hssize_t offset_out[3]; /* hyperslab offset in memory */ int i, j, k, status_n, rank; - SRB_Info srb_info={ NULL, - NULL, - NULL, - 0, - 0600, - -1 + SRB_Info srb_info={ NULL, /* Use host name in ~/.srb/.MdasEnv */ + NULL, /* Use environment variable "srbPort" */ + NULL, /* Use password in ~/.srb/.MdasEnv */ + 0, /* Use Unix storage system. */ + 0600, /* File was created for read and write for + * owner */ + -1 /* default */ }; for (j = 0; j < NX; j++) { @@ -68,7 +119,6 @@ int main(void) } fid = H5Fopen(fileName, H5F_ACC_RDONLY, fapl); - /*fid = H5Fopen(fileName, H5F_ACC_RDWR, H5P_DEFAULT);*/ if (fid < 0) { printf ("H5Fopen failed. \n"); return -1; diff --git a/test/srb_write.c b/test/srb_write.c index a3e58a5..ebc50c6 100644 --- a/test/srb_write.c +++ b/test/srb_write.c @@ -1,3 +1,54 @@ +/* + * Copyright (C) 2000 NCSA + * All rights reserved. + * + * Programmer: Raymond Lu <slu@ncsa.uiuc.edu> + * April 14, 2000 + * + * Purpose: Test HDF-SRB if it is configured and compiled. Write an HDF5 + * file with an integer array to SRB server. + * + * Usage: The HDF5 is built on the top of SRB. So you just need to + * activate a connection to SRB server by calling function + * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pcreate()). All server information is passed in through its + * parameter SRB_Info(a structure). Its fields are + * char *srbHost: SRB host address of server. If the input is + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. + * char *srbAuth: SRB Authentication-password. It is used to + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * int mode: File access mode, same definition with Unix. + * int size: File Size, only valid for HPSS, -1 is default + * + * Then you can create an HDF5 file by calling H5Fcreate(). When + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. + */ + #include <h5test.h> #ifndef H5_HAVE_SRB @@ -8,12 +59,13 @@ int main(void) } #else -#define fileName "/projects/mdas/srb/SRBVault/slu.ncsa/a.h5" +#define fileName "/projects/mdas/srb/SRBVault/slu.ncsa/a.h5" #define DATASETNAME "IntArray" #define NX 5 /* dataset dimensions */ #define NY 6 #define RANK 2 + int main(void) { hid_t fapl=-1, fid = -1; @@ -22,17 +74,16 @@ int main(void) herr_t status = 0; int data[NX][NY]; /* data to write */ int i, j; - SRB_Info srb_info={ "ghidorah.sdsc.edu", /* SRB host address of server */ + SRB_Info srb_info={ "ghidorah.sdsc.edu", /* Using SDSC SRB server, + * don't append port number. */ "5557", /* SRB host port number */ - NULL, /* SRB Authentication-password */ - 0, /* Storage Type: 0=Unix, - * 1=UniTree, - * 2=HPSS, - * 3=FTP, - * 4=HTTP */ - 0600, /* File mode-Unix access mode */ - -1 /* File Size-Only valid for HPSS, - * -1 is default. */ + NULL, /* SRB Authentication-password, + * using the one in + * ~/.srb/.MdasAuth */ + 0, /* Unix storage system. */ + 0600, /* Read and write only for + * owner */ + -1 /* -1 is default. */ }; /* |