diff --git a/src/mca/pcm/pcm.h b/src/mca/pcm/pcm.h index 68d752f0d3..32f0f116be 100644 --- a/src/mca/pcm/pcm.h +++ b/src/mca/pcm/pcm.h @@ -88,6 +88,13 @@ * @param constrains (IN) Bit-wise mask of constraints put on the PCM. * List of available constants is in the run-time interface - * constants start with \c OMPI_RTE_SPAWN_. + * + * \warning The only requirement on the returned type is that the + * first sizeof(struct mca_pcm_base_module_1_0_0_t) bytes have the + * same structure as a struct mca_pcm_base_module_1_0_0_t. The pcm is + * free to return a pointer to a larger structure in order to maintain + * per-module information it may need. Therefore, the caller should + * never copy the structure or assume its size. */ typedef struct mca_pcm_base_module_1_0_0_t* (*mca_pcm_base_component_init_fn_t)(int *priority, @@ -101,7 +108,6 @@ typedef struct mca_pcm_base_module_1_0_0_t* * * Called by the MCA framework to finalize the component. Will be * called once per successful call to pcm_base_compoenent_init. - * * @param me (IN) Pointer to the module being finalized */ @@ -138,6 +144,8 @@ typedef mca_pcm_base_component_1_0_0_t mca_pcm_base_component_t; * PBS variables required for uniquely identifying the PBS job * environment (the same is true of LSF, SGE, etc.). * + * @param me (IN) Pointer to the module struct + * * @returns NULL on error or if no uniqueness available * non-null otherwize */ @@ -155,6 +163,7 @@ typedef char * * as appropriate should this occur. This function should only be * called once per jobid. * + * @param me (IN) Pointer to the module struct * @param jobid (IN) Jobid with which to associate the given resources. * @param nodes (IN) Number of nodes to try to allocate. If 0, * the PCM will try to allocate procs @@ -179,6 +188,8 @@ typedef ompi_list_t* * This tells you whether the pcm module is capable of spawning new * processes or not during a run * + * @param me (IN) Pointer to the module struct + * * @return True/False */ @@ -193,6 +204,11 @@ typedef bool * 0 for the forseeable future). The job is specified using an array * of \c mca_pcm_base_schedule_t structures, which give both process * and location information. + * + * @param me (IN) Pointer to the module struct + * @param jobid (IN) Jobid under which the job should be started + * @param schedule_list (IN) A list of \c mca_pcm_base_schedule_t + * structures describing the job to start. */ typedef int (*mca_pcm_base_spawn_procs_fn_t)(struct mca_pcm_base_module_1_0_0_t* me, @@ -203,7 +219,9 @@ typedef int /** * Kill a specific process in this cell * - * @param process_name Which process needs to be killed. + * @param me (IN) Pointer to the module struct + * @param process_name (IN) Which process needs to be killed. + * * @return Error code * * @warning flags is currently ignored, but should be set to 0 for @@ -220,7 +238,9 @@ typedef int * the processes in the job by contacting the registry and then call * mca_pcm_kill_process for each process in the job (for a cell) * - * @param jobid Job id + * @param me (IN) Pointer to the module struct + * @param jobid (IN) Job id + * * @return Error code * * @warning flags is currently ignored, but should be set to 0 for @@ -237,6 +257,7 @@ typedef int * * Return the resources for the given jobid to the system. * + * @param me (IN) Pointer to the module struct * @param jobid (IN) Jobid associated with the resources to be freed. * @param nodes (IN) Nodelist from associated allocate_resource call. * All associated memory will be freed as appropriate. diff --git a/src/mca/pcm/rms/.ompi_ignore b/src/mca/pcm/rms/.ompi_ignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/src/mca/pcm/rms/pcm_rms_component.c b/src/mca/pcm/rms/pcm_rms_component.c index ab18fb2379..070f264599 100644 --- a/src/mca/pcm/rms/pcm_rms_component.c +++ b/src/mca/pcm/rms/pcm_rms_component.c @@ -83,7 +83,9 @@ static int mca_pcm_rms_param_debug; static int mca_pcm_rms_param_use_ns; /* - * Module variables + * Component variables. All of these are shared among the module + * instances, so they don't need to go in a special structure or + * anything. */ ompi_list_t mca_pcm_rms_jobs; int mca_pcm_rms_output = 0; @@ -110,7 +112,9 @@ mca_pcm_rms_component_open(void) int mca_pcm_rms_component_close(void) { - return OMPI_SUCCESS; + OBJ_DESTRUCT(&mca_pcm_rms_jobs); + + return OMPI_SUCCESS; } @@ -137,6 +141,7 @@ mca_pcm_rms_init(int *priority, /* poke around for prun */ prun = ompi_path_env_findv("prun", X_OK, environ, NULL); if (NULL == prun) return NULL; + free(prun); return &mca_pcm_rms_1_0_0; } @@ -149,8 +154,6 @@ mca_pcm_rms_finalize(struct mca_pcm_base_module_1_0_0_t* me) ompi_output_close(mca_pcm_rms_output); } - OBJ_DESTRUCT(&mca_pcm_rms_jobs); - return OMPI_SUCCESS; }