1
1

* fix query_get_nodes to take an int* for available_procs, since this is an

output variable
* Added job_handle support for cofs module

This commit was SVN r285.
Этот коммит содержится в:
Brian Barrett 2004-01-12 01:22:30 +00:00
родитель 8c6d253963
Коммит cfcacb8b1b
4 изменённых файлов: 40 добавлений и 8 удалений

Просмотреть файл

@ -17,39 +17,69 @@
#include <string.h>
#include <unistd.h>
#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)
{
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;
}
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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)

Просмотреть файл

@ -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);
/**