Class: Darshan::STDIO::Record

Inherits:
Record
  • Object
show all
Defined in:
ext/darshan/stdio-module.c

Instance Attribute Summary

Attributes inherited from Record

#name

Instance Method Summary collapse

Instance Method Details

#counter(index) ⇒ Object



23
24
25
26
27
28
29
30
31
32
# File 'ext/darshan/stdio-module.c', line 23

static VALUE Darshan3rb_stdio_get_counter(VALUE self, VALUE index)
{
  struct darshan_stdio_file* c_record = NULL;
  Data_Get_Struct(self,struct darshan_stdio_file, c_record);
  int i = NUM2INT(index);
  if((i < 0) || (c_record == NULL)) return Qnil;
  if(i < STDIO_NUM_INDICES) return LL2NUM(c_record->counters[i]);
  if(i < STDIO_NUM_INDICES+STDIO_F_NUM_INDICES) return rb_float_new(c_record->fcounters[i-STDIO_NUM_INDICES]);
  else return Qnil;
}

#rankObject



15
16
17
18
19
20
21
# File 'ext/darshan/stdio-module.c', line 15

static VALUE Darshan3rb_stdio_get_rank(VALUE self)
{
  struct darshan_stdio_file* c_record = NULL;
  Data_Get_Struct(self, struct darshan_stdio_file, c_record);
  if(c_record) return LL2NUM(c_record->base_rec.rank);
  else return Qnil;
}