darshan-apmpi-logutils.c 17.8 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 45 46 47
char *apmpi_f_mpiop_totalsync_counter_names[] = {
    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 73 74
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
};

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

Sudheer Chunduri's avatar
Sudheer Chunduri committed
83
    if(fd->mod_map[APMPI_MOD].len == 0)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
        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
100
    if (fd->mod_ver[APMPI_MOD] == 0)
Sudheer Chunduri's avatar
Sudheer Chunduri committed
101 102
    {
        printf("Either unknown or debug version: %d\n",
Sudheer Chunduri's avatar
Sudheer Chunduri committed
103
               fd->mod_ver[APMPI_MOD]);
Sudheer Chunduri's avatar
Sudheer Chunduri committed
104 105 106
        return(0);
    }

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

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

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

    if (ret == rec_len)
    {
        if(fd->swap_flag)
        {
131 132 133 134 135 136 137
            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));
138
                DARSHAN_BSWAP64(&(hdr_rec->apmpi_f_variance_total_mpisynctime));
139 140 141 142
                DARSHAN_BSWAP64(&(hdr_rec->appid));
            }
            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]);
                }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
150 151 152 153
                for (i = 0; i < APMPI_F_NUM_INDICES; i++)
                {
                    DARSHAN_BSWAP64(&prf_rec->fcounters[i]);
                }
154 155 156 157 158 159 160 161 162
                for (i = 0; i < APMPI_F_SYNC_NUM_INDICES; i++)
                {
                    DARSHAN_BSWAP64(&prf_rec->fsynccounters[i]);
                }
                for (i = 0; i < APMPI_F_GLOBAL_NUM_INDICES; i++)
                {
                    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 218 219 220
    
    if (first_rec)
    {
        hdr_rec = rec;
        DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
            hdr_rec->base_rec.rank, hdr_rec->base_rec.id,
            "application_id", hdr_rec->appid, "", "", "");
        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,
            "", "", "");
221 222 223 224
        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,
            "", "", "");
225 226 227 228
        first_rec = 0;
    }
    else
    {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
229 230 231 232
        prf_rec = rec;
        
        for(i = 0; i < APMPI_NUM_INDICES; i++)
        {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
233
            DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
Sudheer Chunduri's avatar
Sudheer Chunduri committed
234 235 236 237
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
                apmpi_counter_names[i], prf_rec->counters[i],
                "", "", "");
        }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
238 239
        for(i = 0; i < APMPI_F_NUM_INDICES; i++)
        {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
240
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
Sudheer Chunduri's avatar
Sudheer Chunduri committed
241
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
242 243 244 245 246 247 248 249 250 251 252 253 254 255 256
                apmpi_f_mpiop_totaltime_counter_names[i], prf_rec->fcounters[i],
                "", "", "");
        }
        for(i = 0; i < APMPI_F_SYNC_NUM_INDICES; i++)
        {
            DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                prf_rec->base_rec.rank, prf_rec->base_rec.id,
                apmpi_f_mpiop_totalsync_counter_names[i], prf_rec->fsynccounters[i],
                "", "", "");
        }
        for(i = 0; i < APMPI_F_GLOBAL_NUM_INDICES; i++)
        {
            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
257 258
                "", "", "");
        }
259
    }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
260 261 262 263 264 265 266

    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
267 268 269
    //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
270 271 272 273 274 275 276

    return;
}

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

282 283 284
    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
285
    prf_rec2 = (struct darshan_apmpi_perf_record*) file_rec2;
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300
    
    if (hdr_rec1->magic == APMPI_MAGIC)
    {
        /* this is the header record */   
        if (!hdr_rec2) 
        {
            printf("- ");   
            DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                "appid", hdr_rec1->appid, "", "", "");
            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,
                "", "", "");
301 302 303 304
            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,
                "", "", "");
305 306 307 308 309 310 311 312 313 314 315 316
        }
        else if (!hdr_rec1)
        {
            printf("+ ");   
            DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                "appid", hdr_rec2->appid, "", "", "");
            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,
                "", "", "");
317 318 319 320
            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,
                "", "", "");
321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
        }
        else
        {   
            if (hdr_rec1->appid != hdr_rec2->appid)
            {
                printf("- ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec1->base_rec.rank, hdr_rec1->base_rec.id,
                "application_id", hdr_rec1->appid, "", "", "");

                printf("+ ");
                DARSHAN_U_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                hdr_rec2->base_rec.rank, hdr_rec2->base_rec.id,
                "application_id", hdr_rec2->appid, "", "", "");
            }
            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,
                    "", "", "");
            }
349 350 351 352 353 354 355 356 357 358 359 360 361
            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,
                    "", "", "");
            }
362 363 364 365 366 367 368 369 370 371 372 373 374 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 411 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 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
        }
    }
    else
    {   
        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],
                    "", "", "");
            }
        }
        
        for(i = 0; i < APMPI_F_NUM_INDICES; i++)
        {   
            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],
                    "", "", "");
            }
        }
        for(i = 0; i < APMPI_F_SYNC_NUM_INDICES; i++)
        {
            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_totalsync_counter_names[i], prf_rec1->fsynccounters[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_totalsync_counter_names[i], prf_rec2->fsynccounters[i],
                    "", "", "");
            }
            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,
                    apmpi_f_mpiop_totalsync_counter_names[i], prf_rec1->fsynccounters[i],
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
                    apmpi_f_mpiop_totalsync_counter_names[i], prf_rec2->fsynccounters[i],
                    "", "", "");
            }
        }
        for(i = 0; i < APMPI_F_GLOBAL_NUM_INDICES; i++)
        {
            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
498 499 500 501 502 503 504 505 506 507 508 509


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