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
b49b3a3b
Commit
b49b3a3b
authored
22 years ago
by
tewk
Browse files
Options
Downloads
Patches
Plain Diff
Notice: that it is very wise to move your buffer foward as you repeat recv calls to keep
from overwritting previously receieved information
parent
57c528d3
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/slurm_protocol_api.c
+0
-2
0 additions, 2 deletions
src/common/slurm_protocol_api.c
src/common/slurm_protocol_socket_implementation.c
+3
-1
3 additions, 1 deletion
src/common/slurm_protocol_socket_implementation.c
with
3 additions
and
3 deletions
src/common/slurm_protocol_api.c
+
0
−
2
View file @
b49b3a3b
...
@@ -137,7 +137,6 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg )
...
@@ -137,7 +137,6 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg )
int
rc
;
int
rc
;
unsigned
int
unpack_len
;
unsigned
int
unpack_len
;
unsigned
int
receive_len
=
SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE
;
unsigned
int
receive_len
=
SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE
;
int
i
;
if
(
(
rc
=
_slurm_msg_recvfrom
(
open_fd
,
buffer
,
receive_len
,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS
,
&
(
msg
)
->
address
)
)
==
SLURM_SOCKET_ERROR
)
if
(
(
rc
=
_slurm_msg_recvfrom
(
open_fd
,
buffer
,
receive_len
,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS
,
&
(
msg
)
->
address
)
)
==
SLURM_SOCKET_ERROR
)
{
{
...
@@ -245,7 +244,6 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur
...
@@ -245,7 +244,6 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur
char
*
buffer
=
buftemp
;
char
*
buffer
=
buftemp
;
header_t
header
;
header_t
header
;
int
rc
;
int
rc
;
int
i
;
unsigned
int
unpack_len
;
/* length left to upack */
unsigned
int
unpack_len
;
/* length left to upack */
unsigned
int
receive_len
=
SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE
;
/* buffer size */
unsigned
int
receive_len
=
SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE
;
/* buffer size */
...
...
This diff is collapsed.
Click to expand it.
src/common/slurm_protocol_socket_implementation.c
+
3
−
1
View file @
b49b3a3b
...
@@ -53,6 +53,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
...
@@ -53,6 +53,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
char
size_buffer_temp
[
8
]
;
char
size_buffer_temp
[
8
]
;
char
*
size_buffer
=
size_buffer_temp
;
char
*
size_buffer
=
size_buffer_temp
;
char
*
moving_buffer
=
buffer
;
unsigned
int
size_buffer_len
=
8
;
unsigned
int
size_buffer_len
=
8
;
unsigned
int
transmit_size
;
unsigned
int
transmit_size
;
unsigned
int
total_len
;
unsigned
int
total_len
;
...
@@ -75,7 +76,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
...
@@ -75,7 +76,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
while
(
total_len
<
transmit_size
)
while
(
total_len
<
transmit_size
)
{
{
/* if ( ( recv_len = _slurm_recv ( connection_fd , buffer , transmit_size , NO_SEND_RECV_FLAGS ) ) == SLURM_SOCKET_ERROR ) */
/* if ( ( recv_len = _slurm_recv ( connection_fd , buffer , transmit_size , NO_SEND_RECV_FLAGS ) ) == SLURM_SOCKET_ERROR ) */
if
(
(
recv_len
=
_slurm_recv
(
open_fd
,
buffer
,
transmit_size
,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS
)
)
==
SLURM_SOCKET_ERROR
)
if
(
(
recv_len
=
_slurm_recv
(
open_fd
,
moving_
buffer
,
transmit_size
,
SLURM_PROTOCOL_NO_SEND_RECV_FLAGS
)
)
==
SLURM_SOCKET_ERROR
)
{
{
info
(
"Error receiving length of datagram. errno %i
\n
"
,
errno
)
;
info
(
"Error receiving length of datagram. errno %i
\n
"
,
errno
)
;
return
recv_len
;
return
recv_len
;
...
@@ -83,6 +84,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
...
@@ -83,6 +84,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
if
(
recv_len
>=
0
)
if
(
recv_len
>=
0
)
{
{
total_len
+=
recv_len
;
total_len
+=
recv_len
;
moving_buffer
+=
recv_len
;
}
}
}
}
/*
/*
...
...
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