intercomm.h File Reference

#include "ezxml/ezxml.h"

Go to the source code of this file.

Data Structures

struct  IC_Program
struct  decomp_TREE
struct  IC_Desc
struct  IC_Region
struct  IC_Sched
struct  IC_XJDComp_node
struct  IC_XJDRgn_node
struct  IC_XJD

Typedefs

typedef decomp_TREE IC_Tree
typedef IC_XJDComp_node IC_XJDComponent
typedef IC_XJDRgn_node IC_XJDRegion

Enumerations

enum  { IC_ROW_MAJOR = 0, IC_COLUMN_MAJOR = 1 }

Functions

IC_ProgramIC_Init (char *name, int tasks, int rank)
IC_ProgramIC_Wait (char *name, int tasks)
int IC_Sync (IC_Program *myprog, IC_Program *prog)
IC_DescIC_Create_bdecomp_desc (int ndims, int *blocks, int *tasks, int count, int arrayOrder)
IC_DescIC_Create_ttable_desc (int *globals, int *locals, int *tasks, int count)
IC_TreeIC_Create_bdecomp_tree ()
void IC_Section (IC_Tree *root, int dim, int count, int *indices)
void IC_Partition (IC_Tree *root, int dim, int *block, int count, int *indices)
IC_DescIC_Verify_bdecomp_tree (IC_Tree *root, int ndims, int *size, int *tasks, int count, int arrayOrder)
IC_RegionIC_Create_block_region (int ndims, int *lower, int *upper, int *stride)
IC_RegionIC_Create_enum_region (int *indices, int count)
IC_SchedIC_Compute_schedule (IC_Program *myprog, IC_Program *prog, IC_Desc *desc, IC_Region **region_set, int set_size)
int IC_Send_TYPE (IC_Program *to, IC_Sched *sched, TYPE *data, int tag)
int IC_Recv_TYPE (IC_Program *from, IC_Sched *sched, TYPE *data, int tag)
void IC_Free_sched (IC_Sched *sched)
void IC_Free_region (IC_Region *region)
void IC_Free_desc (IC_Desc *desc)
void IC_Free_program (IC_Program *prog)
void IC_Quit (IC_Program *myprog)
void IC_Print_error (char *msg)
IC_XJDIC_Initialize (char *pName, int rank, char *xjdname, int *status)
void IC_Register_region (IC_XJD *xjd, IC_Region **rgnset, int set_size, char *set_name, IC_Desc *desc, void *local_data, int *status)
void IC_Commit_region (IC_XJD *xjd, int *status)
int IC_Export (IC_XJD *xjd, char *rgnset_name)
int IC_Import (IC_XJD *xjd, char *rgnset_name)
int IC_Bcast_local_TYPE (IC_Program *to, TYPE *data, int nelems, int tag)
int IC_Recv_local_TYPE (IC_Program *from, TYPE *data, int nelems, int tag)
int IC_Bcast_local (IC_XJD *xjd, char *rgnset_name, void *data, int nelems)
int IC_Recv_local (IC_XJD *xjd, char *rgnset_name, void *data, int nelems)
void IC_Finalize (IC_XJD *xjd, int *icsts)


Detailed Description

This is the public interface of InterComm.

Author:
Christian Hansen (chansen@cs.umd.edu) Il-Chul Yoon (iyoon@cs.umd.edu) University of Maryland, College Park

Typedef Documentation

typedef struct decomp_TREE IC_Tree
 

A partial decomposition descriptor

typedef struct IC_XJDComp_node IC_XJDComponent
 

An XJD component descriptor encapsulating an InterComm program. Created dynamically based on XJD file during IC_Initialize.

typedef struct IC_XJDRgn_node IC_XJDRegion
 

An XJD region descriptor encapsulating an InterComm connection between programs. Created dynamically based on XJD file during IC_Initialize. Note that a IC_XJDRegion is identified by (myname,myregionname, partnername, partnerregionname)


Enumeration Type Documentation

anonymous enum
 

Enumeration for column-major and row-major

Enumerator:
IC_ROW_MAJOR  specifying row major
IC_COLUMN_MAJOR  specifying column major


Function Documentation

int IC_Bcast_local IC_XJD xjd,
char *  rgnset_name,
void *  data,
int  nelems
 

Parameters:
xjd the InterComm application descriptor for programs and regions
rgnset_name name of the region set
data the data to broadcast
nelems the data size, which is required since we cannot compute data size for local block
Returns:
status

int IC_Bcast_local_TYPE IC_Program to,
TYPE *  data,
int  nelems,
int  tag
 

Broadcast a local array into all processes in other program. There is a broadcast call for each C TYPE (char, short, int, float, double).

  • int IC_Bcast_local_char(IC_Program* to, char* data, int nelems, int tag)
  • int IC_Bcast_local_short(IC_Program* to, short* data, int nelems, int tagt)
  • int IC_Bcast_local_int(IC_Program* to, int* data, int nelems, int tag)
  • int IC_Bcast_local_float(IC_Program* to, float* data, int nelems, int tag)
  • int IC_Bcast_local_double(IC_Program* to, double* data, int nelems, int tag)
    Parameters:
    to the receiving program
    data the array to broadcast
    nelems the number of elemens in the data
    tag a message tag
    Returns:
    status

void IC_Commit_region IC_XJD xjd,
int *  status
 

Build communication schedule for all the regions in my program

Parameters:
xjd the InterComm application descriptor for programs and regions
status status, if negative, indicates an error

IC_Sched* IC_Compute_schedule IC_Program myprog,
IC_Program prog,
IC_Desc desc,
IC_Region **  region_set,
int  set_size
 

Compute a schedule for the given regions

Parameters:
myprog a handle to this program
prog a handle to the other program
desc a decomposition descriptor
region_set a list of regions
set_size the number of regions
Returns:
the communication schedule

IC_Desc* IC_Create_bdecomp_desc int  ndims,
int *  blocks,
int *  tasks,
int  count,
int  arrayOrder
 

Create a block decomposition

Parameters:
ndims the number of dimensions
blocks an array of block bound specifications
tasks the task assignments for each block
count the number of blocks
arrayOrder specify whether it is row major or column major
Returns:
the decomposition descriptor

IC_Tree* IC_Create_bdecomp_tree  ) 
 

Allocate a partial decomposition

Returns:
the partial descriptor

IC_Region* IC_Create_block_region int  ndims,
int *  lower,
int *  upper,
int *  stride
 

Allocate a block region structure

Parameters:
ndims the number of dimensions
lower the lower bounds
upper the upper bounds
stride the stride
Returns:
the array region

IC_Region* IC_Create_enum_region int *  indices,
int  count
 

Allocate an enumeration region structure

Parameters:
indices a list of global indices
count the number of indices
Returns:
the array region

IC_Desc* IC_Create_ttable_desc int *  globals,
int *  locals,
int *  tasks,
int  count
 

Create a translation table

Parameters:
globals a list of global indices
locals the local index for each global index
tasks the task assignment for each global index
count the number of global indices
Returns:
the decomposition descriptor

int IC_Export IC_XJD xjd,
char *  rgnset_name
 

Export a region. This function does not need the destination program since it is described in the XJD file and the information becomes part of internal representation of programs and regions during the IC_Initialize.

Parameters:
xjd the InterComm application descriptor for programs and regions
rgnset_name name of the region set
Returns:
status

void IC_Finalize IC_XJD xjd,
int *  icsts
 

Release the allocated memory for internal representation of programs and regions.

Parameters:
xjd the InterComm application descriptor for programs and regions
icsts status, if negative, indicates an error

void IC_Free_desc IC_Desc desc  ) 
 

Frees a descriptor

Parameters:
desc an array partitioning descriptor

void IC_Free_program IC_Program prog  ) 
 

Fress a program handle

Parameters:
prog a program handle

void IC_Free_region IC_Region region  ) 
 

Frees a region

Parameters:
region an array region

void IC_Free_sched IC_Sched sched  ) 
 

Frees a schedule

Parameters:
sched a communication schedule

int IC_Import IC_XJD xjd,
char *  rgnset_name
 

Import a region. This function does not need the destination program since it is described in the XJD file and the information becomes part of internal representation of programs and regions during the IC_Initialize.

Parameters:
xjd the InterComm application descriptor for programs and regions
rgnset_name name of the region set
Returns:
status

IC_Program* IC_Init char *  name,
int  tasks,
int  rank
 

Initialize the communication library

Parameters:
name a unique program name
tasks the number of tasks in this program
rank the rank of this task
Returns:
a handle for this program

IC_XJD* IC_Initialize char *  pName,
int  rank,
char *  xjdname,
int *  status
 

This function initializes the underlying communication library and creates the internal representation of the programs and regions by parsing the given XML Job Description (XJD) file for further communication between the programs. Basically, this function encapsulates IC_Init, IC_Wait and IC_Sync.

Parameters:
pName my program name
rank my rank
xjdname XML Job Description (XJD) file name
status status, negative indicates an error
Returns:
a pointer to the IC_XJD datatype, which contains or will contain the program and region list.

void IC_Partition IC_Tree root,
int  dim,
int *  block,
int  count,
int *  indices
 

Create a partition for a partial descriptor

Parameters:
root the partial descriptor
dim the dimension to partition
block the block to partition
count the number of partitions
indices the upper bounding index for each partition
Returns:
an array of partial descriptors which can then be partitioned further

void IC_Print_error char *  msg  ) 
 

Prints an error message for the last call that failed

Parameters:
msg a message that will be prepended to the internal error message

void IC_Quit IC_Program myprog  ) 
 

Frees up internal data structures and free the program handle for this program

Parameters:
myprog the handle for this program

int IC_Recv_local IC_XJD xjd,
char *  rgnset_name,
void *  data,
int  nelems
 

Receive an array broadcasted from rank-0 process of other program

Parameters:
xjd the InterComm application descriptor for programs and regions
rgnset_name name of the region set
data the data to broadcast
nelems the data size, which is required since we cannot compute data size for local block
Returns:
status

int IC_Recv_local_TYPE IC_Program from,
TYPE *  data,
int  nelems,
int  tag
 

Receive an array broadcasted from rank-0 process of other program. There is a receive call for each C TYPE (char, short, int, float, double).

  • int IC_Recv_local_char(IC_Program* from, char* data, int nelems, int tag)
  • int IC_Recv_local_short(IC_Program* from, short* data, int nelems, int tag)
  • int IC_Recv_local_int(IC_Program* from, int* data, int nelems, int tag)
  • int IC_Recv_local_float(IC_Program* from, float* data, int nelems, int tag)
  • int IC_Recv_local_double(IC_Program* from, double* data, int nelems, int tag)
    Parameters:
    from the receiving program
    data the array to broadcast
    nelems the number of elemens in the data
    tag a message tag
    Returns:
    status

int IC_Recv_TYPE IC_Program from,
IC_Sched sched,
TYPE *  data,
int  tag
 

Receive a region from a program. There is a receive call for each C TYPE (char, short, int, long, float, double).

  • int IC_Recv_char(IC_Program* from, IC_Sched* sched, char* data, int tag)
  • int IC_Recv_short(IC_Program* from, IC_Sched* sched, short* data, int tag)
  • int IC_Recv_int(IC_Program* from, IC_Sched* sched, int* data, int tag)
  • int IC_Recv_long(IC_Program* from, IC_Sched* sched, long* data, int tag)
  • int IC_Recv_float(IC_Program* from, IC_Sched* sched, float* data, int tag)
  • int IC_Recv_double(IC_Program* from, IC_Sched* sched, double* data, int tag)
    Parameters:
    from the sending program
    sched the communication schedule
    data the local portion of the global array
    tag a message tag
    Returns:
    status

void IC_Register_region IC_XJD xjd,
IC_Region **  rgnset,
int  set_size,
char *  set_name,
IC_Desc desc,
void *  local_data,
int *  status
 

Register detailed information on a set of regions (a set of array blocks) into the internal program and region representation.

Parameters:
xjd the InterComm application descriptor for programs and regions
rgnset an array of regions describing the data to be communicated
set_size the number of of regions in the array
set_name name of the region set
desc the InterComm global array descriptor
local_data the pointer to the local data array
status status, if negative, indicates an error

void IC_Section IC_Tree root,
int  dim,
int  count,
int *  indices
 

Create a partition for a partial descriptor

Parameters:
root the partial descriptor
dim the dimension to partition
count the number of partitions
indices the upper bounding index for each partition

int IC_Send_TYPE IC_Program to,
IC_Sched sched,
TYPE *  data,
int  tag
 

Send a region to another program. There is a send call for each C TYPE (char, short, int, long, float, double).

  • int IC_Send_char(IC_Program* to, IC_Sched* sched, char* data, int tag)
  • int IC_Send_short(IC_Program* to, IC_Sched* sched, short* data, int tag)
  • int IC_Send_int(IC_Program* to, IC_Sched* sched, int* data, int tag)
  • int IC_Send_long(IC_Program* to, IC_Sched* sched, long* data, int tag)
  • int IC_Send_float(IC_Program* to, IC_Sched* sched, float* data, int tag)
  • int IC_Send_double(IC_Program* to, IC_Sched* sched, double* data, int tag)
    Parameters:
    to the receiving program
    sched the communication schedule
    data the local portion of the global array
    tag a message tag
    Returns:
    status

int IC_Sync IC_Program myprog,
IC_Program prog
 

Synchronizes two programs

Parameters:
myprog a handle to this program
prog a handle to the other program
Returns:
status

IC_Desc* IC_Verify_bdecomp_tree IC_Tree root,
int  ndims,
int *  size,
int *  tasks,
int  count,
int  arrayOrder
 

Verify a partial descriptor and generate a complete descriptor

Parameters:
root the partial descriptor
ndims the number of dimensions
size the size of the global array
tasks the task assignments for each block
count the number of blocks
arrayOrder array order
Returns:
the decomposition descriptor

IC_Program* IC_Wait char *  name,
int  tasks
 

Contact another program

Parameters:
name the name of the other program (as given in its IC_Init call)
tasks the number of tasks in the other program
Returns:
a handle for the other program


Generated on Mon Jun 4 14:42:41 2007 for InterComm by  doxygen 1.4.6