2005-06-28 01:21:15 +04:00
|
|
|
/*
|
2007-03-17 02:11:45 +03:00
|
|
|
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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.
|
2005-06-28 01:21:15 +04:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
#include <string.h>
|
This commit represents a bunch of work on a Mercurial side branch. As
such, the commit message back to the master SVN repository is fairly
long.
= ORTE Job-Level Output Messages =
Add two new interfaces that should be used for all new code throughout
the ORTE and OMPI layers (we already make the search-and-replace on
the existing ORTE / OMPI layers):
* orte_output(): (and corresponding friends ORTE_OUTPUT,
orte_output_verbose, etc.) This function sends the output directly
to the HNP for processing as part of a job-specific output
channel. It supports all the same outputs as opal_output()
(syslog, file, stdout, stderr), but for stdout/stderr, the output
is sent to the HNP for processing and output. More on this below.
* orte_show_help(): This function is a drop-in-replacement for
opal_show_help(), with two differences in functionality:
1. the rendered text help message output is sent to the HNP for
display (rather than outputting directly into the process' stderr
stream)
1. the HNP detects duplicate help messages and does not display them
(so that you don't see the same error message N times, once from
each of your N MPI processes); instead, it counts "new" instances
of the help message and displays a message every ~5 seconds when
there are new ones ("I got X new copies of the help message...")
opal_show_help and opal_output still exist, but they only output in
the current process. The intent for the new orte_* functions is that
they can apply job-level intelligence to the output. As such, we
recommend that all new ORTE and OMPI code use the new orte_*
functions, not thei opal_* functions.
=== New code ===
For ORTE and OMPI programmers, here's what you need to do differently
in new code:
* Do not include opal/util/show_help.h or opal/util/output.h.
Instead, include orte/util/output.h (this one header file has
declarations for both the orte_output() series of functions and
orte_show_help()).
* Effectively s/opal_output/orte_output/gi throughout your code.
Note that orte_output_open() takes a slightly different argument
list (as a way to pass data to the filtering stream -- see below),
so you if explicitly call opal_output_open(), you'll need to
slightly adapt to the new signature of orte_output_open().
* Literally s/opal_show_help/orte_show_help/. The function signature
is identical.
=== Notes ===
* orte_output'ing to stream 0 will do similar to what
opal_output'ing did, so leaving a hard-coded "0" as the first
argument is safe.
* For systems that do not use ORTE's RML or the HNP, the effect of
orte_output_* and orte_show_help will be identical to their opal
counterparts (the additional information passed to
orte_output_open() will be lost!). Indeed, the orte_* functions
simply become trivial wrappers to their opal_* counterparts. Note
that we have not tested this; the code is simple but it is quite
possible that we mucked something up.
= Filter Framework =
Messages sent view the new orte_* functions described above and
messages output via the IOF on the HNP will now optionally be passed
through a new "filter" framework before being output to
stdout/stderr. The "filter" OPAL MCA framework is intended to allow
preprocessing to messages before they are sent to their final
destinations. The first component that was written in the filter
framework was to create an XML stream, segregating all the messages
into different XML tags, etc. This will allow 3rd party tools to read
the stdout/stderr from the HNP and be able to know exactly what each
text message is (e.g., a help message, another OMPI infrastructure
message, stdout from the user process, stderr from the user process,
etc.).
Filtering is not active by default. Filter components must be
specifically requested, such as:
{{{
$ mpirun --mca filter xml ...
}}}
There can only be one filter component active.
= New MCA Parameters =
The new functionality described above introduces two new MCA
parameters:
* '''orte_base_help_aggregate''': Defaults to 1 (true), meaning that
help messages will be aggregated, as described above. If set to 0,
all help messages will be displayed, even if they are duplicates
(i.e., the original behavior).
* '''orte_base_show_output_recursions''': An MCA parameter to help
debug one of the known issues, described below. It is likely that
this MCA parameter will disappear before v1.3 final.
= Known Issues =
* The XML filter component is not complete. The current output from
this component is preliminary and not real XML. A bit more work
needs to be done to configure.m4 search for an appropriate XML
library/link it in/use it at run time.
* There are possible recursion loops in the orte_output() and
orte_show_help() functions -- e.g., if RML send calls orte_output()
or orte_show_help(). We have some ideas how to fix these, but
figured that it was ok to commit before feature freeze with known
issues. The code currently contains sub-optimal workarounds so
that this will not be a problem, but it would be good to actually
solve the problem rather than have hackish workarounds before v1.3 final.
This commit was SVN r18434.
2008-05-14 00:00:55 +04:00
|
|
|
#include "orte/util/output.h"
|
2005-07-04 05:36:20 +04:00
|
|
|
#include "opal/util/if.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/mca/pml/pml.h"
|
|
|
|
#include "ompi/mca/btl/btl.h"
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
#include "btl_template.h"
|
|
|
|
#include "btl_template_frag.h"
|
|
|
|
#include "btl_template_proc.h"
|
|
|
|
#include "btl_template_endpoint.h"
|
2006-02-12 04:33:29 +03:00
|
|
|
#include "ompi/datatype/convertor.h"
|
|
|
|
#include "ompi/mca/mpool/base/base.h"
|
|
|
|
#include "ompi/mca/mpool/mpool.h"
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_module_t mca_btl_template_module = {
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
&mca_btl_template_component.super,
|
2005-06-28 01:21:15 +04:00
|
|
|
0, /* max size of first fragment */
|
|
|
|
0, /* min send fragment size */
|
|
|
|
0, /* max send fragment size */
|
2007-05-24 23:51:26 +04:00
|
|
|
0, /* rdma pipeline offset */
|
|
|
|
0, /* rdma pipeline frag size */
|
|
|
|
0, /* min rdma pipeline size */
|
2005-06-28 01:21:15 +04:00
|
|
|
0, /* exclusivity */
|
|
|
|
0, /* latency */
|
|
|
|
0, /* bandwidth */
|
|
|
|
0, /* flags */
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_add_procs,
|
|
|
|
mca_btl_template_del_procs,
|
2006-08-17 00:21:38 +04:00
|
|
|
mca_btl_template_register,
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_finalize,
|
|
|
|
mca_btl_template_alloc,
|
|
|
|
mca_btl_template_free,
|
|
|
|
mca_btl_template_prepare_src,
|
|
|
|
mca_btl_template_prepare_dst,
|
|
|
|
mca_btl_template_send,
|
|
|
|
mca_btl_template_put,
|
2006-08-18 02:02:01 +04:00
|
|
|
NULL, /* get */
|
|
|
|
NULL, /*dump */
|
|
|
|
NULL, /* mpool */
|
2007-03-17 02:11:45 +03:00
|
|
|
NULL, /* register error cb */
|
|
|
|
mca_btl_template_ft_event
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_add_procs(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
2005-06-28 01:21:15 +04:00
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t **ompi_procs,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t** peers,
|
2005-06-28 01:21:15 +04:00
|
|
|
ompi_bitmap_t* reachable)
|
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*)btl;
|
2005-06-28 01:21:15 +04:00
|
|
|
int i, rc;
|
|
|
|
|
|
|
|
for(i = 0; i < (int) nprocs; i++) {
|
|
|
|
|
|
|
|
struct ompi_proc_t* ompi_proc = ompi_procs[i];
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_proc_t* template_proc;
|
|
|
|
mca_btl_base_endpoint_t* template_endpoint;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2006-12-17 20:27:08 +03:00
|
|
|
#if 0
|
|
|
|
/* If the BTL doesn't support heterogeneous operations, be
|
|
|
|
sure to say we can't reach that proc */
|
|
|
|
if (ompi_proc_local()->proc_arch != ompi_proc->proc_arch) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
if(NULL == (template_proc = mca_btl_template_proc_create(ompi_proc))) {
|
2005-06-28 01:21:15 +04:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Check to make sure that the peer has at least as many interface
|
|
|
|
* addresses exported as we are trying to use. If not, then
|
|
|
|
* don't bind this PTL instance to the proc.
|
|
|
|
*/
|
|
|
|
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_LOCK(&template_proc->proc_lock);
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
/* The btl_proc datastructure is shared by all TEMPLATE PTL
|
2005-06-28 01:21:15 +04:00
|
|
|
* instances that are trying to reach this destination.
|
2005-06-30 09:50:55 +04:00
|
|
|
* Cache the peer instance on the btl_proc.
|
2005-06-28 01:21:15 +04:00
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
template_endpoint = OBJ_NEW(mca_btl_template_endpoint_t);
|
2005-06-28 01:21:15 +04:00
|
|
|
if(NULL == template_endpoint) {
|
2005-08-14 23:03:09 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&template_proc->proc_lock);
|
2005-06-28 01:21:15 +04:00
|
|
|
return OMPI_ERR_OUT_OF_RESOURCE;
|
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
template_endpoint->endpoint_btl = template_btl;
|
|
|
|
rc = mca_btl_template_proc_insert(template_proc, template_endpoint);
|
2005-06-28 01:21:15 +04:00
|
|
|
if(rc != OMPI_SUCCESS) {
|
|
|
|
OBJ_RELEASE(template_endpoint);
|
2005-08-14 23:03:09 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&template_proc->proc_lock);
|
2005-06-28 01:21:15 +04:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
ompi_bitmap_set_bit(reachable, i);
|
2005-08-14 23:03:09 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&template_proc->proc_lock);
|
2005-06-28 01:21:15 +04:00
|
|
|
peers[i] = template_endpoint;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_del_procs(struct mca_btl_base_module_t* btl,
|
2005-06-28 01:21:15 +04:00
|
|
|
size_t nprocs,
|
|
|
|
struct ompi_proc_t **procs,
|
2005-06-30 09:50:55 +04:00
|
|
|
struct mca_btl_base_endpoint_t ** peers)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
|
|
|
/* TODO */
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register callback function to support send/recv semantics
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_register(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_tag_t tag,
|
|
|
|
mca_btl_base_module_recv_cb_fn_t cbfunc,
|
2005-06-28 01:21:15 +04:00
|
|
|
void* cbdata)
|
|
|
|
{
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Allocate a segment.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
2005-06-28 01:21:15 +04:00
|
|
|
* @param size (IN) Request segment size.
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t* mca_btl_template_alloc(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
2007-12-09 17:00:42 +03:00
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t size,
|
|
|
|
uint32_t flags)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
|
|
|
|
mca_btl_template_frag_t* frag;
|
2005-06-28 01:21:15 +04:00
|
|
|
int rc;
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
if(size <= btl->btl_eager_limit){
|
|
|
|
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(template_btl, frag, rc);
|
2005-06-28 01:21:15 +04:00
|
|
|
frag->segment.seg_len =
|
2005-06-30 09:50:55 +04:00
|
|
|
size <= btl->btl_eager_limit ?
|
|
|
|
size : btl->btl_eager_limit ;
|
2005-06-28 01:21:15 +04:00
|
|
|
} else {
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(template_btl, frag, rc);
|
2005-06-28 01:21:15 +04:00
|
|
|
frag->segment.seg_len =
|
2005-06-30 09:50:55 +04:00
|
|
|
size <= btl->btl_max_send_size ?
|
|
|
|
size : btl->btl_max_send_size ;
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
frag->base.des_flags = 0;
|
2005-06-30 09:50:55 +04:00
|
|
|
return (mca_btl_base_descriptor_t*)frag;
|
2005-06-28 01:21:15 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return a segment
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_free(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_descriptor_t* des)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*)des;
|
2005-06-28 01:21:15 +04:00
|
|
|
if(frag->size == 0) {
|
2005-06-30 09:50:55 +04:00
|
|
|
#if MCA_BTL_HAS_MPOOL
|
2005-06-28 01:21:15 +04:00
|
|
|
OBJ_RELEASE(frag->registration);
|
|
|
|
#endif
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_RETURN_USER(btl, frag);
|
|
|
|
} else if(frag->size == btl->btl_eager_limit){
|
|
|
|
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
|
|
|
|
} else if(frag->size == btl->btl_max_send_size) {
|
|
|
|
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
|
2005-06-28 01:21:15 +04:00
|
|
|
} else {
|
|
|
|
return OMPI_ERR_BAD_PARAM;
|
|
|
|
}
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pack data and return a descriptor that can be
|
|
|
|
* used for send/put.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param peer (IN) BTL peer addressing
|
2005-06-28 01:21:15 +04:00
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t* mca_btl_template_prepare_src(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
2005-06-28 01:21:15 +04:00
|
|
|
struct mca_mpool_base_registration_t* registration,
|
|
|
|
struct ompi_convertor_t* convertor,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-28 01:21:15 +04:00
|
|
|
size_t reserve,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t* size,
|
|
|
|
uint32_t flags
|
2005-06-28 01:21:15 +04:00
|
|
|
)
|
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_frag_t* frag;
|
2005-06-28 01:21:15 +04:00
|
|
|
struct iovec iov;
|
|
|
|
uint32_t iov_count = 1;
|
|
|
|
size_t max_data = *size;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* if we aren't pinning the data and the requested size is less
|
|
|
|
* than the eager limit pack into a fragment from the eager pool
|
|
|
|
*/
|
2005-06-30 09:50:55 +04:00
|
|
|
if (max_data+reserve <= btl->btl_eager_limit) {
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_ALLOC_EAGER(btl, frag, rc);
|
2005-06-28 01:21:15 +04:00
|
|
|
if(NULL == frag) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
iov.iov_len = max_data;
|
2007-01-05 01:07:37 +03:00
|
|
|
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2006-10-27 03:11:26 +04:00
|
|
|
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
|
2005-06-28 01:21:15 +04:00
|
|
|
*size = max_data;
|
|
|
|
if( rc < 0 ) {
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_RETURN_EAGER(btl, frag);
|
2005-06-28 01:21:15 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
frag->segment.seg_len = max_data + reserve;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* otherwise pack as much data as we can into a fragment
|
|
|
|
* that is the max send size.
|
|
|
|
*/
|
|
|
|
else {
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_ALLOC_MAX(btl, frag, rc);
|
2005-06-28 01:21:15 +04:00
|
|
|
if(NULL == frag) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
if(max_data + reserve > frag->size){
|
|
|
|
max_data = frag->size - reserve;
|
|
|
|
}
|
|
|
|
iov.iov_len = max_data;
|
2007-01-05 01:07:37 +03:00
|
|
|
iov.iov_base = (unsigned char*) frag->segment.seg_addr.pval + reserve;
|
2005-06-28 01:21:15 +04:00
|
|
|
|
2006-10-27 03:11:26 +04:00
|
|
|
rc = ompi_convertor_pack(convertor, &iov, &iov_count, &max_data );
|
2005-06-28 01:21:15 +04:00
|
|
|
*size = max_data;
|
|
|
|
|
|
|
|
if( rc < 0 ) {
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_RETURN_MAX(btl, frag);
|
2005-06-28 01:21:15 +04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
frag->segment.seg_len = max_data + reserve;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag->base.des_src = &frag->segment;
|
|
|
|
frag->base.des_src_cnt = 1;
|
|
|
|
frag->base.des_dst = NULL;
|
|
|
|
frag->base.des_dst_cnt = 0;
|
|
|
|
frag->base.des_flags = 0;
|
|
|
|
return &frag->base;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prepare a descriptor for send/rdma using the supplied
|
|
|
|
* convertor. If the convertor references data that is contigous,
|
|
|
|
* the descriptor may simply point to the user buffer. Otherwise,
|
|
|
|
* this routine is responsible for allocating buffer space and
|
|
|
|
* packing if required.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL peer addressing
|
2005-06-28 01:21:15 +04:00
|
|
|
* @param convertor (IN) Data type convertor
|
|
|
|
* @param reserve (IN) Additional bytes requested by upper layer to precede user data
|
|
|
|
* @param size (IN/OUT) Number of bytes to prepare (IN), number of bytes actually prepared (OUT)
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_base_descriptor_t* mca_btl_template_prepare_dst(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
2005-06-28 01:21:15 +04:00
|
|
|
struct mca_mpool_base_registration_t* registration,
|
|
|
|
struct ompi_convertor_t* convertor,
|
2007-05-24 23:51:26 +04:00
|
|
|
uint8_t order,
|
2005-06-28 01:21:15 +04:00
|
|
|
size_t reserve,
|
2007-12-09 17:08:01 +03:00
|
|
|
size_t* size,
|
|
|
|
uint32_t flags)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_frag_t* frag;
|
2005-06-28 01:21:15 +04:00
|
|
|
int rc;
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
MCA_BTL_TEMPLATE_FRAG_ALLOC_USER(btl, frag, rc);
|
2005-06-28 01:21:15 +04:00
|
|
|
if(NULL == frag) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
frag->segment.seg_len = *size;
|
2007-03-31 02:02:45 +04:00
|
|
|
ompi_convertor_get_current_pointer( convertor, (void**)&(frag->segment.seg_addr.pval) );
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
frag->base.des_src = NULL;
|
|
|
|
frag->base.des_src_cnt = 0;
|
|
|
|
frag->base.des_dst = &frag->segment;
|
|
|
|
frag->base.des_dst_cnt = 1;
|
|
|
|
frag->base.des_flags = 0;
|
|
|
|
return &frag->base;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate an asynchronous send.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
2005-06-28 01:21:15 +04:00
|
|
|
* @param descriptor (IN) Description of the data to be transfered
|
|
|
|
* @param tag (IN) The tag value used to notify the peer.
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_send(
|
|
|
|
struct mca_btl_base_module_t* btl,
|
|
|
|
struct mca_btl_base_endpoint_t* endpoint,
|
|
|
|
struct mca_btl_base_descriptor_t* descriptor,
|
|
|
|
mca_btl_base_tag_t tag)
|
2005-06-28 01:21:15 +04:00
|
|
|
|
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
|
|
|
|
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*)descriptor;
|
2005-06-28 01:21:15 +04:00
|
|
|
frag->endpoint = endpoint;
|
|
|
|
/* TODO */
|
|
|
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate an asynchronous put.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
2005-06-28 01:21:15 +04:00
|
|
|
* @param descriptor (IN) Description of the data to be transferred
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_put(
|
|
|
|
mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_endpoint_t* endpoint,
|
|
|
|
mca_btl_base_descriptor_t* descriptor)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
|
|
|
|
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*) descriptor;
|
2005-06-28 01:21:15 +04:00
|
|
|
frag->endpoint = endpoint;
|
|
|
|
/* TODO */
|
|
|
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initiate an asynchronous get.
|
|
|
|
*
|
2005-06-30 09:50:55 +04:00
|
|
|
* @param btl (IN) BTL module
|
|
|
|
* @param endpoint (IN) BTL addressing information
|
2005-06-28 01:21:15 +04:00
|
|
|
* @param descriptor (IN) Description of the data to be transferred
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_get(
|
|
|
|
mca_btl_base_module_t* btl,
|
|
|
|
mca_btl_base_endpoint_t* endpoint,
|
|
|
|
mca_btl_base_descriptor_t* descriptor)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
/* mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl; */
|
|
|
|
mca_btl_template_frag_t* frag = (mca_btl_template_frag_t*) descriptor;
|
2005-06-28 01:21:15 +04:00
|
|
|
frag->endpoint = endpoint;
|
|
|
|
/* TODO */
|
|
|
|
return OMPI_ERR_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cleanup/release module resources.
|
|
|
|
*/
|
|
|
|
|
2005-06-30 09:50:55 +04:00
|
|
|
int mca_btl_template_finalize(struct mca_btl_base_module_t* btl)
|
2005-06-28 01:21:15 +04:00
|
|
|
{
|
2005-06-30 09:50:55 +04:00
|
|
|
mca_btl_template_module_t* template_btl = (mca_btl_template_module_t*) btl;
|
|
|
|
OBJ_DESTRUCT(&template_btl->template_lock);
|
|
|
|
OBJ_DESTRUCT(&template_btl->template_frag_eager);
|
|
|
|
OBJ_DESTRUCT(&template_btl->template_frag_max);
|
|
|
|
OBJ_DESTRUCT(&template_btl->template_frag_user);
|
|
|
|
free(template_btl);
|
2005-06-28 01:21:15 +04:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2007-03-17 02:11:45 +03:00
|
|
|
int mca_btl_template_ft_event(int state) {
|
|
|
|
if(OPAL_CRS_CHECKPOINT == state) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else if(OPAL_CRS_CONTINUE == state) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else if(OPAL_CRS_RESTART == state) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else if(OPAL_CRS_TERM == state ) {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|