Commit f5eb6224 authored by Matthieu Dorier's avatar Matthieu Dorier
Browse files

adding OST array

parent 1ce8503f
Gem::Specification.new do |s|
s.name = 'darshan-ruby'
s.version = '3.0.0'
s.date = '2016-03-31'
s.summary = "Ruby binding to Darshan version 3 and above"
s.version = '3.1.1'
s.date = '2016-10-28'
s.summary = "Ruby binding to Darshan version 3.1.1 and above"
s.description = "Ruby binding to ANL's Darshan library for HPC I/O tracing and analysis"
s.authors = ["Matthieu Dorier"]
s.email = 'mdorier@anl.gov'
......@@ -13,6 +13,7 @@ Gem::Specification.new do |s|
"ext/darshan/mpiio-module.c", "ext/darshan/mpiio-module.h",
"ext/darshan/pnetcdf-module.c", "ext/darshan/pnetcdf-module.h",
"ext/darshan/posix-module.c", "ext/darshan/posix-module.h",
"ext/darshan/lustre-module.c", "ext/darshan/lustre-module.h",
"ext/darshan/extconf.rb"]
s.require_paths = [ 'lib', 'ext' ]
s.extensions = %w[ext/darshan/extconf.rb]
......
......@@ -22,6 +22,19 @@ static VALUE Darshan3rb_lustre_get_counter(VALUE self, VALUE index)
else return Qnil;
}
static VALUE Darshan3rb_lustre_get_osts(VALUE self)
{
struct darshan_lustre_record* c_record = NULL;
Data_Get_Struct(self,struct darshan_lustre_record, c_record);
size_t num_osts = c_record->counters[LUSTRE_STRIPE_WIDTH];
VALUE res = rb_ary_new2(num_osts);
int i;
for(i=0; i<num_osts; i++) {
rb_ary_store(res,i,LL2NUM(c_record->ost_ids[i]));
}
return res;
}
void Darshan3rb_init_lustre()
{
mDarshanLustre = rb_define_module_under(mDarshan,"Lustre");
......@@ -36,6 +49,7 @@ void Darshan3rb_init_lustre()
cDarshanLustreRecord = rb_define_class_under(mDarshanLustre,"Record",cDarshanRecord);
rb_define_method(cDarshanLustreRecord,"counter",Darshan3rb_lustre_get_counter,1);
rb_define_method(cDarshanLustreRecord,"osts",Darshan3rb_lustre_get_osts,0);
}
VALUE Darshan3rb_get_lustre_record(darshan_fd fd, darshan_record_id* rec_id)
......
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