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
5fa17f37
Commit
5fa17f37
authored
22 years ago
by
Moe Jette
Browse files
Options
Downloads
Patches
Plain Diff
Better descript size of I/O buffer header using #define.
parent
11fef176
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/common/slurm_protocol_defs.h
+3
-0
3 additions, 0 deletions
src/common/slurm_protocol_defs.h
src/common/slurm_protocol_pack.c
+2
-0
2 additions, 0 deletions
src/common/slurm_protocol_pack.c
src/srun/io.c
+3
-4
3 additions, 4 deletions
src/srun/io.c
with
8 additions
and
4 deletions
src/common/slurm_protocol_defs.h
+
3
−
0
View file @
5fa17f37
...
@@ -194,6 +194,9 @@ typedef struct slurm_protocol_header {
...
@@ -194,6 +194,9 @@ typedef struct slurm_protocol_header {
uint32_t
body_length
;
uint32_t
body_length
;
}
header_t
;
}
header_t
;
/* SLURM_IO_HEADER_SIZE is the packed data structure size, *\
\* not necessarily sizeof(slurm_io_stream_header_t) */
#define SLURM_IO_HEADER_SIZE (SLURM_SSL_SIGNATURE_LENGTH + 8)
typedef
struct
slurm_io_stream_header
{
typedef
struct
slurm_io_stream_header
{
uint16_t
version
;
/*version/magic number */
uint16_t
version
;
/*version/magic number */
char
key
[
SLURM_SSL_SIGNATURE_LENGTH
];
char
key
[
SLURM_SSL_SIGNATURE_LENGTH
];
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_protocol_pack.c
+
2
−
0
View file @
5fa17f37
...
@@ -76,6 +76,8 @@ void unpack_header ( header_t * header , Buf buffer )
...
@@ -76,6 +76,8 @@ void unpack_header ( header_t * header , Buf buffer )
unpack32
(
&
header
->
body_length
,
buffer
)
;
unpack32
(
&
header
->
body_length
,
buffer
)
;
}
}
/* SLURM_IO_HEADER_SIZE is the packed data structure size, *\
\* not necessarily sizeof(slurm_io_stream_header_t) */
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
)
{
{
uint32_t
tmp
=
SLURM_SSL_SIGNATURE_LENGTH
;
uint32_t
tmp
=
SLURM_SSL_SIGNATURE_LENGTH
;
...
...
This diff is collapsed.
Click to expand it.
src/srun/io.c
+
3
−
4
View file @
5fa17f37
...
@@ -281,7 +281,6 @@ _accept_io_stream(job_t *job, int i)
...
@@ -281,7 +281,6 @@ _accept_io_stream(job_t *job, int i)
int
size
=
sizeof
(
addr
);
int
size
=
sizeof
(
addr
);
char
buf
[
INET_ADDRSTRLEN
];
char
buf
[
INET_ADDRSTRLEN
];
slurm_io_stream_header_t
hdr
;
slurm_io_stream_header_t
hdr
;
uint32_t
len
=
sizeof
(
hdr
)
-
4
;
char
*
msgbuf
;
char
*
msgbuf
;
Buf
buffer
;
Buf
buffer
;
...
@@ -298,9 +297,9 @@ _accept_io_stream(job_t *job, int i)
...
@@ -298,9 +297,9 @@ _accept_io_stream(job_t *job, int i)
sin
=
(
struct
sockaddr_in
*
)
&
addr
;
sin
=
(
struct
sockaddr_in
*
)
&
addr
;
inet_ntop
(
AF_INET
,
&
sin
->
sin_addr
,
buf
,
INET_ADDRSTRLEN
);
inet_ntop
(
AF_INET
,
&
sin
->
sin_addr
,
buf
,
INET_ADDRSTRLEN
);
msgbuf
=
xmalloc
(
len
);
msgbuf
=
xmalloc
(
SLURM_IO_HEADER_SIZE
);
_readn
(
sd
,
msgbuf
,
len
);
_readn
(
sd
,
msgbuf
,
SLURM_IO_HEADER_SIZE
);
buffer
=
create_buf
(
msgbuf
,
len
);
buffer
=
create_buf
(
msgbuf
,
SLURM_IO_HEADER_SIZE
);
unpack_io_stream_header
(
&
hdr
,
buffer
);
unpack_io_stream_header
(
&
hdr
,
buffer
);
free_buf
(
buffer
);
/* NOTE: this frees msgbuf */
free_buf
(
buffer
);
/* NOTE: this frees msgbuf */
...
...
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