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
80073ec8
Commit
80073ec8
authored
22 years ago
by
tewk
Browse files
Options
Downloads
Patches
Plain Diff
little bug fixes
adjusted arithmetic for packing wrapper routines
parent
b8c5de74
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_api.c
+13
-12
13 additions, 12 deletions
src/common/slurm_protocol_api.c
with
13 additions
and
12 deletions
src/common/slurm_protocol_api.c
+
13
−
12
View file @
80073ec8
...
@@ -43,7 +43,7 @@ uint32_t slurm_shutdown_message_engine ( slurm_fd open_fd )
...
@@ -43,7 +43,7 @@ uint32_t slurm_shutdown_message_engine ( slurm_fd open_fd )
* open_fd - file descriptor to receive message on
* open_fd - file descriptor to receive message on
* source_address - address of the source of the message for now it is really just a sockaddr_in
* source_address - address of the source of the message for now it is really just a sockaddr_in
* message - a slurm message struct
* message - a slurm message struct
* uint32_t - size of message received in bytes
* uint32_t - size of message received in bytes
before being unpacked
*/
*/
uint32_t
slurm_receive_message
(
slurm_fd
open_fd
,
slurm_addr
*
source_address
,
slurm_message_t
**
message
)
uint32_t
slurm_receive_message
(
slurm_fd
open_fd
,
slurm_addr
*
source_address
,
slurm_message_t
**
message
)
{
{
...
@@ -66,7 +66,7 @@ uint32_t slurm_receive_message ( slurm_fd open_fd , slurm_addr * source_address
...
@@ -66,7 +66,7 @@ uint32_t slurm_receive_message ( slurm_fd open_fd , slurm_addr * source_address
}
}
/* unpack header */
/* unpack header */
unpack_len
=
r
eceive_len
;
unpack_len
=
r
c
;
unpack_header
(
&
buffer
,
&
unpack_len
,
&
header
)
;
unpack_header
(
&
buffer
,
&
unpack_len
,
&
header
)
;
rc
=
check_header_version
(
&
header
)
;
rc
=
check_header_version
(
&
header
)
;
...
@@ -78,7 +78,7 @@ uint32_t slurm_receive_message ( slurm_fd open_fd , slurm_addr * source_address
...
@@ -78,7 +78,7 @@ uint32_t slurm_receive_message ( slurm_fd open_fd , slurm_addr * source_address
unpack_message
(
&
buffer
,
&
unpack_len
,
new_message
)
;
unpack_message
(
&
buffer
,
&
unpack_len
,
new_message
)
;
*
message
=
new_message
;
*
message
=
new_message
;
return
r
eceive_len
;
return
r
c
;
}
}
/***** send message functions */
/***** send message functions */
...
@@ -107,14 +107,14 @@ uint32_t slurm_send_node_message ( slurm_fd open_fd , slurm_addr * destination_a
...
@@ -107,14 +107,14 @@ uint32_t slurm_send_node_message ( slurm_fd open_fd , slurm_addr * destination_a
init_header
(
&
header
,
message_type
,
SLURM_PROTOCOL_NO_FLAGS
)
;
init_header
(
&
header
,
message_type
,
SLURM_PROTOCOL_NO_FLAGS
)
;
/* pack header */
/* pack header */
pack_len
=
0
;
pack_len
=
MAX_MESSAGE_BUFFER_SIZE
;
pack_header
(
&
buffer
,
&
pack_len
,
&
header
)
;
pack_header
(
&
buffer
,
&
pack_len
,
&
header
)
;
/* pack message */
/* pack message */
pack_message
(
&
buffer
,
&
pack_len
,
message
)
;
pack_message
(
&
buffer
,
&
pack_len
,
message
)
;
/* send message */
/* send message */
rc
=
_slurm_message_sendto
(
open_fd
,
buf_temp
,
pack_len
,
NO_SEND_RECV_FLAGS
,
destination_address
)
;
rc
=
_slurm_message_sendto
(
open_fd
,
buf_temp
,
MAX_MESSAGE_BUFFER_SIZE
-
pack_len
,
NO_SEND_RECV_FLAGS
,
destination_address
)
;
if
(
rc
==
SLURM_SOCKET_ERROR
)
if
(
rc
==
SLURM_SOCKET_ERROR
)
{
{
if
(
debug
)
if
(
debug
)
...
@@ -123,7 +123,7 @@ uint32_t slurm_send_node_message ( slurm_fd open_fd , slurm_addr * destination_a
...
@@ -123,7 +123,7 @@ uint32_t slurm_send_node_message ( slurm_fd open_fd , slurm_addr * destination_a
}
}
return
rc
;
return
rc
;
}
}
return
pack_len
;
return
rc
;
}
}
uint32_t
slurm_receive_buffer
(
slurm_fd
open_fd
,
slurm_addr
*
source_address
,
slurm_message_type_t
*
message_type
,
char
*
data_buffer
,
size_t
buf_len
)
uint32_t
slurm_receive_buffer
(
slurm_fd
open_fd
,
slurm_addr
*
source_address
,
slurm_message_type_t
*
message_type
,
char
*
data_buffer
,
size_t
buf_len
)
...
@@ -131,7 +131,7 @@ uint32_t slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address ,
...
@@ -131,7 +131,7 @@ uint32_t slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address ,
char
buftemp
[
MAX_MESSAGE_BUFFER_SIZE
]
;
char
buftemp
[
MAX_MESSAGE_BUFFER_SIZE
]
;
char
*
buffer
=
buftemp
;
char
*
buffer
=
buftemp
;
header_t
header
;
header_t
header
;
int32_t
rc
;
int32_t
rc
,
bytes_read
;
uint32_t
unpack_len
;
uint32_t
unpack_len
;
uint32_t
receive_len
=
MAX_MESSAGE_BUFFER_SIZE
;
uint32_t
receive_len
=
MAX_MESSAGE_BUFFER_SIZE
;
...
@@ -146,14 +146,15 @@ uint32_t slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address ,
...
@@ -146,14 +146,15 @@ uint32_t slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address ,
}
}
/* unpack header */
/* unpack header */
bytes_read
=
rc
;
unpack_len
=
rc
;
unpack_len
=
rc
;
unpack_header
(
&
buffer
,
&
unpack_len
,
&
header
)
;
unpack_header
(
&
buffer
,
&
unpack_len
,
&
header
)
;
rc
=
check_header_version
(
&
header
)
;
rc
=
check_header_version
(
&
header
)
;
if
(
rc
<
0
)
return
rc
;
if
(
rc
<
0
)
return
rc
;
*
message_type
=
header
.
message_type
;
*
message_type
=
header
.
message_type
;
*
data_buffer
=
buffer
;
data_buffer
=
buffer
;
return
unpack_len
;
return
bytes_read
;
}
}
uint32_t
slurm_send_server_buffer
(
slurm_fd
open_fd
,
slurm_message_type_t
message_type
,
char
*
data_buffer
,
size_t
buf_len
)
uint32_t
slurm_send_server_buffer
(
slurm_fd
open_fd
,
slurm_message_type_t
message_type
,
char
*
data_buffer
,
size_t
buf_len
)
...
@@ -173,14 +174,14 @@ uint32_t slurm_send_node_buffer ( slurm_fd open_fd , slurm_addr * destination_ad
...
@@ -173,14 +174,14 @@ uint32_t slurm_send_node_buffer ( slurm_fd open_fd , slurm_addr * destination_ad
init_header
(
&
header
,
message_type
,
SLURM_PROTOCOL_NO_FLAGS
)
;
init_header
(
&
header
,
message_type
,
SLURM_PROTOCOL_NO_FLAGS
)
;
/* pack header */
/* pack header */
pack_len
=
0
;
pack_len
=
MAX_MESSAGE_BUFFER_SIZE
;
pack_header
(
&
buffer
,
&
pack_len
,
&
header
)
;
pack_header
(
&
buffer
,
&
pack_len
,
&
header
)
;
/* pack message */
/* pack message */
memcpy
(
buffer
,
data_buffer
,
buf_len
)
;
memcpy
(
buffer
,
data_buffer
,
buf_len
)
;
pack_len
+
=
buf_len
;
pack_len
-
=
buf_len
;
rc
=
_slurm_message_sendto
(
open_fd
,
buf_temp
,
pack_len
,
NO_SEND_RECV_FLAGS
,
destination_address
)
;
rc
=
_slurm_message_sendto
(
open_fd
,
buf_temp
,
MAX_MESSAGE_BUFFER_SIZE
-
pack_len
,
NO_SEND_RECV_FLAGS
,
destination_address
)
;
if
(
rc
==
SLURM_SOCKET_ERROR
)
if
(
rc
==
SLURM_SOCKET_ERROR
)
{
{
if
(
debug
)
if
(
debug
)
...
...
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