"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/ckpoint/blcr/ckpoint_blcr.c" between
hydra-3.3.1.tar.gz and hydra-3.3.2.tar.gz

About: Hydra (MPICH) is a process management system for starting parallel jobs. Hydra is designed to natively work with existing launcher daemons (such as ssh, rsh, fork), as well as natively integrate with resource management systems (such as slurm, pbs, sge).

ckpoint_blcr.c  (hydra-3.3.1):ckpoint_blcr.c  (hydra-3.3.2)
skipping to change at line 80 skipping to change at line 80
fn_fail: fn_fail:
goto fn_exit; goto fn_exit;
} }
static int listen_fd; static int listen_fd;
static HYD_status create_stdinouterr_sock(int *port) static HYD_status create_stdinouterr_sock(int *port)
{ {
HYD_status status = HYD_SUCCESS; HYD_status status = HYD_SUCCESS;
int ret; int ret;
struct sockaddr_in sin; unsigned short t_port;
socklen_t len; MPL_sockaddr_t addr;
HYDU_FUNC_ENTER(); HYDU_FUNC_ENTER();
listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); listen_fd = MPL_socket();
HYDU_ERR_CHKANDJUMP(status, listen_fd < 0, HYD_INTERNAL_ERROR, "socket() fai led, %s\n", HYDU_ERR_CHKANDJUMP(status, listen_fd < 0, HYD_INTERNAL_ERROR, "socket() fai led, %s\n",
strerror(errno)); strerror(errno));
memset((void *) &sin, 0, sizeof(sin)); MPL_LISTEN_PUSH(1, SOMAXCONN);
sin.sin_family = AF_INET; ret = MPL_listen_anyport(listen_fd, &t_port);
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); *port = t_port;
sin.sin_port = htons(0); MPL_LISTEN_POP;
ret = bind(listen_fd, (struct sockaddr *) &sin, sizeof(sin));
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "bind() failed, %s\n",
strerror(errno));
ret = listen(listen_fd, SOMAXCONN);
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "listen() failed, %s\n" , strerror(errno)); HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "listen() failed, %s\n" , strerror(errno));
len = sizeof(sin);
ret = getsockname(listen_fd, (struct sockaddr *) &sin, &len);
HYDU_ERR_CHKANDJUMP(status, ret, HYD_INTERNAL_ERROR, "getsockname() failed,
%s\n",
strerror(errno));
*port = ntohs(sin.sin_port);
fn_exit: fn_exit:
HYDU_FUNC_EXIT(); HYDU_FUNC_EXIT();
return status; return status;
fn_fail: fn_fail:
goto fn_exit; goto fn_exit;
} }
typedef struct sock_ident { typedef struct sock_ident {
int rank; int rank;
enum { IN_SOCK, OUT_SOCK, ERR_SOCK } socktype; enum { IN_SOCK, OUT_SOCK, ERR_SOCK } socktype;
skipping to change at line 147 skipping to change at line 135
if (ranks[i] == 0) { if (ranks[i] == 0) {
++num_expected_connections; ++num_expected_connections;
break; break;
} }
for (c = 0; c < num_expected_connections; ++c) { for (c = 0; c < num_expected_connections; ++c) {
size_t len; size_t len;
char *id_p; char *id_p;
/* wait for a connection */ /* wait for a connection */
do { do {
struct sockaddr_in rmt_addr; MPL_sockaddr_t rmt_addr;
socklen_t sa_len = sizeof(rmt_addr);; socklen_t sa_len = sizeof(rmt_addr);;
fd = accept(listen_fd, (struct sockaddr *) &rmt_addr, &sa_len); fd = accept(listen_fd, (struct sockaddr *) &rmt_addr, &sa_len);
} while (fd && errno == EINTR); } while (fd && errno == EINTR);
HYDU_ERR_CHKANDJUMP(status, fd == -1, HYD_INTERNAL_ERROR, "accept failed , %s\n", HYDU_ERR_CHKANDJUMP(status, fd == -1, HYD_INTERNAL_ERROR, "accept failed , %s\n",
strerror(errno)); strerror(errno));
/* read the socket identifier */ /* read the socket identifier */
len = sizeof(id); len = sizeof(id);
id_p = (char *) &id; id_p = (char *) &id;
do { do {
 End of changes. 5 change blocks. 
22 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)