Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Slurm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tud-zih-energy
Slurm
Commits
dcae34e8
Commit
dcae34e8
authored
16 years ago
by
Danny Auble
Browse files
Options
Downloads
Patches
Plain Diff
updated report with start and end time header
parent
836e7ef2
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/plugin.c
+1
-0
1 addition, 0 deletions
src/common/plugin.c
src/sreport/cluster_reports.c
+63
-0
63 additions, 0 deletions
src/sreport/cluster_reports.c
with
64 additions
and
0 deletions
src/common/plugin.c
+
1
−
0
View file @
dcae34e8
...
...
@@ -207,6 +207,7 @@ plugin_load_and_link(const char *type_name, int n_syms,
file_name
=
xstrdup_printf
(
"%s/%s"
,
head
,
so_name
);
debug3
(
"Trying to load plugin %s"
,
file_name
);
if
((
stat
(
file_name
,
&
st
)
<
0
)
||
(
!
S_ISREG
(
st
.
st_mode
)))
{
debug4
(
"No Good."
);
xfree
(
file_name
);
}
else
{
plug
=
plugin_load_from_file
(
file_name
);
...
...
This diff is collapsed.
Click to expand it.
src/sreport/cluster_reports.c
+
63
−
0
View file @
dcae34e8
...
...
@@ -59,6 +59,9 @@ static int _set_cond(int *start, int argc, char *argv[],
int
i
;
int
set
=
0
;
int
end
=
0
;
time_t
my_time
=
time
(
NULL
);
struct
tm
start_tm
;
struct
tm
end_tm
;
for
(
i
=
(
*
start
);
i
<
argc
;
i
++
)
{
end
=
parse_option_end
(
argv
[
i
]);
...
...
@@ -89,6 +92,51 @@ static int _set_cond(int *start, int argc, char *argv[],
}
}
(
*
start
)
=
i
;
/* Default is going to be the last day */
if
(
!
cluster_cond
->
usage_end
)
{
if
(
!
localtime_r
(
&
my_time
,
&
end_tm
))
{
error
(
"Couldn't get localtime from end %d"
,
my_time
);
return
SLURM_ERROR
;
}
end_tm
.
tm_hour
=
0
;
cluster_cond
->
usage_end
=
mktime
(
&
end_tm
);
}
else
{
if
(
!
localtime_r
((
time_t
*
)
&
cluster_cond
->
usage_end
,
&
end_tm
))
{
error
(
"Couldn't get localtime from user end %d"
,
my_time
);
return
SLURM_ERROR
;
}
}
end_tm
.
tm_sec
=
0
;
end_tm
.
tm_min
=
0
;
end_tm
.
tm_isdst
=
-
1
;
cluster_cond
->
usage_end
=
mktime
(
&
end_tm
);
if
(
!
cluster_cond
->
usage_start
)
{
if
(
!
localtime_r
(
&
my_time
,
&
start_tm
))
{
error
(
"Couldn't get localtime from start %d"
,
my_time
);
return
SLURM_ERROR
;
}
start_tm
.
tm_hour
=
0
;
start_tm
.
tm_mday
--
;
cluster_cond
->
usage_start
=
mktime
(
&
start_tm
);
}
else
{
if
(
!
localtime_r
((
time_t
*
)
&
cluster_cond
->
usage_start
,
&
start_tm
))
{
error
(
"Couldn't get localtime from user start %d"
,
my_time
);
return
SLURM_ERROR
;
}
}
start_tm
.
tm_sec
=
0
;
start_tm
.
tm_min
=
0
;
start_tm
.
tm_isdst
=
-
1
;
cluster_cond
->
usage_start
=
mktime
(
&
start_tm
);
if
(
cluster_cond
->
usage_end
-
cluster_cond
->
usage_start
<
3600
)
cluster_cond
->
usage_end
=
cluster_cond
->
usage_start
+
3600
;
return
set
;
}
...
...
@@ -192,6 +240,21 @@ static List _get_cluster_list(int argc, char *argv[], List format_list)
_set_cond
(
&
i
,
argc
,
argv
,
cluster_cond
,
format_list
);
cluster_list
=
acct_storage_g_get_clusters
(
db_conn
,
cluster_cond
);
if
(
print_fields_have_header
)
{
char
start_char
[
20
];
char
end_char
[
20
];
cluster_cond
->
usage_end
-=
1
;
slurm_make_time_str
((
time_t
*
)
&
cluster_cond
->
usage_start
,
start_char
,
sizeof
(
start_char
));
slurm_make_time_str
((
time_t
*
)
&
cluster_cond
->
usage_end
,
end_char
,
sizeof
(
end_char
));
printf
(
"----------------------------------------"
"----------------------------------------
\n
"
);
printf
(
"
\t
Cluster Utilization Report %s - %s
\n
"
,
start_char
,
end_char
);
printf
(
"----------------------------------------"
"----------------------------------------
\n
"
);
}
destroy_acct_cluster_cond
(
cluster_cond
);
if
(
!
cluster_list
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment