Class: Darshan::LogFile
- Inherits:
-
Object
- Object
- Darshan::LogFile
- Defined in:
- lib/darshan.rb,
ext/darshan/darshan.c
Overview
#
LogFile class, represents a binary log file (compressed). Open it by using logfile = LogFile.open(“filename”) … logfile.close or LogFile.open(“filename”) do | logfile | … end
#
Instance Attribute Summary collapse
-
#end_time ⇒ Object
readonly
Returns the value of attribute end_time.
-
#exe ⇒ Object
readonly
Returns the value of attribute exe.
-
#job_id ⇒ Object
readonly
Returns the value of attribute job_id.
-
#magic_number ⇒ Object
readonly
Returns the value of attribute magic_number.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#mount_points ⇒ Object
readonly
Returns the value of attribute mount_points.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#start_time ⇒ Object
readonly
Returns the value of attribute start_time.
-
#uid ⇒ Object
readonly
Returns the value of attribute uid.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
.open(filename, mode = "r") ⇒ Object
# Opens a logfile, calls the given block if present.
Instance Method Summary collapse
-
#close ⇒ Object
# Close the file.
-
#each_file ⇒ Object
# Iterates through all the file entries described in the log file.
-
#next_file ⇒ Object
Within: Darshan::LogFile class Returns the next Darshan::File entry from the log file, or nil if there is no more such an entry.
Instance Attribute Details
#end_time ⇒ Object (readonly)
Returns the value of attribute end_time.
47 48 49 |
# File 'lib/darshan.rb', line 47 def end_time @end_time end |
#exe ⇒ Object (readonly)
Returns the value of attribute exe.
43 44 45 |
# File 'lib/darshan.rb', line 43 def exe @exe end |
#job_id ⇒ Object (readonly)
Returns the value of attribute job_id.
48 49 50 |
# File 'lib/darshan.rb', line 48 def job_id @job_id end |
#magic_number ⇒ Object (readonly)
Returns the value of attribute magic_number.
44 45 46 |
# File 'lib/darshan.rb', line 44 def magic_number @magic_number end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
50 51 52 |
# File 'lib/darshan.rb', line 50 def @metadata end |
#mount_points ⇒ Object (readonly)
Returns the value of attribute mount_points.
51 52 53 |
# File 'lib/darshan.rb', line 51 def mount_points @mount_points end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
41 42 43 |
# File 'lib/darshan.rb', line 41 def name @name end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
49 50 51 |
# File 'lib/darshan.rb', line 49 def size @size end |
#start_time ⇒ Object (readonly)
Returns the value of attribute start_time.
46 47 48 |
# File 'lib/darshan.rb', line 46 def start_time @start_time end |
#uid ⇒ Object (readonly)
Returns the value of attribute uid.
45 46 47 |
# File 'lib/darshan.rb', line 45 def uid @uid end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
42 43 44 |
# File 'lib/darshan.rb', line 42 def version @version end |
Class Method Details
Instance Method Details
#close ⇒ Object
#
Close the file.
#
69 70 71 |
# File 'lib/darshan.rb', line 69 def close Darshan.close(self) end |
#each_file ⇒ Object
#
Iterates through all the file entries described in the log file.
#
77 78 79 80 81 82 83 84 85 86 |
# File 'lib/darshan.rb', line 77 def each_file if not block_given? return nil end file = nil while((file = next_file()) != nil) yield file end return nil end |
#next_file ⇒ Object
Within: Darshan::LogFile class Returns the next Darshan::File entry from the log file, or nil if there is no more such an entry.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
# File 'ext/darshan/darshan.c', line 133
static VALUE rb_darshan_next_file(VALUE self)
{
darshan_fd fd = NULL;
Data_Get_Struct(self,struct darshan_fd_s, fd);
if(fd == NULL) return Qnil;
struct darshan_file* file = NULL;
VALUE rb_file = Data_Make_Struct(cDarshanFile,
struct darshan_file,
NULL, free, file);
Data_Get_Struct(rb_file, struct darshan_file, file);
if(file == NULL) return Qnil;
// if Darshan starts using the 2nd argument of
// log_getfile, we'll have a problem
if(darshan_log_getfile(fd, NULL, file) != 1) {
return Qnil;
}
return rb_file;
}
|