2007-12-21 09:02:00 +03:00
|
|
|
/* -*- Mode: C; c-basic-offset:4 ; -*- */
|
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.
|
2007-12-21 09:02:00 +03:00
|
|
|
* Copyright (c) 2004-2007 The University of Tennessee and The University
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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.
|
2007-08-04 04:41:26 +04:00
|
|
|
* Copyright (c) 2006-2007 University of Houston. All rights reserved.
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
* Copyright (c) 2007-2012 Cisco Systems, Inc. All rights reserved.
|
2009-02-24 20:17:33 +03:00
|
|
|
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
2012-03-09 01:57:45 +04:00
|
|
|
* Copyright (c) 2012 Oak Ridge National Labs. 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-04-14 03:42:31 +04:00
|
|
|
/**
|
|
|
|
* @file:
|
|
|
|
*
|
|
|
|
* Infrastructure for MPI group support.
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
#ifndef OMPI_GROUP_H
|
|
|
|
#define OMPI_GROUP_H
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2009-03-04 18:35:54 +03:00
|
|
|
#include "ompi_config.h"
|
|
|
|
#include "ompi/proc/proc.h"
|
2004-01-10 01:09:51 +03:00
|
|
|
#include "mpi.h"
|
2007-12-21 09:02:00 +03:00
|
|
|
#include "opal/class/opal_pointer_array.h"
|
2009-02-14 05:26:12 +03:00
|
|
|
#include "opal/util/output.h"
|
2009-03-04 18:35:54 +03:00
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
BEGIN_C_DECLS
|
2007-08-04 04:41:26 +04:00
|
|
|
|
|
|
|
#define BSIZE ((int)sizeof(unsigned char)*8)
|
|
|
|
|
|
|
|
struct ompi_group_sporadic_list_t
|
|
|
|
{
|
|
|
|
int rank_first;
|
|
|
|
int length;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ompi_group_sporadic_data_t
|
|
|
|
{
|
|
|
|
struct ompi_group_sporadic_list_t *grp_sporadic_list;
|
|
|
|
/** list to hold the sporadic struct */
|
|
|
|
int grp_sporadic_list_len;/** length of the structure*/
|
|
|
|
};
|
|
|
|
struct ompi_group_strided_data_t
|
|
|
|
{
|
|
|
|
int grp_strided_offset; /** offset to start from when including or excluding */
|
|
|
|
int grp_strided_stride; /** stride for including or excluding */
|
|
|
|
int grp_strided_last_element; /** the last element to be included for */
|
|
|
|
};
|
|
|
|
struct ompi_group_bitmap_data_t
|
|
|
|
{
|
|
|
|
unsigned char *grp_bitmap_array; /* the bit map array for sparse groups of type BMAP */
|
|
|
|
int grp_bitmap_array_len; /* length of the bit array */
|
|
|
|
};
|
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
/**
|
|
|
|
* Group structure
|
2007-08-04 04:41:26 +04:00
|
|
|
* Currently we have four formats for storing the process pointers that are members
|
|
|
|
* of the group.
|
|
|
|
* PList: a dense format that stores all the process pointers of the group.
|
|
|
|
* Sporadic: a sparse format that stores the ranges of the ranks from the parent group,
|
|
|
|
* that are included in the current group.
|
|
|
|
* Strided: a sparse format that stores three integers that describe a red-black pattern
|
|
|
|
* that the current group is formed from its parent group.
|
|
|
|
* Bitmap: a sparse format that maintains a bitmap of the included processes from the
|
|
|
|
* parent group. For each process that is included from the parent group
|
|
|
|
* its corresponding rank is set in the bitmap array.
|
2004-04-14 03:42:31 +04:00
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
struct ompi_group_t {
|
2005-07-03 20:06:07 +04:00
|
|
|
opal_object_t super; /**< base class */
|
2004-04-14 03:42:31 +04:00
|
|
|
int grp_proc_count; /**< number of processes in group */
|
|
|
|
int grp_my_rank; /**< rank in group */
|
|
|
|
int grp_f_to_c_index; /**< index in Fortran <-> C translation array */
|
2004-11-05 10:52:30 +03:00
|
|
|
struct ompi_proc_t **grp_proc_pointers;
|
2004-06-07 19:33:53 +04:00
|
|
|
/**< list of pointers to ompi_proc_t structures
|
2004-06-15 04:08:57 +04:00
|
|
|
for each process in the group */
|
2007-08-04 04:41:26 +04:00
|
|
|
uint32_t grp_flags; /**< flags, e.g. freed, cannot be freed etc.*/
|
2007-08-07 03:09:37 +04:00
|
|
|
/** pointer to the original group when using sparse storage */
|
2007-08-04 04:41:26 +04:00
|
|
|
struct ompi_group_t *grp_parent_group_ptr;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
struct ompi_group_sporadic_data_t grp_sporadic;
|
|
|
|
struct ompi_group_strided_data_t grp_strided;
|
|
|
|
struct ompi_group_bitmap_data_t grp_bitmap;
|
|
|
|
} sparse_data;
|
2004-01-10 20:10:29 +03:00
|
|
|
};
|
2007-08-04 04:41:26 +04:00
|
|
|
|
2004-06-07 19:33:53 +04:00
|
|
|
typedef struct ompi_group_t ompi_group_t;
|
2004-10-22 20:06:05 +04:00
|
|
|
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_group_t);
|
2004-01-10 01:09:51 +03:00
|
|
|
|
2009-02-24 20:17:33 +03:00
|
|
|
/**
|
|
|
|
* Padded struct to maintain back compatibiltiy.
|
|
|
|
* See ompi/communicator/communicator.h comments with struct ompi_communicator_t
|
|
|
|
* for full explanation why we chose the following padding construct for predefines.
|
|
|
|
*/
|
|
|
|
#define PREDEFINED_GROUP_PAD (sizeof(void*) * 32)
|
|
|
|
|
|
|
|
struct ompi_predefined_group_t {
|
|
|
|
struct ompi_group_t group;
|
|
|
|
char padding[PREDEFINED_GROUP_PAD - sizeof(ompi_group_t)];
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct ompi_predefined_group_t ompi_predefined_group_t;
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2009-06-10 18:57:28 +04:00
|
|
|
/*
|
|
|
|
* The following include pulls in shared typedefs with debugger plugins.
|
|
|
|
* For more information on why we do this see the Notice to developers
|
|
|
|
* comment at the top of the ompi_msgq_dll.c file.
|
|
|
|
*/
|
2009-06-11 07:15:47 +04:00
|
|
|
#include "group_dbg.h"
|
2004-06-15 04:08:57 +04:00
|
|
|
|
|
|
|
#define OMPI_GROUP_IS_INTRINSIC(_group) ((_group)->grp_flags&OMPI_GROUP_INTRINSIC)
|
2007-08-04 04:41:26 +04:00
|
|
|
#define OMPI_GROUP_IS_DENSE(_group) ((_group)->grp_flags & OMPI_GROUP_DENSE)
|
|
|
|
#define OMPI_GROUP_IS_SPORADIC(_group) ((_group)->grp_flags & OMPI_GROUP_SPORADIC)
|
|
|
|
#define OMPI_GROUP_IS_STRIDED(_group) ((_group)->grp_flags & OMPI_GROUP_STRIDED)
|
|
|
|
#define OMPI_GROUP_IS_BITMAP(_group) ((_group)->grp_flags & OMPI_GROUP_BITMAP)
|
|
|
|
|
|
|
|
#define OMPI_GROUP_SET_INTRINSIC(_group) ( (_group)->grp_flags |= OMPI_GROUP_INTRINSIC)
|
|
|
|
#define OMPI_GROUP_SET_DENSE(_group) ( (_group)->grp_flags |= OMPI_GROUP_DENSE)
|
|
|
|
#define OMPI_GROUP_SET_SPORADIC(_group) ( (_group)->grp_flags |= OMPI_GROUP_SPORADIC)
|
|
|
|
#define OMPI_GROUP_SET_STRIDED(_group) ( (_group)->grp_flags |= OMPI_GROUP_STRIDED)
|
|
|
|
#define OMPI_GROUP_SET_BITMAP(_group) ( (_group)->grp_flags |= OMPI_GROUP_BITMAP)
|
2004-06-15 04:08:57 +04:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
/**
|
2004-02-13 02:23:03 +03:00
|
|
|
* Table for Fortran <-> C group handle conversion
|
|
|
|
*/
|
2007-12-21 09:02:00 +03:00
|
|
|
OMPI_DECLSPEC extern struct opal_pointer_array_t ompi_group_f_to_c_table;
|
2009-02-24 20:17:33 +03:00
|
|
|
OMPI_DECLSPEC extern struct ompi_predefined_group_t ompi_mpi_group_null;
|
== Highlights ==
1. New mpifort wrapper compiler: you can utilize mpif.h, use mpi, and use mpi_f08 through this one wrapper compiler
1. mpif77 and mpif90 still exist, but are sym links to mpifort and may be removed in a future release
1. The mpi module has been re-implemented and is significantly "mo' bettah"
1. The mpi_f08 module offers many, many improvements over mpif.h and the mpi module
This stuff is coming from a VERY long-lived mercurial branch (3 years!); it'll almost certainly take a few SVN commits and a bunch of testing before I get it correctly committed to the SVN trunk.
== More details ==
Craig Rasmussen and I have been working with the MPI-3 Fortran WG and Fortran J3 committees for a long, long time to make a prototype MPI-3 Fortran bindings implementation. We think we're at a stable enough state to bring this stuff back to the trunk, with the goal of including it in OMPI v1.7.
Special thanks go out to everyone who has been incredibly patient and helpful to us in this journey:
* Rolf Rabenseifner/HLRS (mastermind/genius behind the entire MPI-3 Fortran effort)
* The Fortran J3 committee
* Tobias Burnus/gfortran
* Tony !Goetz/Absoft
* Terry !Donte/Oracle
* ...and probably others whom I'm forgetting :-(
There's still opportunities for optimization in the mpi_f08 implementation, but by and large, it is as far along as it can be until Fortran compilers start implementing the new F08 dimension(..) syntax.
Note that gfortran is currently unsupported for the mpi_f08 module and the new mpi module. gfortran users will a) fall back to the same mpi module implementation that is in OMPI v1.5.x, and b) not get the new mpi_f08 module. The gfortran maintainers are actively working hard to add the necessary features to support both the new mpi_f08 module and the new mpi module implementations. This will take some time.
As mentioned above, ompi/mpi/f77 and ompi/mpi/f90 no longer exist. All the fortran bindings implementations have been collated under ompi/mpi/fortran; each implementation has its own subdirectory:
{{{
ompi/mpi/fortran/
base/ - glue code
mpif-h/ - what used to be ompi/mpi/f77
use-mpi-tkr/ - what used to be ompi/mpi/f90
use-mpi-ignore-tkr/ - new mpi module implementation
use-mpi-f08/ - new mpi_f08 module implementation
}}}
There's also a prototype 6-function-MPI implementation under use-mpi-f08-desc that emulates the new F08 dimension(..) syntax that isn't fully available in Fortran compilers yet. We did that to prove it to ourselves that it could be done once the compilers fully support it. This directory/implementation will likely eventually replace the use-mpi-f08 version.
Other things that were done:
* ompi_info grew a few new output fields to describe what level of Fortran support is included
* Existing Fortran examples in examples/ were renamed; new mpi_f08 examples were added
* The old Fortran MPI libraries were renamed:
* libmpi_f77 -> libmpi_mpifh
* libmpi_f90 -> libmpi_usempi
* The configury for Fortran was consolidated and significantly slimmed down. Note that the F77 env variable is now IGNORED for configure; you should only use FC. Example:
{{{
shell$ ./configure CC=icc CXX=icpc FC=ifort ...
}}}
All of this work was done in a Mercurial branch off the SVN trunk, and hosted at Bitbucket. This branch has got to be one of OMPI's longest-running branches. Its first commit was Tue Apr 07 23:01:46 2009 -0400 -- it's over 3 years old! :-) We think we've pulled in all relevant changes from the OMPI trunk (e.g., Fortran implementations of the new MPI-3 MPROBE stuff for mpif.h, use mpi, and use mpi_f08, and the recent Fujitsu Fortran patches).
I anticipate some instability when we bring this stuff into the trunk, simply because it touches a LOT of code in the MPI layer in the OMPI code base. We'll try our best to make it as pain-free as possible, but please bear with us when it is committed.
This commit was SVN r26283.
2012-04-18 19:57:29 +04:00
|
|
|
OMPI_DECLSPEC extern struct ompi_predefined_group_t *ompi_mpi_group_null_addr;
|
2004-02-13 02:23:03 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
|
|
|
/*
|
2009-08-21 01:23:54 +04:00
|
|
|
* function prototypes
|
2004-02-13 02:23:03 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2004-04-14 03:42:31 +04:00
|
|
|
* Allocate a new group structure.
|
2004-02-13 02:23:03 +03:00
|
|
|
*
|
|
|
|
* @param group_size Number of MPI processes in the group
|
|
|
|
*
|
|
|
|
* @return Pointer to new group structure
|
|
|
|
*/
|
2008-02-28 04:57:57 +03:00
|
|
|
OMPI_DECLSPEC ompi_group_t *ompi_group_allocate(int group_size);
|
2007-08-04 04:41:26 +04:00
|
|
|
ompi_group_t *ompi_group_allocate_sporadic(int group_size);
|
|
|
|
ompi_group_t *ompi_group_allocate_strided(void);
|
|
|
|
ompi_group_t *ompi_group_allocate_bmap(int orig_group_size, int group_size);
|
2004-04-14 03:42:31 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Increment the reference count of the proc structures.
|
|
|
|
*
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param group Pointer to ompi_group_t structute (IN)
|
2004-04-14 03:42:31 +04:00
|
|
|
*
|
2004-03-16 01:14:08 +03:00
|
|
|
*/
|
2008-02-01 23:35:53 +03:00
|
|
|
OMPI_DECLSPEC void ompi_group_increment_proc_count(ompi_group_t *group);
|
2004-03-16 01:14:08 +03:00
|
|
|
|
2004-12-02 16:28:10 +03:00
|
|
|
/**
|
|
|
|
* Decrement the reference count of the proc structures.
|
|
|
|
*
|
|
|
|
* @param group Pointer to ompi_group_t structute (IN)
|
|
|
|
*
|
|
|
|
*/
|
2008-02-01 23:35:53 +03:00
|
|
|
OMPI_DECLSPEC void ompi_group_decrement_proc_count(ompi_group_t *group);
|
2004-12-02 16:28:10 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2004-02-13 02:23:03 +03:00
|
|
|
/**
|
2004-06-07 19:33:53 +04:00
|
|
|
* Initialize OMPI group infrastructure.
|
2004-02-13 02:23:03 +03:00
|
|
|
*
|
|
|
|
* @return Error code
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
int ompi_group_init(void);
|
2004-02-13 02:23:03 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2004-02-13 19:23:29 +03:00
|
|
|
/**
|
2004-06-07 19:33:53 +04:00
|
|
|
* Clean up OMPI group infrastructure.
|
2004-02-13 19:23:29 +03:00
|
|
|
*
|
|
|
|
* @return Error code
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
int ompi_group_finalize(void);
|
2004-02-13 19:23:29 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2004-02-13 19:41:53 +03:00
|
|
|
/**
|
2004-04-14 03:42:31 +04:00
|
|
|
* Get group size.
|
2004-02-13 19:41:53 +03:00
|
|
|
*
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param group Pointer to ompi_group_t structute (IN)
|
2004-02-13 19:41:53 +03:00
|
|
|
*
|
|
|
|
* @return Group size
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
static inline int ompi_group_size(ompi_group_t *group)
|
2004-04-14 03:42:31 +04:00
|
|
|
{
|
2004-02-13 19:41:53 +03:00
|
|
|
return group->grp_proc_count;
|
|
|
|
}
|
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2004-02-13 19:41:53 +03:00
|
|
|
/**
|
|
|
|
* Get group rank
|
|
|
|
*
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param group Pointer to ompi_group_t structure (IN)
|
2004-02-13 19:41:53 +03:00
|
|
|
*
|
|
|
|
* @return Group rank
|
|
|
|
*/
|
2004-06-07 19:33:53 +04:00
|
|
|
static inline int ompi_group_rank(ompi_group_t *group)
|
2004-04-14 03:42:31 +04:00
|
|
|
{
|
2004-06-15 04:08:57 +04:00
|
|
|
return group->grp_my_rank;
|
2004-02-13 19:41:53 +03:00
|
|
|
}
|
2004-02-27 22:22:14 +03:00
|
|
|
|
2004-04-14 03:42:31 +04:00
|
|
|
|
2007-07-11 21:15:28 +04:00
|
|
|
|
2004-02-27 22:22:14 +03:00
|
|
|
/**
|
|
|
|
* Set group rank in the input group structure
|
|
|
|
*
|
2004-06-07 19:33:53 +04:00
|
|
|
* @param group Group Pointer to ompi_group_t structure (IN)
|
|
|
|
* @param proc_pointer Pointer to ompi_proc_t structure for process.
|
2004-02-27 22:22:14 +03:00
|
|
|
* MPI_PROC_NULL may be used to indicate proc not
|
|
|
|
* in group
|
|
|
|
*
|
|
|
|
* @return Error code
|
|
|
|
*/
|
2004-11-05 10:52:30 +03:00
|
|
|
void ompi_set_group_rank(ompi_group_t *group, struct ompi_proc_t *proc_pointer);
|
2004-02-27 22:22:14 +03:00
|
|
|
|
2004-08-04 02:06:49 +04:00
|
|
|
/**
|
|
|
|
* Abstracting MPI_Group_translate_ranks to an ompi function for internal use
|
|
|
|
*/
|
2007-08-30 19:13:08 +04:00
|
|
|
OMPI_DECLSPEC int ompi_group_translate_ranks ( ompi_group_t *group1,
|
2004-08-04 02:06:49 +04:00
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
|
2012-03-09 01:57:45 +04:00
|
|
|
/**
|
|
|
|
* Abstracting MPI_Group_compare to an ompi function for internal use
|
|
|
|
*/
|
|
|
|
OMPI_DECLSPEC int ompi_group_compare(ompi_group_t *group1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *result);
|
2005-10-14 22:51:20 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Abstracting MPI_Group_free, since it is required by some internal functions...
|
|
|
|
*/
|
|
|
|
int ompi_group_free (ompi_group_t **group);
|
|
|
|
|
2006-03-15 00:00:55 +03:00
|
|
|
/**
|
2007-08-04 04:41:26 +04:00
|
|
|
* Functions to handle process pointers for sparse group formats
|
2006-03-15 00:00:55 +03:00
|
|
|
*/
|
2008-03-11 21:53:18 +03:00
|
|
|
OMPI_DECLSPEC ompi_proc_t* ompi_group_get_proc_ptr (ompi_group_t* group , int rank);
|
2006-03-15 00:00:55 +03:00
|
|
|
|
2007-08-04 04:41:26 +04:00
|
|
|
int ompi_group_translate_ranks_sporadic ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
int ompi_group_translate_ranks_sporadic_reverse ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
int ompi_group_translate_ranks_strided ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
int ompi_group_translate_ranks_strided_reverse ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
int ompi_group_translate_ranks_bmap ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
int ompi_group_translate_ranks_bmap_reverse ( ompi_group_t *group1,
|
|
|
|
int n_ranks, int *ranks1,
|
|
|
|
ompi_group_t *group2,
|
|
|
|
int *ranks2);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Prototypes for the group back-end functions. Argument lists
|
|
|
|
are similar to the according C MPI functions.
|
|
|
|
*/
|
|
|
|
int ompi_group_incl(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_excl(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_range_incl(ompi_group_t* group, int n_triplets,
|
|
|
|
int ranges[][3],ompi_group_t **new_group);
|
|
|
|
int ompi_group_range_excl(ompi_group_t* group, int n_triplets,
|
|
|
|
int ranges[][3],ompi_group_t **new_group);
|
|
|
|
int ompi_group_union (ompi_group_t* group1, ompi_group_t* group2,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_intersection(ompi_group_t* group1,ompi_group_t* group2,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_difference(ompi_group_t* group1, ompi_group_t* group2,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include Functions to handle Sparse storage formats
|
|
|
|
*/
|
|
|
|
int ompi_group_incl_plist(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_incl_spor(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_incl_strided(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
int ompi_group_incl_bmap(ompi_group_t* group, int n, int *ranks,
|
|
|
|
ompi_group_t **new_group);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Functions to calculate storage spaces
|
|
|
|
*/
|
|
|
|
int ompi_group_calc_plist ( int n, int *ranks );
|
|
|
|
int ompi_group_calc_strided ( int n, int *ranks );
|
|
|
|
int ompi_group_calc_sporadic ( int n, int *ranks );
|
|
|
|
int ompi_group_calc_bmap ( int n, int orig_size , int *ranks );
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to return the minimum value in an array
|
|
|
|
*/
|
|
|
|
int ompi_group_minloc (int list[], int length);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Inline function to check if sparse groups are enabled and return the direct access
|
|
|
|
* to the proc pointer, otherwise the lookup function
|
|
|
|
*/
|
|
|
|
static inline struct ompi_proc_t* ompi_group_peer_lookup(ompi_group_t *group, int peer_id)
|
|
|
|
{
|
2009-05-07 00:11:28 +04:00
|
|
|
#if OPAL_ENABLE_DEBUG
|
2007-08-04 04:41:26 +04:00
|
|
|
if (peer_id >= group->grp_proc_count) {
|
2008-06-09 18:53:58 +04:00
|
|
|
opal_output(0, "ompi_group_lookup_peer: invalid peer index (%d)", peer_id);
|
2007-08-04 04:41:26 +04:00
|
|
|
return (struct ompi_proc_t *) NULL;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#if OMPI_GROUP_SPARSE
|
|
|
|
return ompi_group_get_proc_ptr (group, peer_id);
|
|
|
|
#else
|
|
|
|
return group->grp_proc_pointers[peer_id];
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Function to print the group info
|
|
|
|
*/
|
|
|
|
int ompi_group_dump (ompi_group_t* group);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Ceil Function so not to include the math.h lib
|
|
|
|
*/
|
|
|
|
int ompi_group_div_ceil (int num, int den);
|
2006-03-15 00:00:55 +03:00
|
|
|
|
2009-08-20 15:42:18 +04:00
|
|
|
END_C_DECLS
|
2004-06-07 19:33:53 +04:00
|
|
|
#endif /* OMPI_GROUP_H */
|