Skip to content
Snippets Groups Projects
Commit 6773c8a6 authored by tewk's avatar tewk
Browse files

changed all info and debug calls to error calls

parent 5a8dddbb
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ int read_slurm_port_config ( ) ...@@ -90,7 +90,7 @@ int read_slurm_port_config ( )
slurm_spec_file = fopen (SLURM_CONFIG_FILE, "r"); slurm_spec_file = fopen (SLURM_CONFIG_FILE, "r");
if (slurm_spec_file == NULL) { if (slurm_spec_file == NULL) {
fprintf (stderr, "read_slurm_conf error %d opening file %s", error ( "read_slurm_conf error %d opening file %s",
errno, SLURM_CONFIG_FILE); errno, SLURM_CONFIG_FILE);
exit (1); exit (1);
} }
...@@ -223,11 +223,11 @@ slurm_fd slurm_open_controller_conn ( ) ...@@ -223,11 +223,11 @@ slurm_fd slurm_open_controller_conn ( )
/* try to send to primary first then secondary */ /* try to send to primary first then secondary */
if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> primary_controller ) ) == SLURM_SOCKET_ERROR ) if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> primary_controller ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send message to primary controller failed" ) ; error ( "Send message to primary controller failed" ) ;
if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> secondary_controller ) ) == SLURM_SOCKET_ERROR ) if ( ( connection_fd = slurm_open_msg_conn ( & proto_conf -> secondary_controller ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send messge to secondary controller failed" ) ; error ( "Send messge to secondary controller failed" ) ;
} }
} }
return connection_fd ; return connection_fd ;
...@@ -272,7 +272,7 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg ) ...@@ -272,7 +272,7 @@ int slurm_receive_msg ( slurm_fd open_fd , slurm_msg_t * msg )
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 )
{ {
info ( "Error receiving msg socket: errno %i", errno ) ; error ( "Error receiving msg socket: errno %i", errno ) ;
return rc ; return rc ;
} }
...@@ -306,11 +306,11 @@ int slurm_send_controller_msg ( slurm_fd open_fd , slurm_msg_t * msg ) ...@@ -306,11 +306,11 @@ int slurm_send_controller_msg ( slurm_fd open_fd , slurm_msg_t * msg )
msg -> address = proto_conf -> primary_controller ; msg -> address = proto_conf -> primary_controller ;
if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR ) if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send message to primary controller failed" ) ; error ( "Send message to primary controller failed" ) ;
msg -> address = proto_conf -> secondary_controller ; msg -> address = proto_conf -> secondary_controller ;
if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR ) if ( (rc = slurm_send_node_msg ( open_fd , msg ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send messge to secondary controller failed" ) ; error ( "Send messge to secondary controller failed" ) ;
} }
} }
return rc ; return rc ;
...@@ -343,7 +343,7 @@ int slurm_send_node_msg ( slurm_fd open_fd , slurm_msg_t * msg ) ...@@ -343,7 +343,7 @@ int slurm_send_node_msg ( slurm_fd open_fd , slurm_msg_t * msg )
/* send msg */ /* send msg */
if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , &msg->address ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , &msg->address ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error sending msg socket: errno %i", errno ) ; error ( "Error sending msg socket: errno %i", errno ) ;
} }
return rc ; return rc ;
} }
...@@ -368,7 +368,7 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur ...@@ -368,7 +368,7 @@ int slurm_receive_buffer ( slurm_fd open_fd , slurm_addr * source_address , slur
if ( ( rc = _slurm_msg_recvfrom ( open_fd , buffer , receive_len, SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , source_address ) ) == SLURM_SOCKET_ERROR ) ; if ( ( rc = _slurm_msg_recvfrom ( open_fd , buffer , receive_len, SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , source_address ) ) == SLURM_SOCKET_ERROR ) ;
{ {
info ( "Error receiving msg socket: errno %i", errno ) ; error ( "Error receiving msg socket: errno %i", errno ) ;
return rc ; return rc ;
} }
...@@ -405,11 +405,11 @@ int slurm_send_controller_buffer ( slurm_fd open_fd , slurm_msg_type_t msg_type ...@@ -405,11 +405,11 @@ int slurm_send_controller_buffer ( slurm_fd open_fd , slurm_msg_type_t msg_type
/* try to send to primary first then secondary */ /* try to send to primary first then secondary */
if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> primary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> primary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send message to primary controller failed" ) ; error ( "Send message to primary controller failed" ) ;
if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> secondary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = slurm_send_node_buffer ( open_fd , & proto_conf -> secondary_controller , msg_type , data_buffer , buf_len ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Send messge to secondary controller failed" ) ; error ( "Send messge to secondary controller failed" ) ;
} }
} }
return rc ; return rc ;
...@@ -445,7 +445,7 @@ int slurm_send_node_buffer ( slurm_fd open_fd , slurm_addr * destination_address ...@@ -445,7 +445,7 @@ int slurm_send_node_buffer ( slurm_fd open_fd , slurm_addr * destination_address
if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , destination_address ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = _slurm_msg_sendto ( open_fd , buf_temp , SLURM_PROTOCOL_MAX_MESSAGE_BUFFER_SIZE - pack_len , SLURM_PROTOCOL_NO_SEND_RECV_FLAGS , destination_address ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error sending msg socket: errno %i", errno ) ; error ( "Error sending msg socket: errno %i", errno ) ;
} }
return rc ; return rc ;
} }
......
...@@ -365,7 +365,7 @@ int unpack_msg ( slurm_msg_t * msg , char ** buffer , uint32_t * buf_len ) ...@@ -365,7 +365,7 @@ int unpack_msg ( slurm_msg_t * msg , char ** buffer , uint32_t * buf_len )
unpack_job_step_create_request_msg(( job_step_create_request_msg_t ** ) &msg -> data , ( void ** ) buffer , buf_len ) ; unpack_job_step_create_request_msg(( job_step_create_request_msg_t ** ) &msg -> data , ( void ** ) buffer , buf_len ) ;
break; break;
default : default :
debug ( "No pack method for msg type %i", msg -> msg_type ) ; error ( "No pack method for msg type %i", msg -> msg_type ) ;
return EINVAL ; return EINVAL ;
break; break;
......
...@@ -79,12 +79,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin ...@@ -79,12 +79,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
} }
else if ( recv_len == 0 ) else if ( recv_len == 0 )
{ {
info ( "Error receiving length of datagram. errno %i", errno ) ; error ( "Error receiving length of datagram. errno %i", errno ) ;
return SLURM_PROTOCOL_ERROR ; return SLURM_PROTOCOL_ERROR ;
} }
else else
{ {
fatal ( "We don't handle negative return codes > -1") ; error ( "We don't handle negative return codes > -1") ;
} }
} }
unpack32 ( & transmit_size , ( void ** ) & size_buffer , & size_buffer_len ) ; unpack32 ( & transmit_size , ( void ** ) & size_buffer , & size_buffer_len ) ;
...@@ -101,7 +101,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin ...@@ -101,7 +101,7 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
} }
else else
{ {
info ( "Error receiving datagram. errno %i", errno ) ; error ( "Error receiving datagram. errno %i", errno ) ;
return SLURM_PROTOCOL_ERROR ; return SLURM_PROTOCOL_ERROR ;
} }
return recv_len ; return recv_len ;
...@@ -113,12 +113,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin ...@@ -113,12 +113,12 @@ ssize_t _slurm_msg_recvfrom ( slurm_fd open_fd, char *buffer , size_t size , uin
} }
else if ( recv_len == 0 ) else if ( recv_len == 0 )
{ {
info ( "Error receiving datagram. errno %i", errno ) ; error ( "Error receiving datagram. errno %i", errno ) ;
return SLURM_PROTOCOL_ERROR ; return SLURM_PROTOCOL_ERROR ;
} }
else else
{ {
fatal ( "We don't handle negative return codes > -1") ; error ( "We don't handle negative return codes > -1") ;
} }
} }
...@@ -186,7 +186,7 @@ ssize_t _slurm_msg_sendto ( slurm_fd open_fd, char *buffer , size_t size , uint3 ...@@ -186,7 +186,7 @@ ssize_t _slurm_msg_sendto ( slurm_fd open_fd, char *buffer , size_t size , uint3
} }
else if ( send_len != size ) else if ( send_len != size )
{ {
info ( "_slurm_msg_sendto only transmitted %i of %i bytes", send_len , size ) ; error ( "_slurm_msg_sendto only transmitted %i of %i bytes", send_len , size ) ;
sigaction(SIGPIPE, &oldaction , &newaction); sigaction(SIGPIPE, &oldaction , &newaction);
return SLURM_PROTOCOL_ERROR ; return SLURM_PROTOCOL_ERROR ;
} }
...@@ -212,24 +212,24 @@ slurm_fd _slurm_listen_stream ( slurm_addr * slurm_address ) ...@@ -212,24 +212,24 @@ slurm_fd _slurm_listen_stream ( slurm_addr * slurm_address )
const int one = 1; const int one = 1;
if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR ) if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error creating slurm stream socket: errno %i", errno ) ; error ( "Error creating slurm stream socket: errno %i", errno ) ;
return connection_fd ; return connection_fd ;
} }
if ( ( rc = _slurm_setsockopt(connection_fd , SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one) ) ) ) { if ( ( rc = _slurm_setsockopt(connection_fd , SOL_SOCKET, SO_REUSEADDR, &one, sizeof(one) ) ) ) {
info ("setsockopt SO_REUSEADDR"); error ("setsockopt SO_REUSEADDR failed");
return rc ; return rc ;
} }
if ( ( rc = _slurm_bind ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = _slurm_bind ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error binding slurm stream socket: errno %i" , errno ) ; error ( "Error binding slurm stream socket: errno %i" , errno ) ;
return rc ; return rc ;
} }
if ( ( rc = _slurm_listen ( connection_fd , SLURM_PROTOCOL_DEFAULT_LISTEN_BACKLOG ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = _slurm_listen ( connection_fd , SLURM_PROTOCOL_DEFAULT_LISTEN_BACKLOG ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error listening on slurm stream socket: errno %i" , errno ) ; error ( "Error listening on slurm stream socket: errno %i" , errno ) ;
return rc ; return rc ;
} }
...@@ -242,7 +242,7 @@ slurm_fd _slurm_accept_stream ( slurm_fd open_fd , slurm_addr * slurm_address ) ...@@ -242,7 +242,7 @@ slurm_fd _slurm_accept_stream ( slurm_fd open_fd , slurm_addr * slurm_address )
slurm_fd connection_fd ; slurm_fd connection_fd ;
if ( ( connection_fd = _slurm_accept ( open_fd , ( struct sockaddr * ) slurm_address , & addr_len ) ) == SLURM_SOCKET_ERROR ) if ( ( connection_fd = _slurm_accept ( open_fd , ( struct sockaddr * ) slurm_address , & addr_len ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error accepting slurm stream socket: errno %i", errno ) ; error ( "Error accepting slurm stream socket: errno %i", errno ) ;
} }
return connection_fd ; return connection_fd ;
...@@ -254,13 +254,13 @@ slurm_fd _slurm_open_stream ( slurm_addr * slurm_address ) ...@@ -254,13 +254,13 @@ slurm_fd _slurm_open_stream ( slurm_addr * slurm_address )
slurm_fd connection_fd ; slurm_fd connection_fd ;
if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR ) if ( ( connection_fd =_slurm_create_socket ( SLURM_STREAM ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error creating slurm stream socket: errno %i", errno ) ; error ( "Error creating slurm stream socket: errno %i", errno ) ;
return connection_fd ; return connection_fd ;
} }
if ( ( rc = _slurm_connect ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR ) if ( ( rc = _slurm_connect ( connection_fd , ( struct sockaddr const * ) slurm_address , sizeof ( slurm_addr ) ) ) == SLURM_SOCKET_ERROR )
{ {
info ( "Error connecting on slurm stream socket: errno %i" , errno ) ; error ( "Error connecting on slurm stream socket: errno %i" , errno ) ;
return rc ; return rc ;
} }
......
...@@ -11,7 +11,7 @@ uint32_t check_header_version( header_t * header) ...@@ -11,7 +11,7 @@ uint32_t check_header_version( header_t * header)
{ {
if ( header -> version != SLURM_PROTOCOL_VERSION ) if ( header -> version != SLURM_PROTOCOL_VERSION )
{ {
info ( "Invalid Protocol Version %d ", header -> version ) ; error ( "Invalid Protocol Version %d ", header -> version ) ;
return SLURM_PROTOCOL_VERSION_ERROR ; return SLURM_PROTOCOL_VERSION_ERROR ;
} }
return SLURM_PROTOCOL_SUCCESS ; return SLURM_PROTOCOL_SUCCESS ;
...@@ -30,7 +30,7 @@ uint32_t check_io_stream_header_version( slurm_io_stream_header_t * header) ...@@ -30,7 +30,7 @@ uint32_t check_io_stream_header_version( slurm_io_stream_header_t * header)
{ {
if ( header -> version != SLURM_PROTOCOL_VERSION ) if ( header -> version != SLURM_PROTOCOL_VERSION )
{ {
info ( "Invalid Protocol Version %d ", header -> version ) ; error ( "Invalid Protocol Version %d ", header -> version ) ;
return SLURM_PROTOCOL_VERSION_ERROR ; return SLURM_PROTOCOL_VERSION_ERROR ;
} }
return SLURM_PROTOCOL_SUCCESS ; return SLURM_PROTOCOL_SUCCESS ;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment