Commit 6f1ee4f7 authored by Jakob Luettgau's avatar Jakob Luettgau
Browse files

Update and cleanup example notebooks (purge long outputs).

parent e894d79f
......@@ -11,7 +11,7 @@ class DarshanBaseError(Exception):
class DarshanVersionError(NotImplementedError):
Raised when using a features is used which is not provided by libdarshanutil.
Raised when using a feature which is not provided by libdarshanutil.
min_version = None
......@@ -2,15 +2,10 @@ jupyter
# altair (has svg well exposed)
# for bokeh + svg export
# but bokeh is almost as verbose to use as matplotlib
gcc -g -o program stdio_segfault.c -ldarshan-util
#include <stdio.h>
#include <stdlib.h>
#include <darshan-logutils.h>
int main(int argc, char const* argv[])
darshan_fd fd = darshan_log_open("example.darshan");
// get modules
/* * /
int count;
struct darshan_mod_info* mods = malloc(sizeof(struct darshan_mod_info));
// darshan-logutils.h:259:void darshan_log_get_modules (darshan_fd fd, struct darshan_mod_info **mods, int* count);
darshan_log_get_modules (fd, &mods, &count);
printf("get_modules(): count=%d, &mod_info=%p\n", count, &mods);
/* */
// get stdio record
void * buf = NULL; // important to initialize as NULL, as internal check relies on this!
//int mod_idx = 1; // POSIX: known for this example.darshan
int mod_idx = 7; // STDIO: known for this example.darshan
// darshan-logutils.h:260:int darshan_log_get_record (darshan_fd fd, int mod_idx, void **buf);
printf("get_record(): buf=%p\n", buf);
darshan_log_get_record(fd, mod_idx, &buf);
printf("get_record(): buf=%p\n", buf);
// get stdio record
void * buf2= NULL; // important to initialize as NULL, as internal check relies on this!
printf("get_record(): buf2=%p\n", buf2);
darshan_log_get_record(fd, mod_idx, &buf2);
printf("get_record(): buf2=%p\n", buf2);
// Darshan Base Record:
//darshan-log-format.h:101:struct darshan_base_record
//darshan-log-format.h-103- darshan_record_id id; // darshan-log-format.h:54:typedef uint64_t darshan_record_id;
//darshan-log-format.h-104- int64_t rank;
// POSIX Record
//darshan-util/ darshan_posix_file
//darshan-util/ struct darshan_base_record base_rec;
//darshan-util/ int64_t counters[64];
//darshan-util/ double fcounters[17];
//struct darshan_posix_file * rec = buf;
// STDIO Record
// darshan_stdio_file
// struct darshan_base_record base_rec;
// int64_t counters[13];
// double fcounters[15];
struct darshan_stdio_file * rec = (struct darshan_stdio_file *) buf;
printf("rec=%p\n", rec);
printf("rec->\n", rec->;
printf("rec->base_rec.rank=%d\n", rec->base_rec.rank);
return 0;
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import darshan
log = darshan.log_open("sample.darshan")
mods = darshan.log_get_modules(log)
rec2 = darshan.log_get_stdio_record(log)
rec = darshan.log_get_stdio_record(log)
#dict(zip(darshan.counter_names("STDIO"), record['counters']))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment