summaryrefslogtreecommitdiffstats
path: root/test/srb_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/srb_read.c')
-rw-r--r--test/srb_read.c64
1 files changed, 57 insertions, 7 deletions
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;