darshan-apmpi-logutils.c 18 KB
Newer Older
Sudheer Chunduri's avatar
Sudheer Chunduri committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * Copyright (C) 2018 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

#define _GNU_SOURCE
#include "darshan-util-config.h"
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <inttypes.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>

#include "darshan-logutils.h"
#include "darshan-apmpi-log-format.h"

Sudheer Chunduri's avatar
Sudheer Chunduri committed
23 24 25
/* counter name strings for the MPI module */
//#define X(a) #a,

Sudheer Chunduri's avatar
Sudheer Chunduri committed
26 27 28
#define Y(a) #a, 
#define Z(a) #a
#define X I
29
#define V J
Sudheer Chunduri's avatar
Sudheer Chunduri committed
30
char *apmpi_counter_names[] = {
31
    APMPI_MPIOP_COUNTERS
Sudheer Chunduri's avatar
Sudheer Chunduri committed
32
};
Sudheer Chunduri's avatar
Sudheer Chunduri committed
33
#undef X
34
#undef V
35 36
#define X F_TIME
#define V F_TIME
37 38 39 40
char *apmpi_f_mpiop_totaltime_counter_names[] = {
    APMPI_F_MPIOP_TOTALTIME_COUNTERS
};
#undef X
41
#undef V
42
#define X F_SYNC
43
#define V F_SYNC
44
char *apmpi_f_mpiop_synctime_counter_names[] = {
45 46 47
    APMPI_F_MPIOP_SYNCTIME_COUNTERS
};
#undef X
48
#undef V
49 50
char *apmpi_f_mpi_global_counter_names[] = {
    APMPI_F_MPI_GLOBAL_COUNTERS
Sudheer Chunduri's avatar
Sudheer Chunduri committed
51
};
Sudheer Chunduri's avatar
Sudheer Chunduri committed
52 53 54
#undef Y
#undef Z

Sudheer Chunduri's avatar
Sudheer Chunduri committed
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
static int darshan_log_get_apmpi_rec(darshan_fd fd, void** buf_p);
static int darshan_log_put_apmpi_rec(darshan_fd fd, void* buf);
static void darshan_log_print_apmpi_rec(void *file_rec,
    char *file_name, char *mnt_pt, char *fs_type);
static void darshan_log_print_apmpi_description(int ver);
static void darshan_log_print_apmpi_rec_diff(void *file_rec1, char *file_name1,
    void *file_rec2, char *file_name2);

struct darshan_mod_logutil_funcs apmpi_logutils =
{
    .log_get_record = &darshan_log_get_apmpi_rec,
    .log_put_record = &darshan_log_put_apmpi_rec,
    .log_print_record = &darshan_log_print_apmpi_rec,
    .log_print_description = &darshan_log_print_apmpi_description,
    .log_print_diff = &darshan_log_print_apmpi_rec_diff,
    .log_agg_records = NULL
};

73

Sudheer Chunduri's avatar
Sudheer Chunduri committed
74 75
static int darshan_log_get_apmpi_rec(darshan_fd fd, void** buf_p)
{
76
    struct darshan_apmpi_header_record *hdr_rec;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
77 78 79 80 81
    struct darshan_apmpi_perf_record *prf_rec;
    int rec_len;
    char *buffer;
    int i;
    int ret = -1;
82
    static int first_rec = 1;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
83

Sudheer Chunduri's avatar
Sudheer Chunduri committed
84
    if(fd->mod_map[APMPI_MOD].len == 0)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
        return(0);

    if (!*buf_p)
    {
        /* assume this is the largest possible record size */
        buffer = malloc(sizeof(struct darshan_apmpi_perf_record));
        if (!buffer)
        {
            return(-1);
        }
    }
    else
    {
        buffer = *buf_p;
    }

Sudheer Chunduri's avatar
Sudheer Chunduri committed
101
    if (fd->mod_ver[APMPI_MOD] == 0)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
102 103
    {
        printf("Either unknown or debug version: %d\n",
Sudheer Chunduri's avatar
Sudheer Chunduri committed
104
               fd->mod_ver[APMPI_MOD]);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
105 106 107
        return(0);
    }

Sudheer Chunduri's avatar
Sudheer Chunduri committed
108 109
    if ((fd->mod_ver[APMPI_MOD] > 0) &&
        (fd->mod_ver[APMPI_MOD] < APMPI_VER))
Sudheer Chunduri's avatar
Sudheer Chunduri committed
110 111 112 113 114
    {
        /* perform conversion as needed */
    }

    /* v1, current version */
Sudheer Chunduri's avatar
Sudheer Chunduri committed
115
    if (fd->mod_ver[APMPI_MOD] == APMPI_VER)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
116
    {
117 118 119 120 121 122
        if (first_rec)
        {
            rec_len = sizeof(struct darshan_apmpi_header_record);
            first_rec = 0;
        }
        else
Sudheer Chunduri's avatar
Sudheer Chunduri committed
123 124
            rec_len = sizeof(struct darshan_apmpi_perf_record);

Sudheer Chunduri's avatar
Sudheer Chunduri committed
125
        ret = darshan_log_get_mod(fd, APMPI_MOD, buffer, rec_len);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
126 127 128 129 130 131
    }

    if (ret == rec_len)
    {
        if(fd->swap_flag)
        {
132 133 134 135 136 137 138
            if (rec_len == sizeof(struct darshan_apmpi_header_record))
            {
                hdr_rec = (struct darshan_apmpi_header_record*)buffer;
                /* swap bytes if necessary */
                DARSHAN_BSWAP64(&(hdr_rec->base_rec.id));
                DARSHAN_BSWAP64(&(hdr_rec->base_rec.rank));
                DARSHAN_BSWAP64(&(hdr_rec->apmpi_f_variance_total_mpitime));
139
                DARSHAN_BSWAP64(&(hdr_rec->apmpi_f_variance_total_mpisynctime));
140 141 142
            }
            else
            {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
143 144 145 146 147 148 149
                prf_rec = (struct darshan_apmpi_perf_record*)buffer;
                DARSHAN_BSWAP64(&(prf_rec->base_rec.id));
                DARSHAN_BSWAP64(&(prf_rec->base_rec.rank));
                for (i = 0; i < APMPI_NUM_INDICES; i++)
                {
                    DARSHAN_BSWAP64(&prf_rec->counters[i]);
                }
150
                for (i = 0; i < APMPI_F_MPIOP_TOTALTIME_NUM_INDICES; i++)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
151 152 153
                {
                    DARSHAN_BSWAP64(&prf_rec->fcounters[i]);
                }
154
                for (i = 0; i < APMPI_F_MPIOP_SYNCTIME_NUM_INDICES; i++)
155 156 157
                {
                    DARSHAN_BSWAP64(&prf_rec->fsynccounters[i]);
                }
158
                for (i = 0; i < APMPI_F_MPI_GLOBAL_NUM_INDICES; i++)
159 160 161 162
                {
                    DARSHAN_BSWAP64(&prf_rec->fglobalcounters[i]);
                }
            }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
163 164 165 166 167 168
        }
        *buf_p = buffer;
        return(1);
    }
    else if (ret < 0)
    {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
169 170
 //       *buf_p = NULL;
 //     if (buffer) free(buffer);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
171 172 173 174
        return(-1);
    }
    else
    {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
175 176
  //      *buf_p = NULL;
  //      if (buffer) free(buffer);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
177 178 179 180 181 182 183 184 185 186
        return(0);
    }
}

static int darshan_log_put_apmpi_rec(darshan_fd fd, void* buf)
{
    int ret;
    int rec_len;
    static int first_rec = 1;

187 188 189 190 191 192 193
    if (first_rec)
    {
        rec_len = sizeof(struct darshan_apmpi_header_record);
        first_rec = 0;
    }
    else
        rec_len = sizeof(struct darshan_apmpi_perf_record);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
194
    
Sudheer Chunduri's avatar
Sudheer Chunduri committed
195 196
    ret = darshan_log_put_mod(fd, APMPI_MOD, buf,
                              rec_len, APMPI_VER);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
197 198 199 200 201 202 203 204 205 206
    if(ret < 0)
        return(-1);

    return(0);
}

static void darshan_log_print_apmpi_rec(void *rec, char *file_name,
    char *mnt_pt, char *fs_type)
{
    int i;
207 208
    static int first_rec = 1;
    struct darshan_apmpi_header_record *hdr_rec;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
209
    struct darshan_apmpi_perf_record *prf_rec;
210 211 212 213 214 215 216 217
    
    if (first_rec)
    {
        hdr_rec = rec;
        DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
            hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
            "RANKS_TOTAL_MPITIME_VARIANCE", hdr_rec->apmpi_f_variance_total_mpitime,
            "", "", "");
218 219 220 221
        DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
            hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
            "RANKS_TOTAL_MPISYNCTIME_VARIANCE", hdr_rec->apmpi_f_variance_total_mpisynctime,
            "", "", "");
222 223 224 225
        first_rec = 0;
    }
    else
    {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
226
        prf_rec = rec;
227

228
        DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
229
                  prf_rec->base_rec.rank, prf_rec->base_rec.id,
230
                  "nodeid", prf_rec->node_name,
231 232
                  "", "", "");
   
Sudheer Chunduri's avatar
Sudheer Chunduri committed
233 234
        for(i = 0; i < APMPI_NUM_INDICES; i++)
        {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
235
            DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
Sudheer Chunduri's avatar
Sudheer Chunduri committed
236 237 238 239
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
                apmpi_counter_names[i], prf_rec->counters[i],
                "", "", "");
        }
240
        for(i = 0; i < APMPI_F_MPIOP_TOTALTIME_NUM_INDICES; i++)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
241
        {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
242
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
Sudheer Chunduri's avatar
Sudheer Chunduri committed
243
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
244 245 246
                apmpi_f_mpiop_totaltime_counter_names[i], prf_rec->fcounters[i],
                "", "", "");
        }
247
        for(i = 0; i < APMPI_F_MPIOP_SYNCTIME_NUM_INDICES; i++)
248 249 250
        {
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
251
                apmpi_f_mpiop_synctime_counter_names[i], prf_rec->fsynccounters[i],
252 253
                "", "", "");
        }
254
        for(i = 0; i < APMPI_F_MPI_GLOBAL_NUM_INDICES; i++)
255 256 257 258
        {
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
                apmpi_f_mpi_global_counter_names[i], prf_rec->fglobalcounters[i],
Sudheer Chunduri's avatar
Sudheer Chunduri committed
259 260
                "", "", "");
        }
261
    }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
262 263 264 265 266 267 268

    return;
}

static void darshan_log_print_apmpi_description(int ver)
{
    printf("\n# description of APMPI counters: %d\n", ver);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
269 270 271
    //printf("#     node:    node connected to this router\n");
    //printf("#     AR_RTR_x_y_INQ_PRF_INCOMING_FLIT_VC[0-7]: flits on VCz of x y tile\n");
    //printf("#     AR_RTR_x_y_INQ_PRF_ROWBUS_STALL_CNT: stalls on x y tile\n");
Sudheer Chunduri's avatar
Sudheer Chunduri committed
272 273 274 275 276 277 278

    return;
}

static void darshan_log_print_apmpi_rec_diff(void *file_rec1, char *file_name1,
    void *file_rec2, char *file_name2)
{
279 280
    struct darshan_apmpi_header_record *hdr_rec1;
    struct darshan_apmpi_header_record *hdr_rec2;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
281 282 283
    struct darshan_apmpi_perf_record   *prf_rec1;
    struct darshan_apmpi_perf_record   *prf_rec2;

284 285 286
    hdr_rec1 = (struct darshan_apmpi_header_record*) file_rec1;
    hdr_rec2 = (struct darshan_apmpi_header_record*) file_rec2;
    prf_rec1 = (struct darshan_apmpi_perf_record*) file_rec1;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
287
    prf_rec2 = (struct darshan_apmpi_perf_record*) file_rec2;
288 289 290 291 292 293 294 295 296 297 298
    
    if (hdr_rec1->magic == APMPI_MAGIC)
    {
        /* this is the header record */   
        if (!hdr_rec2) 
        {
            printf("- ");   
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                "RANKS_TOTAL_MPITIME_VARIANCE", hdr_rec1->apmpi_f_variance_total_mpitime,
                "", "", "");
299 300 301 302
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                "RANKS_TOTAL_MPISYNCTIME_VARIANCE", hdr_rec1->apmpi_f_variance_total_mpisynctime,
                "", "", "");
303 304 305 306 307 308 309 310
        }
        else if (!hdr_rec1)
        {
            printf("+ ");
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                "RANKS_TOTAL_MPITIME_VARIANCE", hdr_rec2->apmpi_f_variance_total_mpitime,
                "", "", "");
311 312 313 314
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                "RANKS_TOTAL_MPISYNCTIME_VARIANCE", hdr_rec2->apmpi_f_variance_total_mpisynctime,
                "", "", "");
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330
        }
        else
        {   
            if (hdr_rec1->apmpi_f_variance_total_mpitime != hdr_rec2->apmpi_f_variance_total_mpitime)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                    "RANKS_TOTAL_MPITIME_VARIANCE", hdr_rec1->apmpi_f_variance_total_mpitime,
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                    "RANKS_TOTAL_MPITIME_VARIANCE", hdr_rec2->apmpi_f_variance_total_mpitime,
                    "", "", "");
            }
331 332 333 334 335 336 337 338 339 340 341 342 343
            if (hdr_rec1->apmpi_f_variance_total_mpisynctime != hdr_rec2->apmpi_f_variance_total_mpisynctime)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                    "RANKS_TOTAL_MPISYNCTIME_VARIANCE", hdr_rec1->apmpi_f_variance_total_mpisynctime,
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                    "RANKS_TOTAL_MPISYNCTIME_VARIANCE", hdr_rec2->apmpi_f_variance_total_mpisynctime,
                    "", "", "");
            }
344 345 346 347
        }
    }
    else
    {   
348 349 350
        if(!prf_rec2)
        {
            printf("- ");
351
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
352
                  prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
353
                  "nodeid", prf_rec1->node_name,
354 355 356 357 358
                  "", "", "");
        }
        else if (!prf_rec1)
        {
            printf("+ ");
359
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
360
                  prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
361
                  "nodeid", prf_rec2->node_name,
362 363
                  "", "", "");
        }
364
        else if (prf_rec1->node_name != prf_rec2->node_name)
365 366
        {
            printf("- ");
367
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
368
                  prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
369
                  "nodeid", prf_rec1->node_name,
370 371
                  "", "", "");
            printf("+ ");
372
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
373
                  prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
374
                  "nodeid", prf_rec2->node_name,
375 376
                  "", "", "");
        }
377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410
        int i;
        for(i = 0; i < APMPI_NUM_INDICES; i++)
        {
            if (!prf_rec2)
            {   
                printf("- ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_counter_names[i], prf_rec1->counters[i],
                    "", "", "");
            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_counter_names[i], prf_rec2->counters[i],
                    "", "", "");
            }
            else if (prf_rec1->counters[i] != prf_rec2->counters[i])
            {
                printf("- ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_counter_names[i], prf_rec1->counters[i],
                    "", "", "");
                printf("+ ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_counter_names[i], prf_rec2->counters[i],
                    "", "", "");
            }
        }
        
411
        for(i = 0; i < APMPI_F_MPIOP_TOTALTIME_NUM_INDICES; i++)
412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
        {   
            if (!prf_rec2)
            {   
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_f_mpiop_totaltime_counter_names[i], prf_rec1->fcounters[i],
                    "", "", "");
            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_f_mpiop_totaltime_counter_names[i], prf_rec2->fcounters[i],
                    "", "", "");
            }
            else if (prf_rec1->counters[i] != prf_rec2->counters[i])
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_f_mpiop_totaltime_counter_names[i], prf_rec1->fcounters[i],
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_f_mpiop_totaltime_counter_names[i], prf_rec2->fcounters[i],
                    "", "", "");
            }
        }
443
        for(i = 0; i < APMPI_F_MPIOP_SYNCTIME_NUM_INDICES; i++)
444 445 446 447 448 449
        {
            if (!prf_rec2)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
450
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec1->fsynccounters[i],
451 452 453 454 455 456 457 458
                    "", "", "");

            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
459
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec2->fsynccounters[i],
460 461 462 463 464 465 466
                    "", "", "");
            }
            else if (prf_rec1->fsynccounters[i] != prf_rec2->fsynccounters[i])
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
467
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec1->fsynccounters[i],
468 469 470 471
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
472
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec2->fsynccounters[i],
473 474 475
                    "", "", "");
            }
        }
476
        for(i = 0; i < APMPI_F_MPI_GLOBAL_NUM_INDICES; i++)
477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508
        {
            if (!prf_rec2)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_f_mpi_global_counter_names[i], prf_rec1->fglobalcounters[i],
                    "", "", "");
            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_f_mpi_global_counter_names[i], prf_rec2->fglobalcounters[i],
                    "", "", "");
            }
            else if (prf_rec1->fglobalcounters[i] != prf_rec2->fglobalcounters[i])
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
                    apmpi_f_mpi_global_counter_names[i], prf_rec1->fglobalcounters[i],
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_f_mpi_global_counter_names[i], prf_rec2->fglobalcounters[i],
                    "", "", "");
            }
        }
    }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
509 510 511 512 513 514 515 516 517 518 519 520


    return;
}
/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 * End:
 *
 * vim: ts=8 sts=4 sw=4 expandtab
 */