GitLab maintenance scheduled for Today, 2019-12-05, from 17:00 to 18:00 CT - Services will be unavailable during this time.

darshan-hdf5-stubs.c 1.79 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
/*
 * Copyright (C) 2015 University of Chicago.
 * See COPYRIGHT notice in top-level directory.
 *
 */

/* This file contains stubs for the H5F functions intercepted by Darshan.
 * They are defined as weak symbols in order to satisfy dependencies of the
 * hdf5 wrappers in cases where hdf5 is not being used.
 */


#include "darshan-runtime-config.h"
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include "mpi.h"
#include "darshan.h"

/* hope this doesn't change any time soon */
typedef int hid_t; 
typedef int herr_t;

hid_t H5Fcreate(const char *filename, unsigned flags,
    hid_t create_plist, hid_t access_plist) __attribute__((weak));

hid_t H5Fcreate(const char *filename, unsigned flags,
    hid_t create_plist, hid_t access_plist)
{
    int rank;

    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    if(rank == 0)
    {
        fprintf(stderr, "WARNING: Darshan H5Fcreate() stub called; this is probably the result of a link-time problem.\n");
    }

    return(-1);
}

hid_t H5Fopen(const char *filename, unsigned flags,
    hid_t access_plist) __attribute__((weak));

hid_t H5Fopen(const char *filename, unsigned flags,
    hid_t access_plist)
{
    int rank;

    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    if(rank == 0)
    {
        fprintf(stderr, "WARNING: Darshan H5Fopen() stub called; this is probably the result of a link-time problem.\n");
    }

    return(-1);
}

herr_t H5Fclose(hid_t file_id) __attribute__((weak));

herr_t H5Fclose(hid_t file_id)
{
    int rank;

    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    if(rank == 0)
    {
        fprintf(stderr, "WARNING: Darshan H5Fclose() stub called; this is probably the result of a link-time problem.\n");
    }

    return(-1);
}

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