NewMadeleine

Documentation

Session interface

This is the session interface, the nmad interface used to build sessions. More...

Typedefs

typedef struct nm_session_snm_session_t
 
typedef nm_drv_vect_t(* nm_session_selector_t) (const char *url, void *_arg)
 Type for 'selector'. More...
 

Functions

int nm_session_create (nm_session_t *pp_session, const char *label)
 Create an empty session object. More...
 
struct nm_corenm_session_get_core (nm_session_t p_session)
 
int nm_session_open (nm_session_t *pp_session, const char *label)
 Open a new session, assuming processes are already connected. More...
 
nm_drv_t nm_session_add_driver (puk_component_t component, nm_trk_kind_t kind)
 Add a driver to the session. More...
 
void nm_session_set_selector (nm_session_selector_t selector, void *_arg)
 Declare the selector to use to establish connections. More...
 
void nm_session_set_launcher_info (int size, int rank, int wide_url_support)
 Declare the rank & size of session as a hint. More...
 
int nm_session_init (nm_session_t p_session, const char **p_local_url)
 Initializes a session object. More...
 
int nm_session_connect (nm_session_t p_session, nm_gate_t *pp_gate, const char *remote_url)
 Connect the given gate. More...
 
int nm_session_connect_async (nm_session_t p_session, nm_gate_t *pp_gate, const char *remote_url)
 Asynchronously start connection establishment. More...
 
int nm_session_connect_wait (nm_session_t p_session, nm_gate_t p_gate)
 Wait for a given async connection to get ready. More...
 
int nm_session_destroy (nm_session_t p_session)
 Disconnect and destroy a session. More...
 
nm_session_t nm_session_lookup (nm_session_hash_t hashcode)
 Lookup a session by hashcode. More...
 
const char * nm_session_get_name (nm_session_t p_session)
 Get the name of the given session. More...
 
int nm_session_homogeneous_network (void)
 Checks whether the networks are homogeneous across all nodes. More...
 

Detailed Description

This is the session interface, the nmad interface used to build sessions.

It loads drivers and established connections. It expects an external entity to exchange urls. End-users are supposed to use the 'launcher' interface, a higher level interface that manages url exchange for them.

Typedef Documentation

◆ nm_session_selector_t

typedef nm_drv_vect_t(* nm_session_selector_t) (const char *url, void *_arg)

Type for 'selector'.

Returns drivers to connect to given gate.

Definition at line 52 of file nm_session_interface.h.

◆ nm_session_t

typedef struct nm_session_s* nm_session_t

Definition at line 32 of file nm_session_interface.h.

Function Documentation

◆ nm_session_add_driver()

nm_drv_t nm_session_add_driver ( puk_component_t  component,
nm_trk_kind_t  kind 
)

Add a driver to the session.

Note
call to this function is optional. Default drivers will be loaded if no driver is loaded manually.

Referenced by nm_launcher_gates_populate_ns().

Here is the caller graph for this function:

◆ nm_session_connect()

int nm_session_connect ( nm_session_t  p_session,
nm_gate_t pp_gate,
const char *  remote_url 
)

Connect the given gate.

'remote_url' is the url returned by the nm_session_init on the given peer.

Note
this function is synchronous; the remote node must call this function at the same time with our url

◆ nm_session_connect_async()

int nm_session_connect_async ( nm_session_t  p_session,
nm_gate_t pp_gate,
const char *  remote_url 
)

Asynchronously start connection establishment.

Note
it is expected that, if async connection establishment is used, both nm_session_connect_wait() must be called.

◆ nm_session_connect_wait()

int nm_session_connect_wait ( nm_session_t  p_session,
nm_gate_t  p_gate 
)

Wait for a given async connection to get ready.

◆ nm_session_create()

int nm_session_create ( nm_session_t pp_session,
const char *  label 
)

Create an empty session object.

◆ nm_session_destroy()

int nm_session_destroy ( nm_session_t  p_session)

Disconnect and destroy a session.

◆ nm_session_get_core()

◆ nm_session_get_name()

const char * nm_session_get_name ( nm_session_t  p_session)

Get the name of the given session.

◆ nm_session_homogeneous_network()

int nm_session_homogeneous_network ( void  )

Checks whether the networks are homogeneous across all nodes.

◆ nm_session_init()

int nm_session_init ( nm_session_t  p_session,
const char **  p_local_url 
)

Initializes a session object.

'p_local_url' is a return parameter, pointing to an object allocated in the session- do not free nor modify!

◆ nm_session_lookup()

nm_session_t nm_session_lookup ( nm_session_hash_t  hashcode)

Lookup a session by hashcode.

◆ nm_session_open()

int nm_session_open ( nm_session_t pp_session,
const char *  label 
)

Open a new session, assuming processes are already connected.

◆ nm_session_set_launcher_info()

void nm_session_set_launcher_info ( int  size,
int  rank,
int  wide_url_support 
)

Declare the rank & size of session as a hint.

◆ nm_session_set_selector()

void nm_session_set_selector ( nm_session_selector_t  selector,
void *  _arg 
)

Declare the selector to use to establish connections.

Referenced by nm_launcher_gates_populate_ns().

Here is the caller graph for this function: