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
95d07ba0
Commit
95d07ba0
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug in unpack array code
parent
dc071c20
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/common/pack.c
+7
-6
7 additions, 6 deletions
src/common/pack.c
src/common/slurm_protocol_pack.c
+6
-7
6 additions, 7 deletions
src/common/slurm_protocol_pack.c
with
13 additions
and
13 deletions
src/common/pack.c
+
7
−
6
View file @
95d07ba0
...
...
@@ -53,25 +53,26 @@ void
_pack32array
(
uint32_t
*
valp
,
uint16_t
size_val
,
void
**
bufp
,
int
*
lenp
)
{
int
i
=
0
;
uint16_t
nl
=
htons
(
size_val
);
_pack16
(
n
l
,
bufp
,
lenp
);
_pack16
(
size_va
l
,
bufp
,
lenp
);
for
(
i
=
0
;
i
<
size_val
;
i
++
)
{
_pack32
(
*
(
valp
+
i
),
bufp
,
lenp
);
}
}
/* Given a int ptr, it will pack an array of size_val
/* Given a int ptr, it will
un
pack an array of size_val
*/
void
_unpack32array
(
uint32_t
**
valp
,
uint16_t
*
size_val
,
void
**
bufp
,
int
*
lenp
)
{
int
i
=
0
;
_unpack16
(
size_val
,
bufp
,
lenp
);
valp
=
xmalloc
(
(
*
size_val
)
*
sizeof
(
uint32_t
)
);
*
valp
=
xmalloc
(
(
*
size_val
)
*
sizeof
(
uint32_t
)
);
for
(
i
=
0
;
i
<
*
size_val
;
i
++
)
{
_unpack32
(
(
*
valp
)
+
i
,
bufp
,
lenp
);
_unpack32
(
(
*
valp
)
+
i
,
bufp
,
lenp
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_protocol_pack.c
+
6
−
7
View file @
95d07ba0
...
...
@@ -113,7 +113,8 @@ int pack_msg ( slurm_msg_t const * msg , char ** buffer , uint32_t * buf_len )
case
RESPONSE_RESOURCE_ALLOCATION
:
case
RESPONSE_IMMEDIATE_RESOURCE_ALLOCATION
:
case
RESPONSE_JOB_WILL_RUN
:
pack_resource_allocation_response_msg
(
(
resource_allocation_response_msg_t
*
)
msg
->
data
,
(
void
**
)
buffer
,
buf_len
)
;
pack_resource_allocation_response_msg
(
(
resource_allocation_response_msg_t
*
)
msg
->
data
,
(
void
**
)
buffer
,
buf_len
)
;
break
;
case
REQUEST_UPDATE_JOB
:
pack_job_desc
(
(
job_desc_msg_t
*
)
msg
->
data
,
...
...
@@ -378,8 +379,8 @@ void pack_resource_allocation_response_msg ( resource_allocation_response_msg_t
pack32
(
msg
->
job_id
,
(
void
**
)
buffer
,
length
)
;
packstr
(
msg
->
node_list
,
(
void
**
)
buffer
,
length
)
;
pack16
(
msg
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
pack
int
_array
(
msg
->
cpus_per_node
,
msg
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
pack
int
_array
(
msg
->
cpu_count_reps
,
msg
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
pack
32
_array
(
msg
->
cpus_per_node
,
msg
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
pack
32
_array
(
msg
->
cpu_count_reps
,
msg
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
}
int
unpack_resource_allocation_response_msg
(
resource_allocation_response_msg_t
**
msg
,
void
**
buffer
,
int
*
length
)
...
...
@@ -389,16 +390,14 @@ int unpack_resource_allocation_response_msg ( resource_allocation_response_msg_t
/* alloc memory for structure */
tmp_ptr
=
xmalloc
(
sizeof
(
resource_allocation_response_msg_t
)
)
;
if
(
tmp_ptr
==
NULL
)
{
return
ENOMEM
;
}
/* load the data values */
unpack32
(
&
tmp_ptr
->
job_id
,
(
void
**
)
buffer
,
length
)
;
unpackstr_xmalloc
(
&
tmp_ptr
->
node_list
,
&
uint16_tmp
,
(
void
**
)
buffer
,
length
)
;
unpack16
(
&
tmp_ptr
->
num_cpu_groups
,
(
void
**
)
buffer
,
length
)
;
unpack
int
_array
(
(
uint32_t
**
)
&
(
tmp_ptr
->
cpus_per_node
),
&
uint16_tmp
,
(
void
**
)
buffer
,
length
)
;
unpack
int
_array
(
(
uint32_t
**
)
&
(
tmp_ptr
->
cpu_count_reps
),
&
uint16_tmp
,
(
void
**
)
buffer
,
length
)
;
unpack
32
_array
(
(
uint32_t
**
)
&
(
tmp_ptr
->
cpus_per_node
),
&
uint16_tmp
,
(
void
**
)
buffer
,
length
)
;
unpack
32
_array
(
(
uint32_t
**
)
&
(
tmp_ptr
->
cpu_count_reps
),
&
uint16_tmp
,
(
void
**
)
buffer
,
length
)
;
*
msg
=
tmp_ptr
;
return
0
;
}
...
...
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