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
d0eef5b6
Commit
d0eef5b6
authored
11 years ago
by
Rod Schultz
Committed by
Morris Jette
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Fix merge when all steps are not profiled
Bug 366
parent
8921e78c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
+41
-26
41 additions, 26 deletions
src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
with
41 additions
and
26 deletions
src/plugins/acct_gather_profile/hdf5/sh5util/sh5util.c
+
41
−
26
View file @
d0eef5b6
...
@@ -772,31 +772,56 @@ static void _merge_step_files()
...
@@ -772,31 +772,56 @@ static void _merge_step_files()
hid_t
fid_job
=
-
1
,
jgid_step
=
-
1
,
jgid_nodes
=
-
1
,
jgid_tasks
=
-
1
;
hid_t
fid_job
=
-
1
,
jgid_step
=
-
1
,
jgid_nodes
=
-
1
,
jgid_tasks
=
-
1
;
DIR
*
dir
;
DIR
*
dir
;
struct
dirent
*
de
;
struct
dirent
*
de
;
char
jobprefix
[
MAX_PROFILE_PATH
+
1
];
char
file_name
[
MAX_PROFILE_PATH
+
1
];
char
step_node
[
MAX_PROFILE_PATH
+
1
];
char
step_dir
[
MAX_PROFILE_PATH
+
1
];
char
step_dir
[
MAX_PROFILE_PATH
+
1
];
char
step_path
[
MAX_PROFILE_PATH
+
1
];
char
step_path
[
MAX_PROFILE_PATH
+
1
];
char
jgrp_step_name
[
MAX_GROUP_NAME
+
1
];
char
jgrp_step_name
[
MAX_GROUP_NAME
+
1
];
char
jgrp_nodes_name
[
MAX_GROUP_NAME
+
1
];
char
jgrp_nodes_name
[
MAX_GROUP_NAME
+
1
];
char
jgrp_tasks_name
[
MAX_GROUP_NAME
+
1
];
char
jgrp_tasks_name
[
MAX_GROUP_NAME
+
1
];
char
*
step_node_loc
,
*
posdot
;
char
*
step_node
,
*
pos_char
,
*
stepno
;
int
stepx
=
0
,
num_steps
=
0
,
nodex
=
-
1
;
int
stepx
=
0
,
num_steps
=
0
,
nodex
=
-
1
,
max_step
=
-
1
;
bool
foundFiles
=
false
;
int
jobid
,
stepid
;
bool
found_files
=
false
;
sprintf
(
step_dir
,
"%s/%s"
,
params
.
dir
,
params
.
user
);
sprintf
(
step_dir
,
"%s/%s"
,
params
.
dir
,
params
.
user
);
while
(
nodex
!=
0
)
{
while
(
nodex
!=
0
&&
(
max_step
==-
1
||
stepx
<=
max_step
)
)
{
if
(
!
(
dir
=
opendir
(
step_dir
)))
{
if
(
!
(
dir
=
opendir
(
step_dir
)))
{
error
(
"opendir for job profile directory): %m"
);
error
(
"opendir for job profile directory): %m"
);
exit
(
1
);
exit
(
1
);
}
}
sprintf
(
jobprefix
,
"%d_%d_"
,
params
.
job_id
,
stepx
);
nodex
=
0
;
nodex
=
0
;
while
((
de
=
readdir
(
dir
)))
{
while
((
de
=
readdir
(
dir
)))
{
if
(
strncmp
(
jobprefix
,
de
->
d_name
,
strlen
(
jobprefix
)))
strcpy
(
file_name
,
de
->
d_name
);
continue
;
if
(
file_name
[
0
]
==
'.'
)
continue
;
// Not HDF5 file
pos_char
=
strstr
(
file_name
,
".h5"
);
if
(
!
pos_char
)
{
error
(
"error processing this file, %s, "
"(not .h5"
,
de
->
d_name
);
continue
;
// Not HDF5 file
}
*
pos_char
=
0
;
// truncate .hf
pos_char
=
strchr
(
file_name
,
'_'
);
if
(
!
pos_char
)
continue
;
// not right format
*
pos_char
=
0
;
// make jobid string
jobid
=
strtol
(
file_name
,
NULL
,
10
);
if
(
jobid
!=
params
.
job_id
)
continue
;
// not desired job
stepno
=
pos_char
+
1
;
pos_char
=
strchr
(
stepno
,
'_'
);
if
(
!
pos_char
)
{
continue
;
// not right format
}
*
pos_char
=
0
;
// make stepid string
stepid
=
strtol
(
pos_char
,
NULL
,
10
);
if
(
stepid
>
max_step
)
max_step
=
stepid
;
if
(
stepid
!=
stepx
)
continue
;
// Not step we are merging
step_node
=
pos_char
+
1
;
// Found a node step file for this job
// Found a node step file for this job
if
(
!
found
F
iles
)
{
if
(
!
found
_f
iles
)
{
// Need to create the job file
// Need to create the job file
fid_job
=
H5Fcreate
(
params
.
output
,
fid_job
=
H5Fcreate
(
params
.
output
,
H5F_ACC_TRUNC
,
H5F_ACC_TRUNC
,
...
@@ -807,18 +832,8 @@ static void _merge_step_files()
...
@@ -807,18 +832,8 @@ static void _merge_step_files()
"create HDF5 file:"
,
"create HDF5 file:"
,
params
.
output
);
params
.
output
);
}
}
foundFiles
=
true
;
found_files
=
true
;
}
step_node_loc
=
de
->
d_name
+
strlen
(
jobprefix
);
strcpy
(
step_node
,
step_node_loc
);
posdot
=
strchr
(
step_node
,
'.'
);
if
(
!
posdot
)
{
error
(
"error processing this file, %s, "
"no suffix"
,
de
->
d_name
);
continue
;
}
}
posdot
[
0
]
=
'\0'
;
// remove extension
if
(
nodex
==
0
)
{
if
(
nodex
==
0
)
{
num_steps
++
;
num_steps
++
;
sprintf
(
jgrp_step_name
,
"/%s_%d"
,
GRP_STEP
,
sprintf
(
jgrp_step_name
,
"/%s_%d"
,
GRP_STEP
,
...
@@ -866,10 +881,10 @@ static void _merge_step_files()
...
@@ -866,10 +881,10 @@ static void _merge_step_files()
}
}
stepx
++
;
stepx
++
;
}
}
put_int_attribute
(
fid_job
,
ATTR_NSTEPS
,
num_step
s
)
;
if
(
!
found_file
s
)
i
f
(
!
foundFiles
)
i
nfo
(
"No node-step files found for jobid=%d"
,
params
.
job_id
);
info
(
"No node-step files found for jobid=%d"
,
else
params
.
job_id
);
put_int_attribute
(
fid_job
,
ATTR_NSTEPS
,
num_steps
);
if
(
fid_job
!=
-
1
)
if
(
fid_job
!=
-
1
)
H5Fclose
(
fid_job
);
H5Fclose
(
fid_job
);
}
}
...
...
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