darshan-apmpi-logutils.c 19.9 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
    static int first_rec = 1;
208
    static int sync_flag;
209
    struct darshan_apmpi_header_record *hdr_rec;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
210
    struct darshan_apmpi_perf_record *prf_rec;
211 212 213 214 215 216 217 218
    
    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,
            "", "", "");
219
        if(hdr_rec->sync_flag)
220 221 222 223
        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,
            "", "", "");
224
        first_rec = 0;
225
        sync_flag = hdr_rec->sync_flag;
226 227 228
    }
    else
    {
Sudheer Chunduri's avatar
Sudheer Chunduri committed
229
        prf_rec = rec;
230

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

    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
276 277 278
    //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
279 280 281 282 283 284 285

    return;
}

static void darshan_log_print_apmpi_rec_diff(void *file_rec1, char *file_name1,
    void *file_rec2, char *file_name2)
{
286 287
    struct darshan_apmpi_header_record *hdr_rec1;
    struct darshan_apmpi_header_record *hdr_rec2;
Sudheer Chunduri's avatar
Sudheer Chunduri committed
288 289 290
    struct darshan_apmpi_perf_record   *prf_rec1;
    struct darshan_apmpi_perf_record   *prf_rec2;

291 292 293
    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
294
    prf_rec2 = (struct darshan_apmpi_perf_record*) file_rec2;
295 296 297
    static int sync_flag;
    sync_flag = hdr_rec1->sync_flag && hdr_rec2->sync_flag;

298 299 300 301 302 303 304 305 306 307
    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,
                "", "", "");
308
            if(sync_flag)
309 310 311 312
            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,
                "", "", "");
313 314 315 316 317 318 319 320
        }
        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,
                "", "", "");
321
            if(sync_flag)
322 323 324 325
            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,
                "", "", "");
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
        }
        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,
                    "", "", "");
            }
342 343
            if(sync_flag)
            {
344 345 346 347 348 349 350 351 352 353 354 355 356
            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,
                    "", "", "");
            }
357
            }
358 359 360 361
        }
    }
    else
    {   
362 363 364
        if(!prf_rec2)
        {
            printf("- ");
365
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
366
                  prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
367
                  "nodeid", prf_rec1->node_name,
368 369 370 371 372
                  "", "", "");
        }
        else if (!prf_rec1)
        {
            printf("+ ");
373
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
374
                  prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
375
                  "nodeid", prf_rec2->node_name,
376 377
                  "", "", "");
        }
378
        else if (prf_rec1->node_name != prf_rec2->node_name)
379 380
        {
            printf("- ");
381
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
382
                  prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
383
                  "nodeid", prf_rec1->node_name,
384 385
                  "", "", "");
            printf("+ ");
386
            DARSHAN_S_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
387
                  prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
388
                  "nodeid", prf_rec2->node_name,
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
        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],
                    "", "", "");
            }
        }
        
425
        for(i = 0; i < APMPI_F_MPIOP_TOTALTIME_NUM_INDICES; i++)
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
        {   
            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],
                    "", "", "");
            }
        }
457 458
        if(sync_flag)
        {
459
        for(i = 0; i < APMPI_F_MPIOP_SYNCTIME_NUM_INDICES; i++)
460 461 462 463 464 465
        {
            if (!prf_rec2)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
466
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec1->fsynccounters[i],
467 468 469 470 471 472 473 474
                    "", "", "");

            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
475
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec2->fsynccounters[i],
476 477 478 479 480 481 482
                    "", "", "");
            }
            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,
483
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec1->fsynccounters[i],
484 485 486 487
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
488
                    apmpi_f_mpiop_synctime_counter_names[i], prf_rec2->fsynccounters[i],
489 490 491
                    "", "", "");
            }
        }
492 493
        }
        //for(i = 0; i < APMPI_F_MPI_GLOBAL_NUM_INDICES; i++)
494 495 496 497 498 499
        {
            if (!prf_rec2)
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
500
                    apmpi_f_mpi_global_counter_names[0], prf_rec1->fglobalcounters[0],
501 502 503 504 505 506 507
                    "", "", "");
            }
            else if (!prf_rec1)
            {
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
508
                    apmpi_f_mpi_global_counter_names[0], prf_rec2->fglobalcounters[0],
509 510
                    "", "", "");
            }
511
            else if (prf_rec1->fglobalcounters[0] != prf_rec2->fglobalcounters[0])
512 513 514 515
            {
                printf("- ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec1->base_rec.rank, prf_rec1->base_rec.id,
516
                    apmpi_f_mpi_global_counter_names[0], prf_rec1->fglobalcounters[0],
517 518 519 520
                    "", "", "");
                printf("+ ");
                DARSHAN_F_COUNTER_PRINT(darshan_module_names[APMPI_MOD],
                    prf_rec2->base_rec.rank, prf_rec2->base_rec.id,
521
                    apmpi_f_mpi_global_counter_names[0], prf_rec2->fglobalcounters[0],
522 523
                    "", "", "");
            }
524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556
            if(sync_flag)
            {
            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[1], prf_rec1->fglobalcounters[1],
                    "", "", "");
            }
            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[1], prf_rec2->fglobalcounters[1],
                    "", "", "");
            }
            else if (prf_rec1->fglobalcounters[1] != prf_rec2->fglobalcounters[1])
            {
                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[1], prf_rec1->fglobalcounters[1],
                    "", "", "");
                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[1], prf_rec2->fglobalcounters[1],
                    "", "", "");
            }
           }
       }
557
    }
Sudheer Chunduri's avatar
Sudheer Chunduri committed
558 559 560 561 562 563 564 565 566 567 568 569


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