2004-01-10 01:09:51 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
* University Research and Technology
|
|
|
|
* Corporation. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2006-05-11 23:46:21 +04:00
|
|
|
* Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
2004-01-10 01:09:51 +03:00
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
#ifndef OMPI_PROC
|
|
|
|
#define OMPI_PROC
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/types.h"
|
2005-07-03 20:22:16 +04:00
|
|
|
#include "opal/class/opal_list.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/dss/dss_types.h"
|
2005-07-04 02:45:48 +04:00
|
|
|
#include "opal/threads/mutex.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "orte/mca/ns/ns_types.h"
|
2005-03-14 23:57:21 +03:00
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
2005-07-03 20:06:07 +04:00
|
|
|
OMPI_DECLSPEC extern opal_class_t ompi_proc_t_class;
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
struct ompi_proc_t {
|
2005-07-15 02:43:01 +04:00
|
|
|
/** allow proc to be placed on a list */
|
|
|
|
opal_list_item_t super;
|
|
|
|
/** this process' name */
|
2005-03-14 23:57:21 +03:00
|
|
|
orte_process_name_t proc_name;
|
2006-07-04 05:20:20 +04:00
|
|
|
/** BML specific proc data */
|
|
|
|
struct mca_bml_base_endpoint_t* proc_bml;
|
2005-07-15 02:43:01 +04:00
|
|
|
/** PML specific proc data */
|
2006-07-04 05:20:20 +04:00
|
|
|
struct mca_pml_base_endpoint_t* proc_pml;
|
2005-07-15 02:43:01 +04:00
|
|
|
/** MCA module exchange data */
|
|
|
|
opal_object_t* proc_modex;
|
|
|
|
/** architecture of this process */
|
2004-10-13 01:50:25 +04:00
|
|
|
uint32_t proc_arch;
|
2005-07-15 02:43:01 +04:00
|
|
|
/** process-wide convertor */
|
2004-11-05 10:52:30 +03:00
|
|
|
struct ompi_convertor_t* proc_convertor;
|
2005-07-15 02:43:01 +04:00
|
|
|
/** process-wide lock */
|
2005-07-04 02:45:48 +04:00
|
|
|
opal_mutex_t proc_lock;
|
2006-05-11 23:46:21 +04:00
|
|
|
/** Keep the hostname around for debugging purposes */
|
|
|
|
char *proc_hostname;
|
2005-07-15 02:43:01 +04:00
|
|
|
/** flags for this proc */
|
|
|
|
uint8_t proc_flags;
|
2004-01-10 01:09:51 +03:00
|
|
|
};
|
2005-07-15 02:43:01 +04:00
|
|
|
/**
|
|
|
|
* Convenience typedef
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
typedef struct ompi_proc_t ompi_proc_t;
|
2004-10-28 22:13:43 +04:00
|
|
|
OMPI_DECLSPEC extern ompi_proc_t* ompi_proc_local_proc;
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2005-07-15 02:43:01 +04:00
|
|
|
/*
|
|
|
|
* Flags
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flag to indicate that the proc is on the same node as the local proc
|
|
|
|
*/
|
|
|
|
#define OMPI_PROC_FLAG_LOCAL 0x01
|
|
|
|
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/**
|
|
|
|
* Query the run-time environment and build list of available proc instances.
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
int ompi_proc_init(void);
|
2004-02-13 16:56:55 +03:00
|
|
|
|
2004-12-02 16:28:10 +03:00
|
|
|
/**
|
|
|
|
* Release the processes at the end of the application
|
|
|
|
*/
|
|
|
|
int ompi_proc_finalize(void);
|
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/**
|
|
|
|
* Returns the list of proc instances associated with this job.
|
|
|
|
*/
|
2007-02-27 18:17:17 +03:00
|
|
|
OMPI_DECLSPEC ompi_proc_t** ompi_proc_world(size_t* size);
|
2004-02-13 16:56:55 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the list of all known proc instances.
|
|
|
|
*/
|
2007-02-27 18:17:17 +03:00
|
|
|
OMPI_DECLSPEC ompi_proc_t** ompi_proc_all(size_t* size);
|
2004-02-13 16:56:55 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a list (of one) proc instances.
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
ompi_proc_t** ompi_proc_self(size_t* size);
|
2004-01-29 18:34:47 +03:00
|
|
|
|
2004-02-13 16:56:55 +03:00
|
|
|
/**
|
|
|
|
* Returns the proc instance corresponding to the local proc.
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
static inline ompi_proc_t* ompi_proc_local(void)
|
2004-10-28 22:13:43 +04:00
|
|
|
{
|
2004-06-07 19:33:53 +04:00
|
|
|
return ompi_proc_local_proc;
|
2004-01-29 18:34:47 +03:00
|
|
|
}
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2004-05-18 01:28:32 +04:00
|
|
|
/**
|
2004-07-01 18:49:54 +04:00
|
|
|
* Returns the proc instance for a given name
|
2004-05-18 01:28:32 +04:00
|
|
|
*/
|
2005-03-14 23:57:21 +03:00
|
|
|
ompi_proc_t * ompi_proc_find ( const orte_process_name_t* name );
|
2004-05-18 01:28:32 +04:00
|
|
|
|
2004-08-04 21:05:22 +04:00
|
|
|
|
2004-09-17 14:10:24 +04:00
|
|
|
|
2004-08-04 21:05:22 +04:00
|
|
|
/**
|
|
|
|
* INPUT: ompi_proc_t **proclist : list of process pointers
|
|
|
|
* INPUT: int proclistsize : lenght of the proclist array
|
2005-03-14 23:57:21 +03:00
|
|
|
* IN/OUT: orte_buffer_t *buf : an orte_buffer containing the packed names
|
2004-09-16 14:07:14 +04:00
|
|
|
*
|
Clean up the way procs are added to the global process list after MPI_INIT:
* Do not add new procs to the global list during modex callback or
when sharing orte names during accept/connect. For modex, we
cache the modex info for later, in case that proc ever does get
added to the global proc list. For accept/connect orte name
exchange between the roots, we only need the orte name, so no
need to add a proc structure anyway. The procs will be added
to the global process list during the proc exchange later in
the wireup process
* Rename proc_get_namebuf and proc_get_proclist to proc_pack
and proc_unpack and extend them to include all information
needed to build that proc struct on a remote node (which
includes ORTE name, architecture, and hostname). Change
unpack to call pml_add_procs for the entire list of new
procs at once, rather than one at a time.
* Remove ompi_proc_find_and_add from the public proc
interface and make it a private function. This function
would add a half-created proc to the global proc list, so
making it harder to call is a good thing.
This means that there's only two ways to add new procs into the global proc list at this time: During MPI_INIT via the call to ompi_proc_init, where my job is added to the list and via ompi_proc_unpack using a buffer from a packed proc list sent to us by someone else. Currently, this is enough to implement MPI semantics. We can extend the interface more if we like, but that may require HNP communication to get the remote proc information and I wanted to avoid that if at all possible.
Refs trac:564
This commit was SVN r12798.
The following Trac tickets were found above:
Ticket 564 --> https://svn.open-mpi.org/trac/ompi/ticket/564
2006-12-07 22:56:54 +03:00
|
|
|
* This function takes a list of ompi_proc_t pointers (e.g. as given
|
|
|
|
* in groups) and returns a orte buffer containing all information
|
|
|
|
* needed to add the proc to a remote list. This includes the ORTE
|
|
|
|
* process name, the architecture, and the hostname. Ordering is
|
|
|
|
* maintained. The buffer is packed to be sent to a remote node with
|
|
|
|
* different architecture (endian or word size). The buffer can be
|
|
|
|
* dss unloaded to be sent using MPI or send using rml_send_packed.
|
2004-08-04 21:05:22 +04:00
|
|
|
*
|
|
|
|
* Return values:
|
|
|
|
* OMPI_SUCCESS on success
|
|
|
|
* OMPI_ERROR: other errors
|
|
|
|
*/
|
Clean up the way procs are added to the global process list after MPI_INIT:
* Do not add new procs to the global list during modex callback or
when sharing orte names during accept/connect. For modex, we
cache the modex info for later, in case that proc ever does get
added to the global proc list. For accept/connect orte name
exchange between the roots, we only need the orte name, so no
need to add a proc structure anyway. The procs will be added
to the global process list during the proc exchange later in
the wireup process
* Rename proc_get_namebuf and proc_get_proclist to proc_pack
and proc_unpack and extend them to include all information
needed to build that proc struct on a remote node (which
includes ORTE name, architecture, and hostname). Change
unpack to call pml_add_procs for the entire list of new
procs at once, rather than one at a time.
* Remove ompi_proc_find_and_add from the public proc
interface and make it a private function. This function
would add a half-created proc to the global proc list, so
making it harder to call is a good thing.
This means that there's only two ways to add new procs into the global proc list at this time: During MPI_INIT via the call to ompi_proc_init, where my job is added to the list and via ompi_proc_unpack using a buffer from a packed proc list sent to us by someone else. Currently, this is enough to implement MPI semantics. We can extend the interface more if we like, but that may require HNP communication to get the remote proc information and I wanted to avoid that if at all possible.
Refs trac:564
This commit was SVN r12798.
The following Trac tickets were found above:
Ticket 564 --> https://svn.open-mpi.org/trac/ompi/ticket/564
2006-12-07 22:56:54 +03:00
|
|
|
int ompi_proc_pack(ompi_proc_t **proclist, int proclistsize,
|
|
|
|
orte_buffer_t *buf);
|
2004-08-04 21:05:22 +04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2005-03-14 23:57:21 +03:00
|
|
|
* INPUT: orte_buffer_t *buf : orte_buffer containing the packed names
|
2004-08-04 21:05:22 +04:00
|
|
|
* INPUT: int proclistsize : number of expected proc-pointres
|
|
|
|
* OUTPUT: ompi_proc_t ***proclist : list of process pointers
|
|
|
|
*
|
Clean up the way procs are added to the global process list after MPI_INIT:
* Do not add new procs to the global list during modex callback or
when sharing orte names during accept/connect. For modex, we
cache the modex info for later, in case that proc ever does get
added to the global proc list. For accept/connect orte name
exchange between the roots, we only need the orte name, so no
need to add a proc structure anyway. The procs will be added
to the global process list during the proc exchange later in
the wireup process
* Rename proc_get_namebuf and proc_get_proclist to proc_pack
and proc_unpack and extend them to include all information
needed to build that proc struct on a remote node (which
includes ORTE name, architecture, and hostname). Change
unpack to call pml_add_procs for the entire list of new
procs at once, rather than one at a time.
* Remove ompi_proc_find_and_add from the public proc
interface and make it a private function. This function
would add a half-created proc to the global proc list, so
making it harder to call is a good thing.
This means that there's only two ways to add new procs into the global proc list at this time: During MPI_INIT via the call to ompi_proc_init, where my job is added to the list and via ompi_proc_unpack using a buffer from a packed proc list sent to us by someone else. Currently, this is enough to implement MPI semantics. We can extend the interface more if we like, but that may require HNP communication to get the remote proc information and I wanted to avoid that if at all possible.
Refs trac:564
This commit was SVN r12798.
The following Trac tickets were found above:
Ticket 564 --> https://svn.open-mpi.org/trac/ompi/ticket/564
2006-12-07 22:56:54 +03:00
|
|
|
* This function unpacks a packed list of ompi_proc_t structures and
|
|
|
|
* returns the ordered list of proc structures. If the given proc is
|
|
|
|
* already "known", the architecture and hostname information in the
|
|
|
|
* buffer is ignored. If the proc is "new" to this process, it will
|
|
|
|
* be added to the global list of known procs, with information
|
|
|
|
* provided in the buffer. The lookup actions are always entirely
|
|
|
|
* local. The proclist returned is a list of pointers to all procs in
|
|
|
|
* the buffer, whether they were previously known or are new to this
|
|
|
|
* process. PML_ADD_PROCS will be called on the list of new processes
|
|
|
|
* discovered during this operation.
|
2004-08-04 21:05:22 +04:00
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* OMPI_SUCCESS on success
|
|
|
|
* OMPI_ERROR else
|
|
|
|
*/
|
Clean up the way procs are added to the global process list after MPI_INIT:
* Do not add new procs to the global list during modex callback or
when sharing orte names during accept/connect. For modex, we
cache the modex info for later, in case that proc ever does get
added to the global proc list. For accept/connect orte name
exchange between the roots, we only need the orte name, so no
need to add a proc structure anyway. The procs will be added
to the global process list during the proc exchange later in
the wireup process
* Rename proc_get_namebuf and proc_get_proclist to proc_pack
and proc_unpack and extend them to include all information
needed to build that proc struct on a remote node (which
includes ORTE name, architecture, and hostname). Change
unpack to call pml_add_procs for the entire list of new
procs at once, rather than one at a time.
* Remove ompi_proc_find_and_add from the public proc
interface and make it a private function. This function
would add a half-created proc to the global proc list, so
making it harder to call is a good thing.
This means that there's only two ways to add new procs into the global proc list at this time: During MPI_INIT via the call to ompi_proc_init, where my job is added to the list and via ompi_proc_unpack using a buffer from a packed proc list sent to us by someone else. Currently, this is enough to implement MPI semantics. We can extend the interface more if we like, but that may require HNP communication to get the remote proc information and I wanted to avoid that if at all possible.
Refs trac:564
This commit was SVN r12798.
The following Trac tickets were found above:
Ticket 564 --> https://svn.open-mpi.org/trac/ompi/ticket/564
2006-12-07 22:56:54 +03:00
|
|
|
int ompi_proc_unpack(orte_buffer_t *buf, int proclistsize, ompi_proc_t ***proclist);
|
2004-08-04 21:05:22 +04:00
|
|
|
|
|
|
|
|
2004-10-21 02:31:03 +04:00
|
|
|
#if defined(c_plusplus) || defined(__cplusplus)
|
|
|
|
}
|
|
|
|
#endif
|
2004-06-07 19:33:53 +04:00
|
|
|
#endif /* OMPI_PROC */
|
2004-01-10 01:09:51 +03:00
|
|
|
|