Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sock_init/sock_finalize hooks #9

Open
wants to merge 1 commit into
base: wip/pmi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/pm/hydra/libhydra/bstrap/src/hydra_bstrap_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ int main(int argc, char **argv)
char dbg_prefix[2 * HYD_MAX_HOSTNAME_LEN];
HYD_status status = HYD_SUCCESS;

HYD_sock_init();

status = HYD_print_set_prefix_str("bstrap:unset");
HYD_ERR_POP(status, "unable to set dbg prefix\n");

Expand Down Expand Up @@ -369,6 +371,8 @@ int main(int argc, char **argv)
HYD_ERR_POP(status, "error sending proxy ID upstream\n");
}

HYD_sock_finalize();

fn_exit:
return status;

Expand Down
10 changes: 10 additions & 0 deletions src/pm/hydra/libhydra/sock/hydra_sock.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
#include "hydra_sock.h"
#include "hydra_err.h"

HYD_status HYD_sock_init()
{
return HYD_SUCCESS;
}

void HYD_sock_finalize()
{
return;
}

HYD_status HYD_sock_listen_on_port(int *listen_fd, uint16_t port)
{
struct sockaddr_in sa;
Expand Down
2 changes: 2 additions & 0 deletions src/pm/hydra/libhydra/sock/hydra_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ enum HYD_sock_comm_flag {
HYD_SOCK_COMM_TYPE__BLOCKING = 1
};

HYD_status HYD_sock_init();
void HYD_sock_finalize();
HYD_status HYD_sock_listen_on_port(int *listen_fd, uint16_t port);
HYD_status HYD_sock_listen_on_any_port(int *listen_fd, uint16_t * port);
HYD_status HYD_sock_listen_on_port_range(int *listen_fd, const char *port_range, uint16_t * port);
Expand Down
4 changes: 4 additions & 0 deletions src/pm/hydra/mpiexec/mpiexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,8 @@ int main(int argc, char **argv)

HYD_FUNC_ENTER();

HYD_sock_init();

status = HYD_print_set_prefix_str("mpiexec");
HYD_ERR_POP(status, "unable to set dbg prefix\n");

Expand Down Expand Up @@ -1087,6 +1089,8 @@ int main(int argc, char **argv)
if (mpiexec_params.errfile_pattern)
MPL_free(mpiexec_params.errfile_pattern);

HYD_sock_finalize();

fn_exit:
HYD_FUNC_EXIT();
if (status != HYD_SUCCESS)
Expand Down
4 changes: 4 additions & 0 deletions src/pm/hydra/nameserver/hydra_nameserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,8 @@ int main(int argc, char **argv)
int listen_fd;
HYD_status status = HYD_SUCCESS;

HYD_sock_init();

status = HYD_print_set_prefix_str("nameserver");
HYD_ERR_POP(status, "unable to initialize debugging\n");

Expand Down Expand Up @@ -314,6 +316,8 @@ int main(int argc, char **argv)
HYD_ERR_POP(status, "demux engine error waiting for event\n");
}

HYD_sock_finalize();

fn_exit:
return status;

Expand Down
4 changes: 4 additions & 0 deletions src/pm/hydra/proxy/proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@ int main(int argc, char **argv)
HYD_status status = HYD_SUCCESS;
int *nodemap, i, local_rank, tmp_ret;

HYD_sock_init();

status = HYD_print_set_prefix_str("proxy:unset");
HYD_ERR_POP(status, "unable to set dbg prefix\n");

Expand Down Expand Up @@ -855,6 +857,8 @@ int main(int argc, char **argv)
if (proxy_params.all.pmi_process_mapping)
MPL_free(proxy_params.all.pmi_process_mapping);

HYD_sock_finalize();

fn_exit:
return status;

Expand Down