blob: b7732d53861cc9a2dfcbf0eb8a5a57101f3193b1 [file] [log] [blame]
.\"Copyright 2008-2010 IBM Corp.
.TH SCI_Group_create 3 "Dec 4, 2009" "1.0.0" "SCI"
.SH NAME
\fBSCI_Group_create\fP \- Create a new group from a back end list
.SH SYNTAX
.ft R
.SH C Syntax
.nf
#include <sci.h>
int SCI_Group_create(int \fInum_bes\fP, int *\fIbe_list\fP, sci_group_t *\fIgroup\fP)
.SH INPUT PARAMETERS
.ft R
.TP 1i
num_bes
Number of back ends in the new group (IN).
.TP 1i
be_list
The back end id list of the new group (IN).
.TP 1i
group
The output group (OUT).
.SH DESCRIPTION
.ft R
This subroutine is used to create a new group from a back end list, the list contains
existed back end ids. The new \fIgroup\fP can be used for \fBSCI_Bcast\fP to specify
destination receivers.
.sp
This is a blocking call. The caller can assume \fIgroup\fP is ready to use upon the return
of the function.
.sp
For more information, please refer to SCI's online documents.
.SH EXAMPLE
.ft R
.nf
{
int i, num_bes;
sci_group_t odd_group, even_group;
int odd_size, even_size;
...
SCI_Query(NUM_BACKENDS, &num_bes);
odd_size = (num_bes - num_bes%2) / 2;
odd_list = (int *)malloc(sizeof(int) * odd_size);
for (i=0; i<odd_size; i++) {
odd_list[i] = i*2 + 1;
}
SCI_Group_create(odd_size, odd_list, &odd_group);
even_size = (num_bes + num_bes%2) / 2;
even_list = (int *)malloc(sizeof(int) * even_size);
for (i=0; i<even_size; i++) {
even_list[i] = i*2;
}
SCI_Group_create(even_size, even_list, &even_group);
}
.fi
.SH ERRORS
.ft R
All SCI routines return an error value.
.sp
.TP 1i
SCI_ERR_UNINTIALIZED
Uninitialized SCI execution environment
.TP 1i
SCI_ERR_INVALID_CALLER
Can only be called in the front end
.TP 1i
SCI_ERR_BACKEND_NOTFOUND
The back end id list contains non-existed back end id
.TP 1i
SCI_ERR_NO_MEM
Out of memory
.SH SEE ALSO
.ft R
.nf
\fBSCI_Group_free\fP(3)
\fBSCI_Group_operate\fP(3)
\fBSCI_Group_operate_ext\fP(3)