[Darshan-commits] [Git][darshan/darshan][master] slightly improved lustre OST diffing

Shane Snyder xgitlab at cels.anl.gov
Tue Sep 20 17:50:59 CDT 2016


Shane Snyder pushed to branch master at darshan / darshan


Commits:
5a3d1bdc by Shane Snyder at 2016-09-20T17:40:37-05:00
slightly improved lustre OST diffing

- - - - -


1 changed file:

- darshan-util/darshan-lustre-logutils.c


Changes:

=====================================
darshan-util/darshan-lustre-logutils.c
=====================================
--- a/darshan-util/darshan-lustre-logutils.c
+++ b/darshan-util/darshan-lustre-logutils.c
@@ -212,34 +212,62 @@ static void darshan_log_print_lustre_record_diff(void *rec1, char *file_name1,
         }
     }
 
-    /* would it be more or less useful to sort the OST IDs before comparing? */
-    if ( lustre_rec1->counters[LUSTRE_STRIPE_WIDTH] == lustre_rec2->counters[LUSTRE_STRIPE_WIDTH] ) {
-        for (i = 0; i < lustre_rec1->counters[LUSTRE_STRIPE_WIDTH]; i++ )
+    /* TODO: would it be more or less useful to sort the OST IDs before comparing? */
+    i = 0;
+    while (1)
+    {
+        char strbuf[25];
+        snprintf( strbuf, 25, "LUSTRE_OST_ID_%d", i );
+        if (!lustre_rec2 || (i >= lustre_rec2->counters[LUSTRE_STRIPE_WIDTH]))
+        {
+            printf("- ");
+            DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
+                lustre_rec1->base_rec.rank,
+                lustre_rec1->base_rec.id,
+                strbuf,
+                lustre_rec1->ost_ids[i],
+                file_name1,
+                "",
+                "");
+        }
+        else if (!lustre_rec1 || (i >= lustre_rec1->counters[LUSTRE_STRIPE_WIDTH]))
+        {
+            printf("+ ");
+            DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
+                lustre_rec2->base_rec.rank,
+                lustre_rec2->base_rec.id,
+                strbuf,
+                lustre_rec2->ost_ids[i],
+                file_name2,
+                "",
+                "");
+        }
+        else if (lustre_rec1->ost_ids[i] != lustre_rec2->ost_ids[i])
         {
-            if (lustre_rec1->ost_ids[i] != lustre_rec2->ost_ids[i])
-            {
-                char strbuf[25];
-                snprintf( strbuf, 25, "LUSTRE_OST_ID_%d", i );
-                printf("- ");
-                DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
-                    lustre_rec1->base_rec.rank,
-                    lustre_rec1->base_rec.id,
-                    strbuf,
-                    lustre_rec1->ost_ids[i],
-                    file_name1,
-                    "",
-                    "");
-                printf("+ ");
-                DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
-                    lustre_rec2->base_rec.rank,
-                    lustre_rec2->base_rec.id,
-                    strbuf,
-                    lustre_rec2->ost_ids[i],
-                    file_name2,
-                    "",
-                    "");
-            }
+            printf("- ");
+            DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
+                lustre_rec1->base_rec.rank,
+                lustre_rec1->base_rec.id,
+                strbuf,
+                lustre_rec1->ost_ids[i],
+                file_name1,
+                "",
+                "");
+            printf("+ ");
+            DARSHAN_COUNTER_PRINT(darshan_module_names[DARSHAN_LUSTRE_MOD],
+                lustre_rec2->base_rec.rank,
+                lustre_rec2->base_rec.id,
+                strbuf,
+                lustre_rec2->ost_ids[i],
+                file_name2,
+                "",
+                "");
         }
+
+        i++;
+        if ((!lustre_rec1 || (i >= lustre_rec1->counters[LUSTRE_STRIPE_WIDTH])) &&
+            (!lustre_rec2 || (i >= lustre_rec2->counters[LUSTRE_STRIPE_WIDTH])))
+            break;
     }
 
     return;



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


More information about the Darshan-commits mailing list