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
81f7ca04
Commit
81f7ca04
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Pack credential as a single array instead of as a bunch of individual
bytes in a loop (for speed).
parent
a98f7c11
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/common/slurm_protocol_pack.c
+14
-18
14 additions, 18 deletions
src/common/slurm_protocol_pack.c
with
14 additions
and
18 deletions
src/common/slurm_protocol_pack.c
+
14
−
18
View file @
81f7ca04
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include
<src/common/bitstring.h>
#include
<src/common/bitstring.h>
#include
<src/common/slurm_protocol_pack.h>
#include
<src/common/slurm_protocol_pack.h>
#include
<src/common/slurm_protocol_api.h>
#include
<src/common/slurm_protocol_api.h>
#include
<src/common/slurm_protocol_defs.h>
#include
<src/common/slurm_auth.h>
#include
<src/common/slurm_auth.h>
#include
<src/common/pack.h>
#include
<src/common/pack.h>
#include
<src/common/log.h>
#include
<src/common/log.h>
...
@@ -88,22 +89,20 @@ int size_io_stream_header (void)
...
@@ -88,22 +89,20 @@ int size_io_stream_header (void)
void
pack_io_stream_header
(
slurm_io_stream_header_t
*
msg
,
Buf
buffer
)
void
pack_io_stream_header
(
slurm_io_stream_header_t
*
msg
,
Buf
buffer
)
{
/* must match un/pack_io_stream_header and size_io_stream_header */
{
/* must match un/pack_io_stream_header and size_io_stream_header */
uint32_t
tmp
=
SLURM_SSL_SIGNATURE_LENGTH
;
assert
(
msg
!=
NULL
);
assert
(
msg
!=
NULL
);
pack16
(
msg
->
version
,
buffer
)
;
pack16
(
msg
->
version
,
buffer
)
;
packmem_array
(
msg
->
key
,
tmp
,
buffer
)
;
packmem_array
(
msg
->
key
,
(
uint32_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
pack32
(
msg
->
task_id
,
buffer
)
;
pack32
(
msg
->
task_id
,
buffer
)
;
pack16
(
msg
->
type
,
buffer
)
;
pack16
(
msg
->
type
,
buffer
)
;
}
}
int
unpack_io_stream_header
(
slurm_io_stream_header_t
*
msg
,
Buf
buffer
)
int
unpack_io_stream_header
(
slurm_io_stream_header_t
*
msg
,
Buf
buffer
)
{
/* must match un/pack_io_stream_header and size_io_stream_header */
{
/* must match un/pack_io_stream_header and size_io_stream_header */
uint32_t
tmp
=
SLURM_SSL_SIGNATURE_LENGTH
;
safe_unpack16
(
&
msg
->
version
,
buffer
)
;
safe_unpack16
(
&
msg
->
version
,
buffer
)
;
safe_unpackmem_array
(
msg
->
key
,
tmp
,
buffer
)
;
safe_unpackmem_array
(
msg
->
key
,
(
uint32_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
safe_unpack32
(
&
msg
->
task_id
,
buffer
)
;
safe_unpack32
(
&
msg
->
task_id
,
buffer
)
;
safe_unpack16
(
&
msg
->
type
,
buffer
)
;
safe_unpack16
(
&
msg
->
type
,
buffer
)
;
return
SLURM_SUCCESS
;
return
SLURM_SUCCESS
;
...
@@ -410,7 +409,7 @@ int unpack_msg ( slurm_msg_t * msg , Buf buffer )
...
@@ -410,7 +409,7 @@ int unpack_msg ( slurm_msg_t * msg , Buf buffer )
}
}
if
(
rc
)
if
(
rc
)
error
(
"Malformed RPC of type %u rec
i
eved"
,
msg
->
msg_type
);
error
(
"Malformed RPC of type %u rece
i
ved"
,
msg
->
msg_type
);
return
rc
;
return
rc
;
}
}
...
@@ -849,12 +848,11 @@ void pack_revoke_credential_msg ( revoke_credential_msg_t* msg , Buf buffer )
...
@@ -849,12 +848,11 @@ void pack_revoke_credential_msg ( revoke_credential_msg_t* msg , Buf buffer )
pack32
(
msg
->
job_id
,
buffer
)
;
pack32
(
msg
->
job_id
,
buffer
)
;
pack32
(
(
uint32_t
)
msg
->
expiration_time
,
buffer
)
;
pack32
(
(
uint32_t
)
msg
->
expiration_time
,
buffer
)
;
packmem
(
msg
->
signature
,
(
uint
16
_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
packmem
_array
(
msg
->
signature
,
(
uint
32
_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
}
}
int
unpack_revoke_credential_msg
(
revoke_credential_msg_t
**
msg
,
Buf
buffer
)
int
unpack_revoke_credential_msg
(
revoke_credential_msg_t
**
msg
,
Buf
buffer
)
{
{
uint16_t
uint16_tmp
;
revoke_credential_msg_t
*
tmp_ptr
;
revoke_credential_msg_t
*
tmp_ptr
;
/* alloc memory for structure */
/* alloc memory for structure */
...
@@ -864,7 +862,8 @@ int unpack_revoke_credential_msg ( revoke_credential_msg_t** msg , Buf buffer )
...
@@ -864,7 +862,8 @@ int unpack_revoke_credential_msg ( revoke_credential_msg_t** msg , Buf buffer )
safe_unpack32
(
&
(
tmp_ptr
->
job_id
),
buffer
)
;
safe_unpack32
(
&
(
tmp_ptr
->
job_id
),
buffer
)
;
safe_unpack32
(
(
uint32_t
*
)
&
(
tmp_ptr
->
expiration_time
),
buffer
)
;
safe_unpack32
(
(
uint32_t
*
)
&
(
tmp_ptr
->
expiration_time
),
buffer
)
;
safe_unpackmem
(
tmp_ptr
->
signature
,
&
uint16_tmp
,
buffer
)
;
safe_unpackmem_array
(
tmp_ptr
->
signature
,
(
uint32_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
return
SLURM_SUCCESS
;
return
SLURM_SUCCESS
;
...
@@ -876,21 +875,18 @@ int unpack_revoke_credential_msg ( revoke_credential_msg_t** msg , Buf buffer )
...
@@ -876,21 +875,18 @@ int unpack_revoke_credential_msg ( revoke_credential_msg_t** msg , Buf buffer )
void
pack_job_credential
(
slurm_job_credential_t
*
cred
,
Buf
buffer
)
void
pack_job_credential
(
slurm_job_credential_t
*
cred
,
Buf
buffer
)
{
{
int
i
=
0
;
assert
(
cred
!=
NULL
);
assert
(
cred
!=
NULL
);
pack32
(
cred
->
job_id
,
buffer
)
;
pack32
(
cred
->
job_id
,
buffer
)
;
pack16
(
(
uint16_t
)
cred
->
user_id
,
buffer
)
;
pack16
(
(
uint16_t
)
cred
->
user_id
,
buffer
)
;
packstr
(
cred
->
node_list
,
buffer
)
;
packstr
(
cred
->
node_list
,
buffer
)
;
pack_time
(
cred
->
expiration_time
,
buffer
)
;
pack_time
(
cred
->
expiration_time
,
buffer
)
;
for
(
i
=
0
;
i
<
sizeof
(
cred
->
signature
);
i
++
)
/* this is a fixed size array */
packmem_array
(
cred
->
signature
,
(
uint32_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
pack8
(
cred
->
signature
[
i
],
buffer
);
}
}
int
unpack_job_credential
(
slurm_job_credential_t
**
msg
,
Buf
buffer
)
int
unpack_job_credential
(
slurm_job_credential_t
**
msg
,
Buf
buffer
)
{
{
uint16_t
uint16_tmp
;
uint16_t
uint16_tmp
;
int
i
=
0
;
slurm_job_credential_t
*
tmp_ptr
;
slurm_job_credential_t
*
tmp_ptr
;
/* alloc memory for structure */
/* alloc memory for structure */
...
@@ -901,9 +897,9 @@ int unpack_job_credential( slurm_job_credential_t** msg , Buf buffer )
...
@@ -901,9 +897,9 @@ int unpack_job_credential( slurm_job_credential_t** msg , Buf buffer )
safe_unpack16
(
(
uint16_t
*
)
&
(
tmp_ptr
->
user_id
),
buffer
)
;
safe_unpack16
(
(
uint16_t
*
)
&
(
tmp_ptr
->
user_id
),
buffer
)
;
safe_unpackstr_xmalloc
(
&
(
tmp_ptr
->
node_list
),
&
uint16_tmp
,
buffer
)
;
safe_unpackstr_xmalloc
(
&
(
tmp_ptr
->
node_list
),
&
uint16_tmp
,
buffer
)
;
safe_unpack_time
(
&
(
tmp_ptr
->
expiration_time
),
buffer
)
;
safe_unpack_time
(
&
(
tmp_ptr
->
expiration_time
),
buffer
)
;
for
(
i
=
0
;
i
<
sizeof
(
tmp_ptr
->
signature
);
i
++
)
/* this is a fixed size array */
safe_unpackmem_array
(
tmp_ptr
->
signature
,
safe_unpack8
(
(
uint8_t
*
)(
tmp_ptr
->
signature
+
i
)
,
buffer
);
(
uint32_t
)
SLURM_SSL_SIGNATURE_LENGTH
,
buffer
)
;
return
SLURM_SUCCESS
;
return
SLURM_SUCCESS
;
unpack_error:
unpack_error:
...
...
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