Class: Darshan::File

Inherits:
Object
  • Object
show all
Defined in:
ext/darshan/darshan.c

Instance Method Summary collapse

Instance Method Details

#collectiveObject

Within: Darshan::File class Returns true if the file was collectively accessed, false otherwise.



218
219
220
221
222
223
224
225
226
227
228
# File 'ext/darshan/darshan.c', line 218

static VALUE rb_darshan_file_collective(VALUE self)
{
        struct darshan_file* file = NULL;
        Data_Get_Struct(self, struct darshan_file, file);
        if(file != NULL) {
		if(file->rank == -1) return Qtrue;
		else return Qfalse;
        } else {
                return Qfalse;
        }
}

#counter(counter) ⇒ Object

Within: Darshan::File class Returns the value for a given counter, nil on failure.



156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'ext/darshan/darshan.c', line 156

static VALUE rb_darshan_file_get_counter(VALUE self, VALUE counter)
{
	int c = NUM2INT(counter);
	struct darshan_file* file = NULL;
	Data_Get_Struct(self, struct darshan_file, file);
	if(file != NULL) {
		int64_t cnt = file->counters[c];
		if(cnt == -1) return Qnil;
		else return LL2NUM(cnt);
	} else {
		return Qnil;
	}
}

#fcounter(counter) ⇒ Object

Within: Darshan::File class Returns the value for a given fconter, nil on failure.



173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'ext/darshan/darshan.c', line 173

static VALUE rb_darshan_file_get_fcounter(VALUE self, VALUE counter)
{
	int c = NUM2INT(counter);
	struct darshan_file* file = NULL;
	Data_Get_Struct(self, struct darshan_file, file);
	if(file != NULL) {
		int64_t cnt = file->fcounters[c];
		if(cnt == -1) return Qnil;
		else return LL2NUM(cnt);
	} else {
		return Qnil;
	}
}

#hashObject

Within: Darshan::File class Returns the hash of the file, or nil on failure.



190
191
192
193
194
195
196
197
198
199
# File 'ext/darshan/darshan.c', line 190

static VALUE rb_darshan_file_get_hash(VALUE self)
{
	struct darshan_file* file = NULL;
	Data_Get_Struct(self, struct darshan_file, file);
	if(file != NULL) {
		return LL2NUM(file->hash);
	} else {
		return Qnil;
	}
}

#name_suffixObject

Within: Darshan::File class Returns the suffix of the name of the file, nil on failure.



233
234
235
236
237
238
239
240
241
242
# File 'ext/darshan/darshan.c', line 233

static VALUE rb_darshan_file_get_name_suffix(VALUE self)
{
	struct darshan_file* file = NULL;
	Data_Get_Struct(self, struct darshan_file, file);
	if(file != NULL) {
		return rb_str_new2(file->name_suffix);
	} else {
		return Qnil;
	}
}

#rankObject

Within: Darshan::File class Returns the rank that produced the file, or nil on failure.



204
205
206
207
208
209
210
211
212
213
# File 'ext/darshan/darshan.c', line 204

static VALUE rb_darshan_file_get_rank(VALUE self)
{
	struct darshan_file* file = NULL;
	Data_Get_Struct(self, struct darshan_file, file);
	if(file != NULL) {
		return LL2NUM(file->rank);
	} else {
		return Qnil;
	}
}