mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
Remove unused code
This commit is contained in:
parent
439ea92d7e
commit
e7dd793f42
@ -163,121 +163,3 @@ print_version(const char *progname)
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** From h5test.c **/
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
int
|
||||
h5_set_info_object(void)
|
||||
{
|
||||
char *envp; /* environment pointer */
|
||||
int ret_value=0;
|
||||
|
||||
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
|
||||
if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
|
||||
char *next, *valp;
|
||||
|
||||
|
||||
valp = envp = next = HDstrdup(envp);
|
||||
|
||||
/* create an INFO object if not created yet */
|
||||
if (h5_io_info_g == MPI_INFO_NULL)
|
||||
MPI_Info_create(&h5_io_info_g);
|
||||
|
||||
do {
|
||||
size_t len;
|
||||
char *key_val, *endp, *namep;
|
||||
|
||||
if (*valp == ';')
|
||||
valp++;
|
||||
|
||||
/* copy key/value pair into temporary buffer */
|
||||
len = strcspn(valp, ";");
|
||||
next = &valp[len];
|
||||
key_val = calloc(1, len + 1);
|
||||
|
||||
/* increment the next pointer past the terminating semicolon */
|
||||
if (*next == ';')
|
||||
++next;
|
||||
|
||||
namep = HDstrncpy(key_val, valp, len);
|
||||
|
||||
/* pass up any beginning whitespaces */
|
||||
while (*namep && (*namep == ' ' || *namep == '\t'))
|
||||
namep++;
|
||||
|
||||
/* eat up any ending white spaces */
|
||||
endp = &namep[strlen(namep) - 1];
|
||||
|
||||
while (endp && (*endp == ' ' || *endp == '\t'))
|
||||
*endp-- = '\0';
|
||||
|
||||
/* find the '=' */
|
||||
|
||||
valp = HDstrchr(namep, '=');
|
||||
|
||||
if (valp != NULL) { /* it's a valid key/value pairing */
|
||||
char *tmp_val = valp + 1;
|
||||
|
||||
/* change '=' to \0, move valp down one */
|
||||
*valp-- = '\0';
|
||||
|
||||
/* eat up ending whitespace on the "key" part */
|
||||
while (*valp == ' ' || *valp == '\t')
|
||||
*valp-- = '\0';
|
||||
|
||||
valp = tmp_val;
|
||||
|
||||
/* eat up beginning whitespace on the "value" part */
|
||||
while (*valp == ' ' || *valp == '\t')
|
||||
*valp++ = '\0';
|
||||
|
||||
/* actually set the darned thing */
|
||||
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
|
||||
printf("MPI_Info_set failed\n");
|
||||
ret_value = -1;
|
||||
}
|
||||
}
|
||||
|
||||
valp = next;
|
||||
HDfree(key_val);
|
||||
} while (next && *next);
|
||||
|
||||
HDfree(envp);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
h5_dump_info_object(MPI_Info info)
|
||||
{
|
||||
char key[MPI_MAX_INFO_KEY+1];
|
||||
char value[MPI_MAX_INFO_VAL+1];
|
||||
int flag;
|
||||
int i, nkeys;
|
||||
|
||||
printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
|
||||
MPI_MAX_INFO_VAL);
|
||||
if (info==MPI_INFO_NULL){
|
||||
printf("object is MPI_INFO_NULL\n");
|
||||
}
|
||||
else {
|
||||
MPI_Info_get_nkeys(info, &nkeys);
|
||||
printf("object has %d items\n", nkeys);
|
||||
for (i=0; i<nkeys; i++){
|
||||
MPI_Info_get_nthkey(info, i, key);
|
||||
MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
|
||||
printf("%s=%s\n", key, value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -162,122 +162,3 @@ print_version(const char *progname)
|
||||
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** From h5test.c **/
|
||||
|
||||
#ifdef H5_HAVE_PARALLEL
|
||||
MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
int
|
||||
h5_set_info_object(void)
|
||||
{
|
||||
char *envp; /* environment pointer */
|
||||
int ret_value=0;
|
||||
|
||||
/* handle any MPI INFO hints via $HDF5_MPI_INFO */
|
||||
if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
|
||||
char *next, *valp;
|
||||
|
||||
|
||||
valp = envp = next = HDstrdup(envp);
|
||||
|
||||
/* create an INFO object if not created yet */
|
||||
if (h5_io_info_g == MPI_INFO_NULL)
|
||||
MPI_Info_create(&h5_io_info_g);
|
||||
|
||||
do {
|
||||
size_t len;
|
||||
char *key_val, *endp, *namep;
|
||||
|
||||
if (*valp == ';')
|
||||
valp++;
|
||||
|
||||
/* copy key/value pair into temporary buffer */
|
||||
len = strcspn(valp, ";");
|
||||
next = &valp[len];
|
||||
key_val = calloc(1, len + 1);
|
||||
|
||||
/* increment the next pointer past the terminating semicolon */
|
||||
if (*next == ';')
|
||||
++next;
|
||||
|
||||
namep = HDstrncpy(key_val, valp, len);
|
||||
|
||||
/* pass up any beginning whitespaces */
|
||||
while (*namep && (*namep == ' ' || *namep == '\t'))
|
||||
namep++;
|
||||
|
||||
/* eat up any ending white spaces */
|
||||
endp = &namep[strlen(namep) - 1];
|
||||
|
||||
while (endp && (*endp == ' ' || *endp == '\t'))
|
||||
*endp-- = '\0';
|
||||
|
||||
/* find the '=' */
|
||||
|
||||
valp = HDstrchr(namep, '=');
|
||||
|
||||
if (valp != NULL) { /* it's a valid key/value pairing */
|
||||
char *tmp_val = valp + 1;
|
||||
|
||||
/* change '=' to \0, move valp down one */
|
||||
*valp-- = '\0';
|
||||
|
||||
/* eat up ending whitespace on the "key" part */
|
||||
while (*valp == ' ' || *valp == '\t')
|
||||
*valp-- = '\0';
|
||||
|
||||
valp = tmp_val;
|
||||
|
||||
/* eat up beginning whitespace on the "value" part */
|
||||
while (*valp == ' ' || *valp == '\t')
|
||||
*valp++ = '\0';
|
||||
|
||||
/* actually set the darned thing */
|
||||
if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
|
||||
printf("MPI_Info_set failed\n");
|
||||
ret_value = -1;
|
||||
}
|
||||
}
|
||||
|
||||
valp = next;
|
||||
HDfree(key_val);
|
||||
} while (next && *next);
|
||||
|
||||
HDfree(envp);
|
||||
}
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
h5_dump_info_object(MPI_Info info)
|
||||
{
|
||||
char key[MPI_MAX_INFO_KEY+1];
|
||||
char value[MPI_MAX_INFO_VAL+1];
|
||||
int flag;
|
||||
int i, nkeys;
|
||||
|
||||
printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
|
||||
MPI_MAX_INFO_VAL);
|
||||
if (info==MPI_INFO_NULL){
|
||||
printf("object is MPI_INFO_NULL\n");
|
||||
}
|
||||
else {
|
||||
MPI_Info_get_nkeys(info, &nkeys);
|
||||
printf("object has %d items\n", nkeys);
|
||||
for (i=0; i<nkeys; i++){
|
||||
MPI_Info_get_nthkey(info, i, key);
|
||||
MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
|
||||
printf("%s=%s\n", key, value);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user