2004-01-15 04:47:20 +00:00
|
|
|
/*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-08-05 14:35:38 +00:00
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
*
|
|
|
|
* Interface into the Open MPI Run Time Environment
|
|
|
|
*/
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#ifndef OMPI_RUNTIME_H
|
|
|
|
#define OMPI_RUNTIME_H
|
2004-01-15 04:47:20 +00:00
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#include "ompi_config.h"
|
2004-01-31 21:47:59 +00:00
|
|
|
|
2004-08-10 03:48:41 +00:00
|
|
|
#include "runtime/runtime_types.h"
|
|
|
|
|
2004-08-07 00:53:56 +00:00
|
|
|
/* For backwards compatibility. If you only need MPI stuff, please include
|
|
|
|
mpiruntime/mpiruntime.h directly */
|
2004-08-08 05:20:32 +00:00
|
|
|
#include "mpi/runtime/mpiruntime.h"
|
2004-03-17 20:00:24 +00:00
|
|
|
|
2004-01-15 04:47:20 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2004-09-02 18:39:42 +00:00
|
|
|
/* globals used by RTE - instanced in ompi_rte_init.c */
|
|
|
|
|
|
|
|
extern int ompi_rte_debug_flag;
|
|
|
|
|
2004-08-05 14:35:38 +00:00
|
|
|
/**
|
|
|
|
* Initialize the Open MPI support code
|
|
|
|
*
|
|
|
|
* This function initializes the Open MPI support code, including
|
|
|
|
* malloc debugging and threads. It should be called exactly once
|
|
|
|
* by every application that utilizes any of the Open MPI support
|
|
|
|
* libraries (including MPI applications, mpirun, and mpicc).
|
|
|
|
*
|
|
|
|
* This function should be called before \code ompi_rte_init, if
|
|
|
|
* \code ompi_rte_init is to be called.
|
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
int ompi_init(int argc, char* argv[]);
|
2004-08-05 14:35:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalize the Open MPI support code
|
|
|
|
*
|
|
|
|
* Finalize the Open MPI support code. Any function calling \code
|
|
|
|
* ompi_init should call \code ompi_finalize. This function should
|
|
|
|
* be called after \code ompi_rte_finalize, if \code
|
|
|
|
* ompi_rte_finalize is called.
|
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
int ompi_finalize(void);
|
2004-08-05 14:35:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Abort the current application with a pretty-print error message
|
|
|
|
*
|
|
|
|
* Aborts currently running application with \code abort(), pretty
|
|
|
|
* printing an error message if possible. Error message should be
|
|
|
|
* specified using the standard \code printf() format.
|
|
|
|
*/
|
|
|
|
int ompi_abort(int status, char *fmt, ...);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize the Open MPI run time environment
|
|
|
|
*
|
|
|
|
* Initlize the Open MPI run time environment, including process
|
|
|
|
* control and out of band messaging. This function should be
|
|
|
|
* called exactly once, after \code ompi_init. This function should
|
|
|
|
* be called by every application using the RTE interface, including
|
|
|
|
* MPI applications and mpirun.
|
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
int ompi_rte_init(bool *allow_multi_user_threads, bool *have_hidden_threads);
|
2004-08-05 14:35:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Finalize the Open MPI run time environment
|
|
|
|
*
|
|
|
|
*/
|
2004-06-07 15:33:53 +00:00
|
|
|
int ompi_rte_finalize(void);
|
2004-01-15 04:47:20 +00:00
|
|
|
|
2004-08-10 03:48:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate requested resources
|
|
|
|
*
|
|
|
|
* Allocate the specified nodes / processes for use in a new job.
|
|
|
|
* Requires a newly created jobid. The allocation returned may be
|
|
|
|
* smaller than requested - it is up to the caller to proceed as
|
|
|
|
* appropriate should this occur. This function should only be called
|
|
|
|
* once per jobid.
|
|
|
|
*
|
|
|
|
* @param jobid (IN) Jobid with which to associate the given resources.
|
|
|
|
* @param nodes (IN) Number of nodes to try to allocate. If 0, the
|
|
|
|
* LLM will try to allocate <code>procs</code>
|
|
|
|
* processes on as many nodes as are needed. If
|
|
|
|
* non-zero, will try to fairly distribute
|
|
|
|
* <code>procs</code> processes over the nodes.
|
|
|
|
* If <code>procs</code> is 0, will attempt to
|
|
|
|
* allocate all cpus on <code>nodes</code> nodes
|
|
|
|
* @param procs (IN) Number of processors to try to allocate. See the note
|
|
|
|
* for <code>nodes</code> for usage.
|
2004-08-13 19:39:06 +00:00
|
|
|
* @return List of <code>ompi_rte_node_allocation_t</code>s
|
2004-08-10 03:48:41 +00:00
|
|
|
* describing the allocated resources.
|
|
|
|
*
|
|
|
|
* @warning The type for jobid will change in the near future
|
|
|
|
*/
|
2004-08-13 19:39:06 +00:00
|
|
|
ompi_list_t* ompi_rte_allocate_resources(int jobid, int nodes, int procs);
|
2004-08-10 03:48:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This tells you whether the runtime is capable of spawning new
|
|
|
|
* processes or not
|
|
|
|
*
|
|
|
|
* @return True/False
|
|
|
|
*/
|
|
|
|
bool ompi_rte_can_spawn(void);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Spawn a job
|
|
|
|
*
|
|
|
|
* Start a job with given jobid and starting vpid (should probably be
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* @warning Parameter list will probably change in the near future.
|
|
|
|
*/
|
2004-08-13 19:39:06 +00:00
|
|
|
int ompi_rte_spawn_procs(int jobid, ompi_list_t *schedule_list);
|
2004-08-10 03:48:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get my name
|
|
|
|
*
|
|
|
|
* @return my name
|
|
|
|
*/
|
|
|
|
ompi_process_name_t* ompi_rte_get_self(void);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get names of peer processes which have been launched
|
|
|
|
*
|
|
|
|
* @param Nothing
|
|
|
|
* @return An array of peer names, including me
|
|
|
|
*/
|
|
|
|
int ompi_rte_get_peers(ompi_process_name_t **peers, size_t *npeers);
|
|
|
|
|
2004-08-28 01:15:19 +00:00
|
|
|
/**
|
|
|
|
* Setup process info in the registry.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int ompi_rte_register(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Monitor a job - currently implemented by monitoring process
|
|
|
|
* registration/deregistration to/from the GPR.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int ompi_rte_notify(mca_ns_base_jobid_t job, int num_procs);
|
|
|
|
int ompi_rte_monitor(void);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove process registration.
|
|
|
|
*/
|
|
|
|
|
|
|
|
int ompi_rte_unregister(void);
|
2004-08-10 03:48:41 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Kill a specific process in this cell
|
|
|
|
*
|
|
|
|
* @param process_name Which process needs to be killed.
|
|
|
|
* @return Error code
|
|
|
|
*
|
|
|
|
* @warning flags is currently ignored, but should be set to 0 for
|
|
|
|
* future compatibility. Will be used to specify how to kill
|
|
|
|
* processes (0 will be same as a "kill <pid>"
|
|
|
|
*/
|
|
|
|
int ompi_rte_kill_proc(ompi_process_name_t *name, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Kill all the processes in a job. This will probably find out all
|
|
|
|
* 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
|
|
|
|
* @return Error code
|
|
|
|
*
|
|
|
|
* @warning flags is currently ignored, but should be set to 0 for
|
|
|
|
* future compatibility. Will be used to specify how to kill
|
|
|
|
* processes (0 will be same as a "kill <pid>"
|
|
|
|
*/
|
|
|
|
int ompi_rte_kill_job(int jobid, int flags);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deallocate requested resources
|
|
|
|
*
|
|
|
|
* Return the resources for the given jobid to the system.
|
|
|
|
*
|
|
|
|
* @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.
|
|
|
|
*
|
|
|
|
* @warning The type for jobid will change in the near future.
|
|
|
|
*/
|
|
|
|
int ompi_rte_deallocate_resources(int jobid, ompi_list_t *nodelist);
|
|
|
|
|
|
|
|
|
2004-09-02 18:39:42 +00:00
|
|
|
/**
|
|
|
|
* Setup rte command line options
|
|
|
|
*
|
|
|
|
* Defines the command line options specific to the rte/seed daemon
|
|
|
|
*
|
|
|
|
* @param cmd_line Pointer to an ompi_cmd_line_t object
|
|
|
|
* @retval None
|
|
|
|
*/
|
|
|
|
void ompi_rte_cmd_line_setup(ompi_cmd_line_t *cmd_line);
|
|
|
|
|
2004-01-15 04:47:20 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2004-06-07 15:33:53 +00:00
|
|
|
#endif /* OMPI_RUNTIME_H */
|