diff --git a/src/mca/lam/pcm/cofs/src/pcm_cofs.c b/src/mca/lam/pcm/cofs/src/pcm_cofs.c index b4a5bce67b..0fc1263efc 100644 --- a/src/mca/lam/pcm/cofs/src/pcm_cofs.c +++ b/src/mca/lam/pcm/cofs/src/pcm_cofs.c @@ -17,39 +17,69 @@ #include #include +#define HANDLE_FILE_NAME "pcm_cofs_handle_list" + +static int handle_new_count = 0; + int mca_pcm_cofs_query_get_nodes(lam_pcm_node_t ** nodes, size_t * nodes_len, - int available_procs) + int *available_procs) { - return LAM_ERR_NOT_IMPLEMENTED; + *nodes = NULL; + *nodes_len = 0; + *available_procs = 0; + + return LAM_ERR_NOT_SUPPORTED; } lam_job_handle_t mca_pcm_cofs_handle_new(lam_job_handle_t parent) { - return NULL; + pid_t pid; + char *ret; + size_t ret_len; + + pid = getpid(); + + ret_len = sizeof(pid_t) * 8 + strlen("pcm_cofs") + sizeof(int) * 8 + 5; + ret = LAM_MALLOC(ret_len); + if (ret == NULL) { + return NULL; + } + + snprintf(ret, ret_len, "pcm_cofs_%d_%d", (int) pid, handle_new_count); + handle_new_count++; + + return ret; } lam_job_handle_t mca_pcm_cofs_handle_get(void) { - return NULL; + return mca_pcm_cofs_my_handle; } void mca_pcm_cofs_handle_free(lam_job_handle_t * job_handle) { - + if (*job_handle != NULL) { + LAM_FREE(*job_handle); + *job_handle = NULL; + } } int mca_pcm_cofs_job_can_spawn(lam_job_handle_t job_handle) { - return LAM_ERR_NOT_IMPLEMENTED; + if (job_handle != NULL) { + return LAM_ERR_NOT_SUPPORTED; + } else { + return LAM_SUCCESS; + } } diff --git a/src/mca/lam/pcm/cofs/src/pcm_cofs.h b/src/mca/lam/pcm/cofs/src/pcm_cofs.h index 1dd6dad7fb..5b97fa9379 100644 --- a/src/mca/lam/pcm/cofs/src/pcm_cofs.h +++ b/src/mca/lam/pcm/cofs/src/pcm_cofs.h @@ -26,7 +26,7 @@ int mca_pcm_cofs_finalize(void); * "Action" functions */ int mca_pcm_cofs_query_get_nodes(lam_pcm_node_t **nodes, size_t *nodes_len, - int available_procs); + int *available_procs); lam_job_handle_t mca_pcm_cofs_handle_new(lam_job_handle_t parent); lam_job_handle_t mca_pcm_cofs_handle_get(void); @@ -55,3 +55,4 @@ int mca_pcm_cofs_proc_get_parent(void); extern char mca_pcm_cofs_comm_loc[LAM_PATH_MAX]; /* location for file drop-off */ extern int mca_pcm_cofs_my_vpid; +extern char *mca_pcm_cofs_my_handle; diff --git a/src/mca/lam/pcm/cofs/src/pcm_cofs_module.c b/src/mca/lam/pcm/cofs/src/pcm_cofs_module.c index f62992c08b..e99ea7cc43 100644 --- a/src/mca/lam/pcm/cofs/src/pcm_cofs_module.c +++ b/src/mca/lam/pcm/cofs/src/pcm_cofs_module.c @@ -64,6 +64,7 @@ struct mca_pcm_1_0_0_t mca_pcm_cofs_1_0_0 = { char mca_pcm_cofs_comm_loc[LAM_PATH_MAX]; int mca_pcm_cofs_my_vpid; +char *mca_pcm_cofs_my_handle = NULL; int mca_pcm_cofs_open(lam_cmd_line_t *cmd) diff --git a/src/mca/lam/pcm/pcm.h b/src/mca/lam/pcm/pcm.h index 043cd855b2..36b1adbdf3 100644 --- a/src/mca/lam/pcm/pcm.h +++ b/src/mca/lam/pcm/pcm.h @@ -106,7 +106,7 @@ typedef struct mca_pcm_1_0_0_t* (*mca_pcm_base_init_fn_t)(void); */ typedef int (*mca_pcm_base_query_get_nodes_fn_t)(lam_pcm_node_t **nodes, size_t *nodes_len, - int available_procs); + int *available_procs); /**