[Darshan-commits] [Git][darshan/darshan][dev-stdio] update stdio module logutils to match new apis

Philip Carns xgitlab at cels.anl.gov
Fri Jun 24 11:44:55 CDT 2016


Philip Carns pushed to branch dev-stdio at darshan / darshan


Commits:
af5dfe77 by Phil Carns at 2016-06-24T12:44:27-04:00
update stdio module logutils to match new apis

- - - - -


1 changed file:

- darshan-util/darshan-stdio-logutils.c


Changes:

=====================================
darshan-util/darshan-stdio-logutils.c
=====================================
--- a/darshan-util/darshan-stdio-logutils.c
+++ b/darshan-util/darshan-stdio-logutils.c
@@ -32,8 +32,7 @@ char *stdio_f_counter_names[] = {
 #undef X
 
 /* prototypes for each of the STDIO module's logutil functions */
-static int darshan_log_get_stdio_record(darshan_fd fd, void* stdio_buf,
-    darshan_record_id* rec_id);
+static int darshan_log_get_stdio_record(darshan_fd fd, void* stdio_buf);
 static int darshan_log_put_stdio_record(darshan_fd fd, void* stdio_buf, int ver);
 static void darshan_log_print_stdio_record(void *file_rec,
     char *file_name, char *mnt_pt, char *fs_type, int ver);
@@ -55,41 +54,37 @@ struct darshan_mod_logutil_funcs stdio_logutils =
 };
 
 /* retrieve a STDIO record from log file descriptor 'fd', storing the
- * buffer in 'stdio_buf' and the corresponding Darshan record id in
- * 'rec_id'. Return 1 on successful record read, 0 on no more data,
- * and -1 on error.
+ * buffer in 'stdio_buf'. Return 1 on successful record read, 0 on no 
+ * more data, and -1 on error.
  */
-static int darshan_log_get_stdio_record(darshan_fd fd, void* stdio_buf, 
-    darshan_record_id* rec_id)
+static int darshan_log_get_stdio_record(darshan_fd fd, void* stdio_buf)
 {
-    struct darshan_stdio_record *rec;
+    struct darshan_stdio_file *file;
     int i;
     int ret;
 
     /* read a STDIO module record from the darshan log file */
-    ret = darshan_log_getmod(fd, DARSHAN_STDIO_MOD, stdio_buf,
-        sizeof(struct darshan_stdio_record));
+    ret = darshan_log_get_mod(fd, DARSHAN_STDIO_MOD, stdio_buf,
+        sizeof(struct darshan_stdio_file));
     if(ret < 0)
         return(-1);
-    else if(ret < sizeof(struct darshan_stdio_record))
+    else if(ret < sizeof(struct darshan_stdio_file))
         return(0);
     else
     {
         /* if the read was successful, do any necessary byte-swapping */
-        rec = (struct darshan_stdio_record *)stdio_buf;
+        file = (struct darshan_stdio_file *)stdio_buf;
         if(fd->swap_flag)
         {
             /* swap bytes if necessary */
-            DARSHAN_BSWAP64(&rec->f_id);
-            DARSHAN_BSWAP64(&rec->rank);
+            DARSHAN_BSWAP64(&file->base_rec.id);
+            DARSHAN_BSWAP64(&file->base_rec.rank);
             for(i=0; i<STDIO_NUM_INDICES; i++)
-                DARSHAN_BSWAP64(&rec->counters[i]);
+                DARSHAN_BSWAP64(&file->counters[i]);
             for(i=0; i<STDIO_F_NUM_INDICES; i++)
-                DARSHAN_BSWAP64(&rec->fcounters[i]);
+                DARSHAN_BSWAP64(&file->fcounters[i]);
         }
 
-        /* set the output record id */
-        *rec_id = rec->f_id;
         return(1);
     }
 }
@@ -99,12 +94,12 @@ static int darshan_log_get_stdio_record(darshan_fd fd, void* stdio_buf,
  */
 static int darshan_log_put_stdio_record(darshan_fd fd, void* stdio_buf, int ver)
 {
-    struct darshan_stdio_record *rec = (struct darshan_stdio_record *)stdio_buf;
+    struct darshan_stdio_file *rec = (struct darshan_stdio_file *)stdio_buf;
     int ret;
 
     /* append STDIO record to darshan log file */
-    ret = darshan_log_putmod(fd, DARSHAN_STDIO_MOD, rec,
-        sizeof(struct darshan_stdio_record), ver);
+    ret = darshan_log_put_mod(fd, DARSHAN_STDIO_MOD, rec,
+        sizeof(struct darshan_stdio_file), ver);
     if(ret < 0)
         return(-1);
 
@@ -116,15 +111,15 @@ static void darshan_log_print_stdio_record(void *file_rec, char *file_name,
     char *mnt_pt, char *fs_type, int ver)
 {
     int i;
-    struct darshan_stdio_record *stdio_rec =
-        (struct darshan_stdio_record *)file_rec;
+    struct darshan_stdio_file *stdio_rec =
+        (struct darshan_stdio_file *)file_rec;
 
     /* print each of the integer and floating point counters for the STDIO module */
     for(i=0; i<STDIO_NUM_INDICES; i++)
     {
         /* macro defined in darshan-logutils.h */
         DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-            stdio_rec->rank, stdio_rec->f_id, stdio_counter_names[i],
+            stdio_rec->base_rec.rank, stdio_rec->base_rec.id, stdio_counter_names[i],
             stdio_rec->counters[i], file_name, mnt_pt, fs_type);
     }
 
@@ -132,7 +127,7 @@ static void darshan_log_print_stdio_record(void *file_rec, char *file_name,
     {
         /* macro defined in darshan-logutils.h */
         DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-            stdio_rec->rank, stdio_rec->f_id, stdio_f_counter_names[i],
+            stdio_rec->base_rec.rank, stdio_rec->base_rec.id, stdio_f_counter_names[i],
             stdio_rec->fcounters[i], file_name, mnt_pt, fs_type);
     }
 
@@ -156,8 +151,8 @@ static void darshan_log_print_stdio_description()
 static void darshan_log_print_stdio_record_diff(void *file_rec1, char *file_name1,
     void *file_rec2, char *file_name2)
 {
-    struct darshan_stdio_record *file1 = (struct darshan_stdio_record *)file_rec1;
-    struct darshan_stdio_record *file2 = (struct darshan_stdio_record *)file_rec2;
+    struct darshan_stdio_file *file1 = (struct darshan_stdio_file *)file_rec1;
+    struct darshan_stdio_file *file2 = (struct darshan_stdio_file *)file_rec2;
     int i;
 
     /* NOTE: we assume that both input records are the same module format version */
@@ -168,7 +163,7 @@ static void darshan_log_print_stdio_record_diff(void *file_rec1, char *file_name
         {
             printf("- ");
             DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file1->rank, file1->f_id, stdio_counter_names[i],
+                file1->base_rec.rank, file1->base_rec.id, stdio_counter_names[i],
                 file1->counters[i], file_name1, "", "");
 
         }
@@ -176,18 +171,18 @@ static void darshan_log_print_stdio_record_diff(void *file_rec1, char *file_name
         {
             printf("+ ");
             DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file2->rank, file2->f_id, stdio_counter_names[i],
+                file2->base_rec.rank, file2->base_rec.id, stdio_counter_names[i],
                 file2->counters[i], file_name2, "", "");
         }
         else if(file1->counters[i] != file2->counters[i])
         {
             printf("- ");
             DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file1->rank, file1->f_id, stdio_counter_names[i],
+                file1->base_rec.rank, file1->base_rec.id, stdio_counter_names[i],
                 file1->counters[i], file_name1, "", "");
             printf("+ ");
             DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file2->rank, file2->f_id, stdio_counter_names[i],
+                file2->base_rec.rank, file2->base_rec.id, stdio_counter_names[i],
                 file2->counters[i], file_name2, "", "");
         }
     }
@@ -198,7 +193,7 @@ static void darshan_log_print_stdio_record_diff(void *file_rec1, char *file_name
         {
             printf("- ");
             DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file1->rank, file1->f_id, stdio_f_counter_names[i],
+                file1->base_rec.rank, file1->base_rec.id, stdio_f_counter_names[i],
                 file1->fcounters[i], file_name1, "", "");
 
         }
@@ -206,18 +201,18 @@ static void darshan_log_print_stdio_record_diff(void *file_rec1, char *file_name
         {
             printf("+ ");
             DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file2->rank, file2->f_id, stdio_f_counter_names[i],
+                file2->base_rec.rank, file2->base_rec.id, stdio_f_counter_names[i],
                 file2->fcounters[i], file_name2, "", "");
         }
         else if(file1->fcounters[i] != file2->fcounters[i])
         {
             printf("- ");
             DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file1->rank, file1->f_id, stdio_f_counter_names[i],
+                file1->base_rec.rank, file1->base_rec.id, stdio_f_counter_names[i],
                 file1->fcounters[i], file_name1, "", "");
             printf("+ ");
             DARSHAN_F_COUNTER_PRINT(darshan_module_names[DARSHAN_STDIO_MOD],
-                file2->rank, file2->f_id, stdio_f_counter_names[i],
+                file2->base_rec.rank, file2->base_rec.id, stdio_f_counter_names[i],
                 file2->fcounters[i], file_name2, "", "");
         }
     }



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/commit/af5dfe776eb68599211b1b8f5f21f7c840e27cc1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20160624/27162300/attachment-0001.html>


More information about the Darshan-commits mailing list