summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMuqun Yang <myang6@hdfgroup.org>2021-10-28 17:29:39 (GMT)
committerMuqun Yang <myang6@hdfgroup.org>2021-10-28 17:29:39 (GMT)
commit7a527aac5a69449a185cdd40de43b82723cc3fbb (patch)
treebaa263666a0de357299eb9ec0bbdc99c3a46bd8d
parente52f6fdb1322a1b770eac4297ce7d0dd01e1da73 (diff)
downloadhdf5-7a527aac5a69449a185cdd40de43b82723cc3fbb.zip
hdf5-7a527aac5a69449a185cdd40de43b82723cc3fbb.tar.gz
hdf5-7a527aac5a69449a185cdd40de43b82723cc3fbb.tar.bz2
Modify comments.
-rw-r--r--src/H5FDvfd_swmr_private.h2
-rw-r--r--src/H5Fpkg.h20
-rw-r--r--src/H5Fvfd_swmr.c7
-rw-r--r--test/vfd_swmr_log_writer.c8
4 files changed, 23 insertions, 14 deletions
diff --git a/src/H5FDvfd_swmr_private.h b/src/H5FDvfd_swmr_private.h
index a2c29cd..d0e2380 100644
--- a/src/H5FDvfd_swmr_private.h
+++ b/src/H5FDvfd_swmr_private.h
@@ -88,7 +88,7 @@ H5_DLL herr_t H5F_dump_eot_queue(void);
/* Log Macros and Functions */
/***************************************/
-/* VFD SWMR Helper macros to calcuate the elapsed time */
+/* VFD SWMR Helper macro to calcuate the elapsed time */
/* The total time is in seconds */
#define TOTAL_TIME_PASSED(X, Y) \
((double)((Y.tv_sec - X.tv_sec) * 1000000000 + (Y.tv_nsec - X.tv_nsec))) / 1000000000.0
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 578c6ab..7bb5e45 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -468,11 +468,17 @@ struct H5F_shared_t {
H5F_fs_state_t fs_state_md; /* State of the free space
* manager
*/
-
- FILE * vfd_swmr_log_file_ptr;
- hbool_t vfd_swmr_log_on;
- struct timespec vfd_swmr_log_start_time;
-
+ /* Log file for VFD SWMR */
+ FILE * vfd_swmr_log_file_ptr; /* File pointer for the
+ * log file.
+ */
+ hbool_t vfd_swmr_log_on; /* flag to indicate if
+ * the log file is
+ * created. */
+ struct timespec vfd_swmr_log_start_time; /* The starting time for
+ * calculating the time
+ * stamp of a log message.
+ */
/* Delayed free space release doubly linked list */
shadow_defree_queue_t shadow_defrees;
@@ -614,10 +620,10 @@ H5_DLL herr_t H5F__reparse_file_lock_variable_test(void);
/* VFD SMWR LOG REPORTING MACROS */
-/* H5F_POST_VFD_SWMR_LOG_ENTRY is the macro that needs to be used by the developers.
+/* H5F_POST_VFD_SWMR_LOG_ENTRY is the macro that can help the developers debug VFD SWMR features.
* It calls an internal reporting function H5F_post_vfd_swmr_log_entry() that receives
* the log entry_type_code, which generates the log tag, and the message log_info, which
- * the library developer wants to save into the log file.
+ * the developers want to save into the log file.
*
* The macro H5F_POST_VFD_SWMR_LOG_ENTRY_RELEASE(f, c, number_entry_production, m) is
* called by H5F_POST_VFD_SWMR_LOG_ENTRY when the HDF5 library is built with the
diff --git a/src/H5Fvfd_swmr.c b/src/H5Fvfd_swmr.c
index 12c8905..c3ecae3 100644
--- a/src/H5Fvfd_swmr.c
+++ b/src/H5Fvfd_swmr.c
@@ -355,7 +355,10 @@ H5F_vfd_swmr_close_or_flush(H5F_t *f, hbool_t closing)
#endif
done:
- /* Kent: close the VFD SWMR log file if it is turned on */
+ /* Kent: close the VFD SWMR log file if it is turned on.
+ * Please REVIEW to ensure this is the right place to
+ * close the log file.
+ */
if (shared->vfd_swmr_log_on) {
HDfclose(shared->vfd_swmr_log_file_ptr);
}
@@ -1977,7 +1980,7 @@ H5F_post_vfd_swmr_log_entry(H5F_t *f, int entry_type_code, char *log_info)
/* Obtain the current time.
If failed, write an error message to the log file.
else calcluate the elapsed time in seconds since the log file
- was created and wirte the time to the log file. */
+ was created and write the time to the log file. */
if (HDclock_gettime(CLOCK_MONOTONIC, &current_time) < 0) {
gettime_error = HDmalloc(14);
HDsprintf(gettime_error, "gettime_error");
diff --git a/test/vfd_swmr_log_writer.c b/test/vfd_swmr_log_writer.c
index 95f89f0..06b5654 100644
--- a/test/vfd_swmr_log_writer.c
+++ b/test/vfd_swmr_log_writer.c
@@ -21,12 +21,12 @@
* one just needs to do te following:
* After compiling the program, just run the following line
* ./vfd_swmr_log_writer -n 100000 -P -q
- * A VFD SWMR log file log-test is generated.
- * The log-test should include something like:
+ * A VFD SWMR log file "log-test" is generated.
+ * The "log-test" should include something like:
* 'EOT_PROCESSING_TIME : 0.040 s: Writer time is 1 milliseconds'
* This program also checks the performance of group creations for VFD SWMR.
* Currently the group creation time, H5Fopen and H5Fclose time are measured.
- * The output can help check the contents in the log-test.
+ * The standard output can help check the contents in the "log-test".
*
*/
#define H5F_FRIEND /*suppress error about including H5Fpkg */
@@ -93,7 +93,7 @@ static void
usage(const char *progname)
{
fprintf(stderr,
- "usage: ./%s -P -n 1000 -N 5 -q (create 1000 groups, each group has 5 attributes)\n"
+ "usage: ./%s -P -n 100000 -q (create 100000 groups, each group has 1 attribute)\n"
"Options: \n"
" [-P] [-S] [-G] [-t tick_len] [-m max_lag][-B pbs] [-s ps]\n"
" [-n ngroups] [-l ng_levels] [-O grp_op_pattern]\n"