Commit 26b0c60e authored by Pavan Balaji's avatar Pavan Balaji
Browse files

[svn-r3434] White space change using the cleanup script at...

[svn-r3434] White space change using the cleanup script at http://www.mcs.anl.gov/~balaji/personal/code-cleanup.sh
parent 6cb99a56
......@@ -12,7 +12,7 @@
HYD_Status HYD_BSCI_Launch_procs(void);
HYD_Status HYD_BSCI_Cleanup_procs(void);
HYD_Status HYD_BSCI_Get_universe_size(int * size);
HYD_Status HYD_BSCI_Get_universe_size(int *size);
HYD_Status HYD_BSCI_Wait_for_completion(void);
HYD_Status HYD_BSCI_Finalize(void);
......
......@@ -10,8 +10,8 @@
#include "bsci.h"
#include "bscu.h"
HYD_BSCU_Procstate_t * HYD_BSCU_Procstate;
HYD_CSI_Handle * csi_handle;
HYD_BSCU_Procstate_t *HYD_BSCU_Procstate;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -19,7 +19,7 @@ HYD_CSI_Handle * csi_handle;
#define FUNCNAME "HYD_BSCI_Finalize"
HYD_Status HYD_BSCI_Finalize(void)
{
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -33,10 +33,10 @@ HYD_Status HYD_BSCI_Finalize(void)
proc_params = proc_params->next;
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -12,8 +12,8 @@
#include "bsci.h"
#include "bscu.h"
HYD_BSCU_Procstate_t * HYD_BSCU_Procstate;
HYD_CSI_Handle * csi_handle;
HYD_BSCU_Procstate_t *HYD_BSCU_Procstate;
HYD_CSI_Handle *csi_handle;
/*
* HYD_BSCI_Launch_procs: For each process, we create an executable
......@@ -27,8 +27,8 @@ HYD_CSI_Handle * csi_handle;
#define FUNCNAME "HYD_BSCI_Launch_procs"
HYD_Status HYD_BSCI_Launch_procs(void)
{
struct HYD_CSI_Proc_params * proc_params;
char ** client_arg, * hostname, ** proc_list;
struct HYD_CSI_Proc_params *proc_params;
char **client_arg, *hostname, **proc_list;
int i, arg, process_id, host_id, host_id_max;
HYD_Status status = HYD_SUCCESS;
......@@ -54,7 +54,7 @@ HYD_Status HYD_BSCI_Launch_procs(void)
HYDU_MALLOC(proc_params->stdout, int *, proc_params->user_num_procs * sizeof(int), status);
HYDU_MALLOC(proc_params->stderr, int *, proc_params->user_num_procs * sizeof(int), status);
if (proc_params->host_file != NULL) { /* We got a new host file */
if (proc_params->host_file != NULL) { /* We got a new host file */
host_id = 0;
host_id_max = proc_params->total_num_procs;
proc_list = proc_params->total_proc_list;
......@@ -70,7 +70,7 @@ HYD_Status HYD_BSCI_Launch_procs(void)
client_arg[arg++] = MPIU_Strdup("-Xq");
else if (csi_handle->enablex == 0)
client_arg[arg++] = MPIU_Strdup("-xq");
else /* default mode is disable X */
else /* default mode is disable X */
client_arg[arg++] = MPIU_Strdup("-xq");
if (host_id == host_id_max)
......@@ -112,7 +112,7 @@ HYD_Status HYD_BSCI_Launch_procs(void)
proc_params = proc_params->next;
}
fn_exit:
fn_exit:
for (arg = 0; client_arg[arg]; arg++)
HYDU_FREE(client_arg[arg]);
HYDU_FREE(client_arg);
......@@ -120,7 +120,7 @@ fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -131,8 +131,8 @@ fn_fail:
#define FUNCNAME "HYD_BSCI_Cleanup_procs"
HYD_Status HYD_BSCI_Cleanup_procs(void)
{
struct HYD_CSI_Proc_params * proc_params;
char ** client_arg, * hostname, ** proc_list;
struct HYD_CSI_Proc_params *proc_params;
char **client_arg, *hostname, **proc_list;
int i, arg, host_id, host_id_max;
HYD_Status status = HYD_SUCCESS;
......@@ -148,7 +148,7 @@ HYD_Status HYD_BSCI_Cleanup_procs(void)
client_arg[arg++] = MPIU_Strdup("/usr/bin/ssh");
client_arg[arg++] = MPIU_Strdup("-xq");
if (proc_params->host_file != NULL) { /* We got a new host file */
if (proc_params->host_file != NULL) { /* We got a new host file */
host_id = 0;
host_id_max = proc_params->total_num_procs;
proc_list = proc_params->total_proc_list;
......@@ -168,7 +168,7 @@ HYD_Status HYD_BSCI_Cleanup_procs(void)
client_arg[arg++] = MPIU_Strdup("killall");
client_arg[arg++] = NULL;
proc_params->exec[1] = 0; /* We only care about the executable name */
proc_params->exec[1] = 0; /* We only care about the executable name */
HYD_BSCU_Append_exec(proc_params->exec, client_arg);
status = HYD_BSCU_Create_process(client_arg, NULL, NULL, NULL, NULL);
......@@ -181,7 +181,7 @@ HYD_Status HYD_BSCI_Cleanup_procs(void)
proc_params = proc_params->next;
}
fn_exit:
fn_exit:
for (arg = 0; client_arg[arg]; arg++)
HYDU_FREE(client_arg[arg]);
HYDU_FREE(client_arg);
......@@ -189,7 +189,7 @@ fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -198,7 +198,7 @@ fn_fail:
#undef FUNCNAME
#endif /* FUNCNAME */
#define FUNCNAME "HYD_BSCI_Get_universe_size"
HYD_Status HYD_BSCI_Get_universe_size(int * size)
HYD_Status HYD_BSCI_Get_universe_size(int *size)
{
HYD_Status status = HYD_SUCCESS;
......@@ -206,10 +206,10 @@ HYD_Status HYD_BSCI_Get_universe_size(int * size)
*size = -1;
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -26,10 +26,10 @@ HYD_Status HYD_BSCI_Wait_for_completion(void)
status = HYD_BSCU_Wait_for_completion();
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -13,20 +13,20 @@
#include "bsci.h"
typedef struct HYD_BSCU_Procstate {
int pid;
int exit_status;
int pid;
int exit_status;
} HYD_BSCU_Procstate_t;
extern HYD_BSCU_Procstate_t * HYD_BSCU_Procstate;
extern HYD_BSCU_Procstate_t *HYD_BSCU_Procstate;
extern int HYD_BSCU_Num_procs;
extern int HYD_BSCU_Completed_procs;
HYD_Status HYD_BSCU_Init_exit_status(void);
HYD_Status HYD_BSCU_Finalize_exit_status(void);
HYD_Status HYD_BSCU_Create_process(char ** client_arg, int * in, int * out, int * err, int * pid);
HYD_Status HYD_BSCU_Create_process(char **client_arg, int *in, int *out, int *err, int *pid);
HYD_Status HYD_BSCU_Wait_for_completion(void);
HYD_Status HYD_BSCU_Append_env(HYDU_Env_t * env_list, char ** client_arg, int id);
HYD_Status HYD_BSCU_Append_exec(char ** exec, char ** client_arg);
HYD_Status HYD_BSCU_Append_env(HYDU_Env_t * env_list, char **client_arg, int id);
HYD_Status HYD_BSCU_Append_exec(char **exec, char **client_arg);
HYD_Status HYD_BSCU_Set_common_signals(sighandler_t handler);
void HYD_BSCU_Signal_handler(int signal);
......
......@@ -11,7 +11,7 @@
#include "bsci.h"
#include "bscu.h"
HYD_BSCU_Procstate_t * HYD_BSCU_Procstate;
HYD_BSCU_Procstate_t *HYD_BSCU_Procstate;
int HYD_BSCU_Num_procs;
int HYD_BSCU_Completed_procs;
......@@ -65,11 +65,11 @@ HYD_Status HYD_BSCU_Set_common_signals(sighandler_t handler)
}
#endif /* SIGCONT */
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -118,10 +118,10 @@ void HYD_BSCU_Signal_handler(int signal)
/* Ignore other signals for now */
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -11,10 +11,10 @@
#include "bsci.h"
#include "bscu.h"
HYD_BSCU_Procstate_t * HYD_BSCU_Procstate;
HYD_BSCU_Procstate_t *HYD_BSCU_Procstate;
int HYD_BSCU_Num_procs;
int HYD_BSCU_Completed_procs;
HYD_CSI_Handle * csi_handle;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -22,7 +22,7 @@ HYD_CSI_Handle * csi_handle;
#define FUNCNAME "HYD_BSCU_Init_exit_status"
HYD_Status HYD_BSCU_Init_exit_status(void)
{
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
int i;
HYD_Status status = HYD_SUCCESS;
......@@ -45,11 +45,11 @@ HYD_Status HYD_BSCU_Init_exit_status(void)
HYD_BSCU_Num_procs * sizeof(HYD_BSCU_Procstate_t), status);
HYD_BSCU_Completed_procs = 0;
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -60,7 +60,7 @@ fn_fail:
#define FUNCNAME "HYD_BSCU_Finalize_exit_status"
HYD_Status HYD_BSCU_Finalize_exit_status(void)
{
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
int i;
HYD_Status status = HYD_SUCCESS;
......@@ -74,11 +74,11 @@ HYD_Status HYD_BSCU_Finalize_exit_status(void)
HYDU_FREE(HYD_BSCU_Procstate);
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -87,8 +87,7 @@ fn_fail:
#undef FUNCNAME
#endif /* FUNCNAME */
#define FUNCNAME "HYD_BSCU_Create_process"
HYD_Status HYD_BSCU_Create_process(char ** client_arg, int * in, int * out,
int * err, int * pid)
HYD_Status HYD_BSCU_Create_process(char **client_arg, int *in, int *out, int *err, int *pid)
{
int inpipe[2], outpipe[2], errpipe[2], arg, tpid;
HYD_Status status = HYD_SUCCESS;
......@@ -117,7 +116,7 @@ HYD_Status HYD_BSCU_Create_process(char ** client_arg, int * in, int * out,
/* Fork off the process */
tpid = fork();
if (tpid == 0) { /* Child process */
if (tpid == 0) { /* Child process */
close(outpipe[0]);
close(1);
if (dup2(outpipe[1], 1) < 0) {
......@@ -159,7 +158,7 @@ HYD_Status HYD_BSCU_Create_process(char ** client_arg, int * in, int * out,
goto fn_fail;
}
}
else { /* Parent process */
else { /* Parent process */
close(outpipe[1]);
close(errpipe[1]);
if (in)
......@@ -173,11 +172,11 @@ HYD_Status HYD_BSCU_Create_process(char ** client_arg, int * in, int * out,
if (pid)
*pid = tpid;
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -236,11 +235,11 @@ HYD_Status HYD_BSCU_Wait_for_completion()
break;
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -249,11 +248,11 @@ fn_fail:
#undef FUNCNAME
#endif /* FUNCNAME */
#define FUNCNAME "HYD_BSCU_Append_env"
HYD_Status HYD_BSCU_Append_env(HYDU_Env_t * env_list, char ** client_arg, int id)
HYD_Status HYD_BSCU_Append_env(HYDU_Env_t * env_list, char **client_arg, int id)
{
int i, j;
HYDU_Env_t * env;
char * envstr, * tmp[HYDU_NUM_JOIN_STR], * inc;
HYDU_Env_t *env;
char *envstr, *tmp[HYDU_NUM_JOIN_STR], *inc;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -284,11 +283,11 @@ HYD_Status HYD_BSCU_Append_env(HYDU_Env_t * env_list, char ** client_arg, int id
}
client_arg[i++] = NULL;
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -297,7 +296,7 @@ fn_fail:
#undef FUNCNAME
#endif /* FUNCNAME */
#define FUNCNAME "HYD_BSCU_Append_exec"
HYD_Status HYD_BSCU_Append_exec(char ** exec, char ** client_arg)
HYD_Status HYD_BSCU_Append_exec(char **exec, char **client_arg)
{
int i, j;
HYD_Status status = HYD_SUCCESS;
......@@ -309,10 +308,10 @@ HYD_Status HYD_BSCU_Append_exec(char ** exec, char ** client_arg)
client_arg[i++] = MPIU_Strdup(exec[j]);
client_arg[i++] = NULL;
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -10,7 +10,7 @@
#include "pmci.h"
#include "bsci.h"
HYD_CSI_Handle * csi_handle;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -19,7 +19,7 @@ HYD_CSI_Handle * csi_handle;
HYD_Status HYD_CSI_Close_fd(int fd)
{
int i;
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -49,10 +49,10 @@ HYD_Status HYD_CSI_Close_fd(int fd)
proc_params = proc_params->next;
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -11,7 +11,7 @@
#include "pmci.h"
#include "bsci.h"
HYD_CSI_Handle * csi_handle;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -19,7 +19,7 @@ HYD_CSI_Handle * csi_handle;
#define FUNCNAME "HYD_CSI_Finalize"
HYD_Status HYD_CSI_Finalize(void)
{
struct HYD_CSI_Proc_params * proc_params, * p;
struct HYD_CSI_Proc_params *proc_params, *p;
int i;
HYD_Status status = HYD_SUCCESS;
......@@ -43,10 +43,10 @@ HYD_Status HYD_CSI_Finalize(void)
goto fn_fail;
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -13,7 +13,7 @@
#include "bsci.h"
#include "demux.h"
HYD_CSI_Handle * csi_handle;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -21,7 +21,7 @@ HYD_CSI_Handle * csi_handle;
#define FUNCNAME "HYD_CSI_Launch_procs"
HYD_Status HYD_CSI_Launch_procs(void)
{
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
int stdin_fd, flags, count;
HYD_Status status = HYD_SUCCESS;
......@@ -52,7 +52,7 @@ HYD_Status HYD_CSI_Launch_procs(void)
proc_params = proc_params->next;
}
if (csi_handle->stdin != -1) { /* Only process_id 0 */
if (csi_handle->stdin != -1) { /* Only process_id 0 */
status = HYDU_Sock_set_nonblock(csi_handle->stdin);
if (status != HYD_SUCCESS) {
HYDU_Error_printf("Unable to set socket as non-blocking\n");
......@@ -78,10 +78,10 @@ HYD_Status HYD_CSI_Launch_procs(void)
}
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -10,7 +10,7 @@
#include "pmci.h"
#include "bsci.h"
HYD_CSI_Handle * csi_handle;
HYD_CSI_Handle *csi_handle;
#if defined FUNCNAME
#undef FUNCNAME
......@@ -19,7 +19,7 @@ HYD_CSI_Handle * csi_handle;
HYD_Status HYD_CSI_Wait_for_completion(void)
{
int sockets_open, i;
struct HYD_CSI_Proc_params * proc_params;
struct HYD_CSI_Proc_params *proc_params;
HYD_Status status = HYD_SUCCESS;
HYDU_FUNC_ENTER();
......@@ -64,10 +64,10 @@ HYD_Status HYD_CSI_Wait_for_completion(void)
break;
}
fn_exit:
fn_exit:
HYDU_FUNC_EXIT();
return status;
fn_fail:
fn_fail:
goto fn_exit;
}
......@@ -27,51 +27,51 @@ typedef enum {
} HYD_CSI_Prop_t;
typedef struct {
int debug;
int enablex;
char * wdir;
HYDU_Env_t * global_env;
HYDU_Env_t * system_env;
HYDU_Env_t * user_env;
HYD_CSI_Prop_t prop;
HYDU_Env_t * prop_env;
int stdin;
void * stdin_cb;
char stdin_tmp_buf[HYD_CSI_TMPBUF_SIZE];
int stdin_buf_offset;
int stdin_buf_count;
int debug;
int enablex;
char *wdir;
HYDU_Env_t *global_env;
HYDU_Env_t *system_env;
HYDU_Env_t *user_env;
HYD_CSI_Prop_t prop;
HYDU_Env_t *prop_env;
int stdin;
void *stdin_cb;
char stdin_tmp_buf[HYD_CSI_TMPBUF_SIZE];
int stdin_buf_offset;
int stdin_buf_count;
/* Start time and timeout. These are filled in by the launcher,
* but are utilized by the demux engine and the boot-strap server
* to decide how long we need to wait for. */
struct timeval start;
struct timeval timeout;
struct timeval start;
struct timeval timeout;
/* Each structure will contain all hosts/cores that use the same
* executable and environment. */
struct HYD_CSI_Proc_params {
int user_num_procs;
int total_num_procs;
char ** total_proc_list;
int * total_core_list;
int user_num_procs;
int total_num_procs;
char **total_proc_list;
int *total_core_list;
char * host_file;
char *host_file;
char * exec[HYD_CSI_EXEC_ARGS];
HYDU_Env_t * user_env;
HYD_CSI_Prop_t prop;
HYDU_Env_t * prop_env;
char *exec[HYD_CSI_EXEC_ARGS];
HYDU_Env_t *user_env;
HYD_CSI_Prop_t prop;
HYDU_Env_t *prop_env;
/* These output FDs are filled in by the lower layers */
int * stdout;
int * stderr;
int *stdout;
int *stderr;
/* Callback functions for the stdout/stderr events. These can
* be the same. */
void * stdout_cb;
void * stderr_cb;
void *stdout_cb;
void *stderr_cb;
/* Status > 0 means that it is not set yet. Successful
* completion of a process will set the status to 0. An error
......@@ -79,10 +79,10 @@ typedef struct {
* error. Depending on the bootstrap server, these values
* might correspond to per-process status, or can be a common
* value for all processes. */
int * exit_status;
int *exit_status;
struct HYD_CSI_Proc_params * next;
} * proc_params;
struct HYD_CSI_Proc_params *next;
} *proc_params;
} HYD_CSI_Handle;
/* We'll use this as the central handle that has most of the