[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.0.4-249-gdf5d41b

mysql vizuser noreply at mpich.org
Wed May 22 15:27:16 CDT 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "MPICH primary repository".

The branch, master has been updated
       via  df5d41be07d90561affc18f535c0ebc9af19c761 (commit)
       via  cf0c57d23010b6b33d859229bc323c10d00a68e8 (commit)
       via  b8ddea4fbe24a96371767ebd50057f8de9e9ead5 (commit)
      from  438a49fe9eba9cdb63bc4dc07cef3fc4031afd03 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.mpich.org/mpich.git/commitdiff/df5d41be07d90561affc18f535c0ebc9af19c761

commit df5d41be07d90561affc18f535c0ebc9af19c761
Author: William Gropp <wgropp at illinois.edu>
Date:   Wed May 22 15:21:35 2013 -0500

    Cleaned up files to remove unused code from distgraph update

diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 8f8e17d..bd112f0 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -229,11 +229,11 @@ if (! -d "../../mpi/romio") { $build_io = 0; }
 		     'Create_cart-4' => 'in:boolarray:2',
 		     'Create_cart-5' => 'in:bool',
 		     'Create_graph-5' => 'in:bool',
-#                     'Dist_graph_create-8' => 'in:bool',
-#                     'Dist_graph_create_adjacent-9' => 'in:bool',
-                     # Other versions with one less argument (no weights)
-                     # also needed.
-#                     'distgraph-Get_dist_neighbors_count-4' => 'out:bool',
+# Because there are multiple versions of the Distgraph create routines, 
+# to allow for the optional weights, 
+# we don't use the automatic method to create them.  Thus, there are
+# no entries for Dist_graph_create, Dist_graph_create_adjacent, or
+# Dist_graph_neighrbors_count
 		     'cart-Get_topo-4' => 'out:boolarray:2',
 		     'Sub-2' => 'in:boolarray:-10', # Use -10 for immediate number
 		     'Shift-4' => 'in:refint',
@@ -363,8 +363,8 @@ $specialReturnType{"inter-Split"} = "Intercomm";
 		     'Create_intercomm' => MPI_Comm,
 		     'Create_cart' => 'MPI_Comm:4:5',
 		     'Create_graph' => 'MPI_Comm:5',
-#		     'Dist_graph_create' => 'MPI_Comm:8',
-#		     'Dist_graph_create_adjacent' => 'MPI_Comm:9',
+# Because the Dist_graph_create and Dist_graph_create_adjacent routines
+# have two signatures, their definitions are handled as a special case
 );
 $specialReturnType{"intra-Split"} = "Intracomm";
 $specialReturnType{"intra-Create"} = "Intracomm";
@@ -455,7 +455,8 @@ $specialReturnType{"intra-Dup"} = "Intracomm";
 		    );
 %class_mpi2graph = ();
 %class_mpi2distgraph = (
-#		     'Get_dist_neighbors_count' => '0', 
+# Because of the weights option, Get_dist_neighbors_count is handled as
+# special case
 		     'Get_dist_neighbors' => '0',
 );  
 %class_mpi2group = ();
@@ -482,9 +483,9 @@ $specialReturnType{"intra-Dup"} = "Intracomm";
 # also require special handling
 %class_mpi2intra = ( #'Alltoallw' => 0, 
 		     'Exscan' => 0,
-#		    'Spawn' => 'MPI_Comm',
-#		    'Spawn_multiple' => 'MPI_Comm',
-		    'Accept' => 'MPI_Comm',
+		     # Because Spawn and Spawn_multiple have two different
+		     # signaturs, they are handled as special cases.
+		     'Accept' => 'MPI_Comm',
 		     'Connect' => 'MPI_Comm',
 		     );
 %class_mpi2op = (
@@ -980,8 +981,8 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 	     'intra-Split' => 'Comm_split',
 	     'intra-Create_cart' => 'Cart_create',
 	     'intra-Create_graph' => 'Graph_create',
-#	     'intra-Dist_graph_create' => 'Dist_graph_create',
-#	     'intra-Dist_graph_create_adjacent' => 'Dist_graph_create_adjacent',
+	     # Dist_graph_create and Dist_graph_create_adjacent are handled
+	     # as a special case
 	     'intra-Connect' => 'Comm_connect',
 	     'intra-Spawn' => 'Comm_spawn',
 	     'intra-Spawn_multiple' => 'Comm_spawn_multiple',
@@ -1041,8 +1042,6 @@ if ($doFuncspec) {
     # Use the MPI C++ binding names for the defered definitions
     $defer_definition{"Create_cart"}  = "Comm";
     $defer_definition{"Create_graph"} = "Comm";
-#    $defer_definition{"Dist_graph_create"} = "Comm";
-#    $defer_definition{"Dist_graph_create_adjacent"} = "Comm";
     $defer_definition{"Get_parent"}   = "Comm";
     $defer_definition{"Join"}         = "Comm";
     $defer_definition{"Merge"}        = "Intercomm";
diff --git a/src/binding/cxx/cxxdecl3.dat b/src/binding/cxx/cxxdecl3.dat
index 10618f2..845a6ce 100644
--- a/src/binding/cxx/cxxdecl3.dat
+++ b/src/binding/cxx/cxxdecl3.dat
@@ -288,10 +288,8 @@ inter-Merge Intracomm (,in:bool ,return) const
 intra-Create_cart Cartcomm (, ,in:const ,in:boolarray:2 ,in:bool ,return) const
 -Compute_dims void ( , , )
 intra-Create_graph Graphcomm (, ,in:const ,in:const ,in:bool ,return) const
-#intra-Dist_graph_create Distgraphcomm (,,in:const,in:const,in:const,in:const,in:constref:Info,in:bool,return) const
-#intra-Dist_graph_create_adjacent Distgraphcomm (,,in:const,in:const,,in:const,in:const,in:constref:Info,in:bool,return) const
-##intra-Create_dist_graph Distgraphcomm (,,in:const,in:const,in:const,in:const,in:constref:Info,in:bool,return) const
-##intra-Create_dist_graph_adjacent Distgraphcomm (,,in:const,in:const,,in:const,in:const,in:constref:Info,in:bool,return) const
+# Dist_graph_create, Dist_graph_create_adjacent are handled specially 
+# because of the optional weights parameter
 comm-Get_topology int (,return) const
 graph-Get_dims void (, , ) const
 graph-Get_topo void (, , , , ) const

http://git.mpich.org/mpich.git/commitdiff/cf0c57d23010b6b33d859229bc323c10d00a68e8

commit cf0c57d23010b6b33d859229bc323c10d00a68e8
Author: William Gropp <wgropp at illinois.edu>
Date:   Tue May 21 11:55:03 2013 -0500

    Missed adding the change to the C++ testlist for the new topo test

diff --git a/test/mpi/cxx/testlist.in b/test/mpi/cxx/testlist.in
index 594aedc..ce4c53e 100644
--- a/test/mpi/cxx/testlist.in
+++ b/test/mpi/cxx/testlist.in
@@ -6,6 +6,7 @@ errhan
 init
 info
 datatype
+topo
 @iodir@
 @spawndir@
 @rmadir@

http://git.mpich.org/mpich.git/commitdiff/b8ddea4fbe24a96371767ebd50057f8de9e9ead5

commit b8ddea4fbe24a96371767ebd50057f8de9e9ead5
Author: William Gropp <wgropp at illinois.edu>
Date:   Sat Apr 20 15:44:12 2013 -0500

    Corrected MPI-2 C++ interface to include the Distgraph routines
    
    Updated buildiface for C++ (relevant for MPI 2.2) to create the Distgraph
    C++ interfaces.  Also fixed errors in the C++ tests where the tests failed
    to include the configure-generated configuration file mpitestconf.h before
    included files that depended upon that file.
    
    In the process of creating the tests for the C++ Distgraph routines,
    discovered errors in the error checking in the MPI dist graph routine to
    extract the graph data.  This commit does not fix that error.

diff --git a/src/binding/cxx/buildiface b/src/binding/cxx/buildiface
index 13db2b8..8f8e17d 100755
--- a/src/binding/cxx/buildiface
+++ b/src/binding/cxx/buildiface
@@ -229,6 +229,11 @@ if (! -d "../../mpi/romio") { $build_io = 0; }
 		     'Create_cart-4' => 'in:boolarray:2',
 		     'Create_cart-5' => 'in:bool',
 		     'Create_graph-5' => 'in:bool',
+#                     'Dist_graph_create-8' => 'in:bool',
+#                     'Dist_graph_create_adjacent-9' => 'in:bool',
+                     # Other versions with one less argument (no weights)
+                     # also needed.
+#                     'distgraph-Get_dist_neighbors_count-4' => 'out:bool',
 		     'cart-Get_topo-4' => 'out:boolarray:2',
 		     'Sub-2' => 'in:boolarray:-10', # Use -10 for immediate number
 		     'Shift-4' => 'in:refint',
@@ -310,6 +315,9 @@ $specialReturnType{"cart-Split"} = "Cartcomm";
 		     );
 $specialReturnType{"graph-Dup"} = "Graphcomm";
 $specialReturnType{"graph-Split"} = "Graphcomm";
+$specialReturnType{"distgraph-Dup"} = "Distgraphcomm";
+$specialReturnType{"distgraph-Split"} = "Distgraphcomm";
+
 
 # Range routines will require special handling
 # The Translate_ranks, Union, Intersect, Difference, and Compare routines are 
@@ -354,7 +362,9 @@ $specialReturnType{"inter-Split"} = "Intercomm";
 		     'Split' => MPI_Comm,
 		     'Create_intercomm' => MPI_Comm,
 		     'Create_cart' => 'MPI_Comm:4:5',
-		     'Create_graph' => 'MPI_Comm:5' 
+		     'Create_graph' => 'MPI_Comm:5',
+#		     'Dist_graph_create' => 'MPI_Comm:8',
+#		     'Dist_graph_create_adjacent' => 'MPI_Comm:9',
 );
 $specialReturnType{"intra-Split"} = "Intracomm";
 $specialReturnType{"intra-Create"} = "Intracomm";
@@ -407,20 +417,20 @@ $specialReturnType{"intra-Dup"} = "Intracomm";
 		    'Is_finalized' => '1;bool',
 		    'Query_thread' => '1',
 		    'Is_thread_main' => '1;bool',
-		    'Add_error_class' => 1,
-		    'Add_error_code' => 2, 
+		    'Add_error_class' => '1',
+		    'Add_error_code' => '2', 
 		    'Add_error_string' => '0:2',
 		    );
-%class_mpi2comm = ( 'Barrier' => 0, 
+%class_mpi2comm = ( 'Barrier' => '0', 
 		    'Get_attr' => 'int',
-		    'Set_attr' => 0,
-		    'Delete_attr' => 0,
+		    'Set_attr' => '0',
+		    'Delete_attr' => '0',
 #		    'Create_keyval' => 'int',
 		    'Free_keyval' =>  'static:0:1',
-		    'Call_errhandler' => 0,
+		    'Call_errhandler' => '0',
 		    'Set_name' => '0:2',
 		    'Get_name' => '0:3',
-		    'Disconnect' => 0,
+		    'Disconnect' => '0',
 		    'Get_parent' => 'static:0;Intercomm',
 		   );
 %class_mpi2cart = ();
@@ -432,18 +442,22 @@ $specialReturnType{"intra-Dup"} = "Intracomm";
 		     'Create_hindexed' => 'MPI_Datatype',
 		     'Get_extent' => '0',
 		     'Create_resized' => 'MPI_Datatype',  # FIXME Check not just resized
-		     'Get_true_extent' => 0,
+		     'Get_true_extent' => '0',
 		     'Create_subarray' => 'MPI_Datatype',
 		     'Create_darray' => 'MPI_Datatype',
 		     'Get_attr' => 'int',
-		     'Set_attr' => 0,
-		     'Delete_attr' => 0,
+		     'Set_attr' => '0',
+		     'Delete_attr' => '0',
 #		     'Create_keyval' => 'int',
 		     'Free_keyval' =>  'static:0:1',
 );
 %class_mpi2errh = ( 
 		    );
 %class_mpi2graph = ();
+%class_mpi2distgraph = (
+#		     'Get_dist_neighbors_count' => '0', 
+		     'Get_dist_neighbors' => '0',
+);  
 %class_mpi2group = ();
 %class_mpi2inter = ( #'Barrier' => 0, # MPI-2 adds intercomm collective
 		     #'Bcast' => 0,   # These are moved into the Comm class
@@ -464,7 +478,7 @@ $specialReturnType{"intra-Dup"} = "Intracomm";
 #$specialReturnType{"inter-Split"} = "Intercomm";
 
 # Alltoallw uses an array of datatypes, which requires special handling
-# Spawn and spawn mulitple uses arrays of character strings, which
+# Spawn and spawn multiple uses arrays of character strings, which
 # also require special handling
 %class_mpi2intra = ( #'Alltoallw' => 0, 
 		     'Exscan' => 0,
@@ -537,10 +551,10 @@ if ($build_io) {
 		   'Get_type_extent' => 'MPI_Aint',
 		   'Set_atomicity' => '0:2',
 		   'Get_atomicity' => 'int;bool',
-		   'Sync' => 0,
+		   'Sync' => '0',
 		   'Get_errhandler' => 'MPI_Errhandler',
-		   'Set_errhandler' => 0,
- 		   'Call_errhandler' => 0,
+		   'Set_errhandler' => '0',
+ 		   'Call_errhandler' => '0',
 		   );		
 #     %class_mpi2file = ( 
 # 		   'File_open' => 'static:MPI_File:2',
@@ -616,8 +630,8 @@ if ($build_io) {
 		    'Set_name' => '0:2',
 		    'Get_name' => '0:3',
 		    'Get_attr' => 'int',
-		    'Set_attr' => 0,
-		    'Delete_attr' => 0,
+		    'Set_attr' => '0',
+		    'Delete_attr' => '0',
 		    'Free_keyval' =>  'static:0:1',
 		    );
 %class_mpi2info = ( 'Create' => 'static:1',
@@ -651,6 +665,7 @@ if ($build_io) {
 		   'win', 
 		   'file', 
 		   'graph',
+                   'distgraph',
 		   'cart', 
 );
 
@@ -662,11 +677,12 @@ if ($build_io) {
 %class_extra_fnc = ( 'st'        => 'Status_methods',
                      'except'    => 'Exception_methods',
 		     'comm'      => 'Comm_methods',
-		     'null'  => 'Nullcomm_methods',
-		     'inter' => 'Intercomm_methods',
-		     'intra' => 'Intracomm_methods',
-		     'graph' => 'Graphcomm_methods',
-		     'cart'  => 'Cartcomm_methods',
+		     'null'      => 'Nullcomm_methods',
+		     'inter'     => 'Intercomm_methods',
+		     'intra'     => 'Intracomm_methods',
+		     'graph'     => 'Graphcomm_methods',
+		     'distgraph' => 'Distgraphcomm_methods',
+		     'cart'      => 'Cartcomm_methods',
 		     'dtype'     => 'Datatype_methods',
 		     'op'        => 'Op_methods',
 		     'file'      => 'File_methods',
@@ -797,6 +813,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 		'errh' => MPI_Errhandler,
 		'null'  => MPI_Comm,
 		'graph' => MPI_Comm,
+		'distgraph' => MPI_Comm,
 		'group' => MPI_Group,
 		'inter' => MPI_Comm,
 		'intra' => MPI_Comm,
@@ -817,6 +834,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 		   'dtype' => 'Datatype',
 		   'errh' => 'Errhandler',
 		   'graph' => 'Graphcomm',
+		   'distgraph' => 'Distgraphcomm',
 		   'group' => 'Group',
 		   'null'  => 'Nullcomm',
 		   'inter' => 'Intercomm',
@@ -837,14 +855,15 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 # This has gives the list of friends for each class (i.e., the
 # classes that are allowed to directly access the protected members).
 # The friends are the full class names
-%class_friends = ( 'comm' => 'Cartcomm,Intercomm,Intracomm,Graphcomm,Nullcomm,Datatype,Win,File',
+%class_friends = ( 'comm' => 'Cartcomm,Intercomm,Intracomm,Graphcomm,Distgraphcomm,Nullcomm,Datatype,Win,File',
 		   'cart' => '',
 		   'dtype' => 'Comm,Status,Intracomm,Intercomm,Win,File,Op',
 		   'errh' => 'Comm,File,Win',
 		   'graph' => '',
+		   'distgraph' => '',
 		   'group' => 'Comm,Intracomm,Intercomm,Win,File',
 		   'inter' => 'Intracomm',
-		   'intra' => 'Cartcomm,Graphcomm,Datatype',
+		   'intra' => 'Cartcomm,Graphcomm,Distgraphcomm,Datatype',
 		   # Op adds comm as a friend because of MPI2
 		   'op' => 'Intracomm,Intercomm,Win,Comm',
 		   'preq' => '',
@@ -860,6 +879,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 # We also need to know the derived classes.  This gives the class that
 # a class is derived from.  Base classes are not included here.
 %derived_class = ( 'graph' => 'Intracomm', 
+		   'distgraph' => 'Intracomm',
 		   'preq' => 'Request',
 		   'greq' => 'Request',
 		   'null' => 'Comm',
@@ -874,6 +894,8 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 # used to store the C version of the class handle.
 %mytopclass = ( 'graph'     => 'comm', 
 		'graphcomm' => 'comm',
+		'distgraph' => 'comm',
+		'distgraphcomm' => 'comm',
 		'nullcomm'  => 'comm',
 	        'intracomm' => 'comm', 
 	        'intercomm' => 'comm',
@@ -958,6 +980,8 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 	     'intra-Split' => 'Comm_split',
 	     'intra-Create_cart' => 'Cart_create',
 	     'intra-Create_graph' => 'Graph_create',
+#	     'intra-Dist_graph_create' => 'Dist_graph_create',
+#	     'intra-Dist_graph_create_adjacent' => 'Dist_graph_create_adjacent',
 	     'intra-Connect' => 'Comm_connect',
 	     'intra-Spawn' => 'Comm_spawn',
 	     'intra-Spawn_multiple' => 'Comm_spawn_multiple',
@@ -978,6 +1002,9 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 	     'graph-Get_neighbors_count' => 'Graph_neighbors_count',
 	     'graph-Get_dims' => 'Graphdims_get',
 	     'graph-Dup' => 'Comm_dup',
+	     'distgraph-Dup' => 'Comm_dup',
+	     'distgraph-Get_dist_neighbors' => 'Dist_graph_neighbors',
+	     'distgraph-Get_dist_neighbors_count' => 'Dist_graph_neighbors_count',
              'op-Is_commutative' => 'Op_commutative',
              'op-Reduce_local' => 'Reduce_local',
 	     );
@@ -999,6 +1026,7 @@ if ( -s "../../mpi/romio/include/mpio.h.in" ) {
 			  'Nullcomm' => 1,
 			  'Cartcomm' => 1,
 			  'Graphcomm' => 1,
+			  'Distgraphcomm' => 1,
 			  'Prequest' => 1,
 			  );
 # These classes do not have a default intialization
@@ -1013,6 +1041,8 @@ if ($doFuncspec) {
     # Use the MPI C++ binding names for the defered definitions
     $defer_definition{"Create_cart"}  = "Comm";
     $defer_definition{"Create_graph"} = "Comm";
+#    $defer_definition{"Dist_graph_create"} = "Comm";
+#    $defer_definition{"Dist_graph_create_adjacent"} = "Comm";
     $defer_definition{"Get_parent"}   = "Comm";
     $defer_definition{"Join"}         = "Comm";
     $defer_definition{"Merge"}        = "Intercomm";
@@ -1084,6 +1114,7 @@ class Intercomm;
 class Intracomm;
 class Cartcomm;
 class Graphcomm;
+class Distgraphcomm;
 class File;
 \n";
 
@@ -1826,7 +1857,7 @@ extern Datatype TWOINTEGER;
     }
 
     # Predefined integers
-    foreach $int (BSEND_OVERHEAD, KEYVAL_INVALID, CART, GRAPH,
+    foreach $int (BSEND_OVERHEAD, KEYVAL_INVALID, CART, GRAPH, DIST_GRAPH,
 		  IDENT, SIMILAR, CONGRUENT, UNEQUAL, PROC_NULL,
 		  ANY_TAG, ANY_SOURCE, ROOT, TAG_UB, IO, HOST, WTIME_IS_GLOBAL,
                   UNIVERSE_SIZE, LASTUSEDCODE, APPNUM, 
@@ -2236,11 +2267,16 @@ MPIR_Comm_delete_attr_cxx_proxy(
         MPI::Cartcomm c = comm;
         return f( c, keyval, value, extra_state );
     }
-    else
+    else if (ttype == MPI_GRAPH)
     {
         MPI::Graphcomm c = comm;
         return f( c, keyval, value, extra_state );
     }
+    else
+    {
+        MPI::Distgraphcomm c = comm;
+        return f( c, keyval, value, extra_state );
+    }
 }
 
 static
@@ -2289,11 +2325,16 @@ MPIR_Comm_copy_attr_cxx_proxy(
         MPI::Cartcomm c = comm;
         return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
     }
-    else
+    else if (ttype == MPI_GRAPH)
     {
         MPI::Graphcomm c = comm;
         return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
     }
+    else 
+    {
+        MPI::Distgraphcomm c = comm;
+        return f( c, keyval, extra_state, value, new_value, *(bool*)flag );
+    }
 }
 
 
@@ -2764,6 +2805,72 @@ void Datatype::Unpack( const void *inbuf, int insize, void *outbuf,
     }\n";
 
     print $OUTFD "\
+    Distgraphcomm Intracomm::Dist_graph_create( int v2, const int v3[], const int v4[], const int v5[], const int v6[], const MPI::Info &v7, bool v8 ) const
+    {
+        Distgraphcomm v9;
+        int l8;
+        l8 = (v8 == true) ? 1 : 0;\n";
+    &printCoverageStart( $OUTFD, "Dist_graph_create", 9 );
+    print $OUTFD "\
+        MPIX_CALLREF( this, 
+                      MPI_Dist_graph_create( (MPI_Comm) the_real_comm, 
+                      v2, (int *)v3, (int *)v4, (int *)v5, (int *)v6, 
+                      (MPI_Info)v7, l8, &(v9.the_real_comm) ));\n";
+    &printCoverageEnd( $OUTFD, "Dist_graph_create", 9 );
+    print $OUTFD "\
+        return v9;
+    }
+
+    Distgraphcomm Intracomm::Dist_graph_create( int v2, const int v3[], const int v4[], const int v5[], const MPI::Info &v7, bool v8 ) const
+    {
+        Distgraphcomm v9;
+        int l8;
+        l8 = (v8 == true) ? 1 : 0;\n";
+    &printCoverageStart( $OUTFD, "Dist_graph_create", 9 );
+    print $OUTFD "\
+        MPIX_CALLREF( this, 
+                      MPI_Dist_graph_create( (MPI_Comm) the_real_comm, 
+                      v2, (int *)v3, (int *)v4, (int *)v5, MPI_UNWEIGHTED, 
+                      (MPI_Info)v7, l8, &(v9.the_real_comm) ));\n";
+    &printCoverageEnd( $OUTFD, "Dist_graph_create", 9 );
+    print $OUTFD "\
+        return v9;
+    }
+
+    Distgraphcomm Intracomm::Dist_graph_create_adjacent( int v2, const int v3[], const int v4[], int v5, const int v6[], const int v7[], const MPI::Info &v8, bool v9 ) const
+    {
+        Distgraphcomm v10;
+        int l9;
+        l9 = (v9 == true) ? 1 : 0;\n";
+    &printCoverageStart( $OUTFD, "Dist_graph_create_adjacent", 9 );
+    print $OUTFD "\
+        MPIX_CALLREF( this, 
+                      MPI_Dist_graph_create_adjacent( (MPI_Comm) the_real_comm, 
+                      v2, (int *)v3, (int *)v4, v5, (int *)v6, (int *)v7, 
+                      (MPI_Info)v8, l9, &(v10.the_real_comm) ));\n";
+    &printCoverageEnd( $OUTFD, "Dist_graph_create_adjacent", 10 );
+    print $OUTFD "\
+        return v10;
+    }
+
+    Distgraphcomm Intracomm::Dist_graph_create_adjacent( int v2, const int v3[], int v5, const int v6[], const MPI::Info &v8, bool v9 ) const
+    {
+        Distgraphcomm v10;
+        int l9;
+        l9 = (v9 == true) ? 1 : 0;\n";
+    &printCoverageStart( $OUTFD, "Dist_graph_create_adjacent", 9 );
+    print $OUTFD "\
+        MPIX_CALLREF( this, 
+                      MPI_Dist_graph_create_adjacent( (MPI_Comm) the_real_comm, 
+                      v2, (int *)v3, MPI_UNWEIGHTED, v5, (int *)v6, MPI_UNWEIGHTED, 
+                      (MPI_Info)v8, l9, &(v10.the_real_comm) ));\n";
+    &printCoverageEnd( $OUTFD, "Dist_graph_create_adjacent", 10 );
+    print $OUTFD "\
+        return v10;
+    }\n";
+
+
+    print $OUTFD "\
     Intracomm Intercomm::Merge( bool v2 ) const
     {
         Intracomm v3;
@@ -2887,7 +2994,7 @@ Grequest Grequest::Start( Grequest::Query_function  *query_fn,
 
 # Add the routine to initialize MPI datatype names for the C++ datatypes
 print $OUTFD "
-/* MT FIXME: this is not thread-safe */
+// MT FIXME: this is not thread-safe
 void MPIR_CXX_InitDatatypeNames( void )
 {
     static int _isInit = 1; 
@@ -3437,6 +3544,10 @@ sub Graphcomm_methods {
     my $OUTFD = $_[0];
     &Clone_method( $OUTFD, "Graphcomm" );
 }
+sub Distgraphcomm_methods {
+    my $OUTFD = $_[0];
+    &Clone_method( $OUTFD, "Distgraphcomm" );
+}
 sub Intercomm_methods {
     my $OUTFD = $_[0];
     &Clone_method( $OUTFD, "Intercomm" );
@@ -3494,6 +3605,21 @@ Intercomm Spawn_multiple(int count, const char* array_of_commands[], const char*
 }
 
 ";    
+
+    # Because there are two versions of each of the dist graph 
+    # create routines (fewer arguments for the case that uses 
+    # MPI_UNWEIGHTED in C or Fortran), we must define these explicitly 
+    # rather than generating them from the definitions.
+    print $OUTFD "\
+    virtual Distgraphcomm Dist_graph_create( int v2, const int v3[], const int v4[], const int v5[], const int v6[], const MPI::Info &v7, bool v8 ) const;
+
+    virtual Distgraphcomm Dist_graph_create( int v2, const int v3[], const int v4[], const int v5[], const MPI::Info &v7, bool v8 ) const;
+
+    virtual Distgraphcomm Dist_graph_create_adjacent( int v2, const int v3[], const int v4[], int v5, const int v6[], const int v7[], const MPI::Info &v8, bool v9 ) const;
+
+    virtual Distgraphcomm Dist_graph_create_adjacent( int v2, const int v3[], int v5, const int v6[], const MPI::Info &v8, bool v9 ) const;
+    \n";
+
 }
 
 sub Op_methods {
@@ -3964,7 +4090,7 @@ sub PrintRoutineCall {
     my $useThis = 0;
     my $TYPE = "OBJ", $obj = "COMM_WORLD";
     if ($class eq "comm" || $class eq "inter" || $class eq "intra" ||
-	$class eq "cart" || $class eq "graph") {
+	$class eq "cart" || $class eq "graph" || $class eq "distgraph") {
 	$useThis = 1;
 	$TYPE = "REF";
 	$obj  = "this";
@@ -4074,7 +4200,7 @@ sub DoSpecialArgProcessing {
 #	    }
 	}
 	else {
-	    print STDERR "Expected :$subname: for $routine but is was not defined\n";
+	    print STDERR "Expected :$subname: for $routine but it was not defined\n";
 	}
     }
     return 0;
@@ -4141,6 +4267,13 @@ sub bool_in_methoddecl {
     if (!$first) { print $OUTFD ", "; }
     print $OUTFD "bool v$count";
 }
+sub bool_out_methoddecl {
+    my $count = $_[0];
+    if (!$first) { print $OUTFD ", "; }
+    print $OUTFD "bool &v$count";
+}
+sub bool_out_cxxtoc {
+}
 sub bool_out_decl {
     my $count = $_[0];
     print $OUTFD "$indent    int l$count;\n";
@@ -4154,6 +4287,10 @@ sub bool_in_call {
     my $count = $_[0];
     print $OUTFD "l$count";
 }
+sub bool_out_call {
+    my $count = $_[0];
+    print $OUTFD "&l$count";
+}
 sub bool_out_ctocxx {
 #    my $cinvar     = $_[0];
 #    my $cxxoutvar  = $_[1];
diff --git a/src/binding/cxx/cxxdecl3.dat b/src/binding/cxx/cxxdecl3.dat
index ae76f4c..10618f2 100644
--- a/src/binding/cxx/cxxdecl3.dat
+++ b/src/binding/cxx/cxxdecl3.dat
@@ -270,11 +270,13 @@ intra-Dup Intracomm (,return) const
 inter-Dup Intercomm (,return) const
 cart-Dup Cartcomm (,return) const
 graph-Dup Graphcomm (,return) const
+distgraph-Dup Distgraphcomm (,return) const
 comm-Clone  (,return)
 intra-Clone  (,return) const
 inter-Clone  (,return) const
 cart-Clone  (,return) const
 graph-Clone  (,return) const
+distgraph-Clone (,return) const
 intra-Create Intracomm (,in:constref:Group ,return) const
 intra-Split Intracomm (, , ,return) const
 comm-Free void ()
@@ -286,6 +288,10 @@ inter-Merge Intracomm (,in:bool ,return) const
 intra-Create_cart Cartcomm (, ,in:const ,in:boolarray:2 ,in:bool ,return) const
 -Compute_dims void ( , , )
 intra-Create_graph Graphcomm (, ,in:const ,in:const ,in:bool ,return) const
+#intra-Dist_graph_create Distgraphcomm (,,in:const,in:const,in:const,in:const,in:constref:Info,in:bool,return) const
+#intra-Dist_graph_create_adjacent Distgraphcomm (,,in:const,in:const,,in:const,in:const,in:constref:Info,in:bool,return) const
+##intra-Create_dist_graph Distgraphcomm (,,in:const,in:const,in:const,in:const,in:constref:Info,in:bool,return) const
+##intra-Create_dist_graph_adjacent Distgraphcomm (,,in:const,in:const,,in:const,in:const,in:constref:Info,in:bool,return) const
 comm-Get_topology int (,return) const
 graph-Get_dims void (, , ) const
 graph-Get_topo void (, , , , ) const
@@ -295,6 +301,8 @@ cart-Get_cart_rank int (,in:const ,return) const
 cart-Get_coords void (, , , ) const
 graph-Get_neighbors_count int (, ,return) const
 graph-Get_neighbors void (, , , ) const
+distgraph-Get_dist_neighbors_count void (,in:refint,in:refint,out:bool) const
+distgraph-Get_dist_graph_neighbors void (, , , , ,) const
 cart-Shift void (, , ,in:refint ,in:refint ) const
 cart-Sub Cartcomm ( ,in:boolarray:-10 ,return) const
 cart-Map int (, ,in:const ,in:boolarray:2 ,return) const
diff --git a/test/mpi/configure.ac b/test/mpi/configure.ac
index 09b0427..bac91ac 100644
--- a/test/mpi/configure.ac
+++ b/test/mpi/configure.ac
@@ -1384,6 +1384,7 @@ AC_OUTPUT(maint/testmerge \
           cxx/init/Makefile \
           cxx/rma/Makefile \
           cxx/spawn/Makefile \
+	  cxx/topo/Makefile \
           threads/Makefile \
           threads/pt2pt/Makefile \
           threads/util/Makefile \
diff --git a/test/mpi/cxx/coll/icallgathervx.cxx b/test/mpi/cxx/coll/icallgathervx.cxx
index dce5627..cc0be06 100644
--- a/test/mpi/cxx/coll/icallgathervx.cxx
+++ b/test/mpi/cxx/coll/icallgathervx.cxx
@@ -6,6 +6,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm allgatherv test";
diff --git a/test/mpi/cxx/coll/icallgatherx.cxx b/test/mpi/cxx/coll/icallgatherx.cxx
index 7a5c5ca..049e157 100644
--- a/test/mpi/cxx/coll/icallgatherx.cxx
+++ b/test/mpi/cxx/coll/icallgatherx.cxx
@@ -5,6 +5,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm allgather test";
diff --git a/test/mpi/cxx/coll/icbarrierx.cxx b/test/mpi/cxx/coll/icbarrierx.cxx
index 325d7fe..6907aa3 100644
--- a/test/mpi/cxx/coll/icbarrierx.cxx
+++ b/test/mpi/cxx/coll/icbarrierx.cxx
@@ -5,6 +5,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm barrier test";
diff --git a/test/mpi/cxx/coll/icbcastx.cxx b/test/mpi/cxx/coll/icbcastx.cxx
index 3d48511..e740f4f 100644
--- a/test/mpi/cxx/coll/icbcastx.cxx
+++ b/test/mpi/cxx/coll/icbcastx.cxx
@@ -6,6 +6,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm broadcast test";
diff --git a/test/mpi/cxx/coll/icgathervx.cxx b/test/mpi/cxx/coll/icgathervx.cxx
index 63ad5ec..6267ca5 100644
--- a/test/mpi/cxx/coll/icgathervx.cxx
+++ b/test/mpi/cxx/coll/icgathervx.cxx
@@ -6,6 +6,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm gatherv test";
diff --git a/test/mpi/cxx/coll/icgatherx.cxx b/test/mpi/cxx/coll/icgatherx.cxx
index 705a650..ec69a94 100644
--- a/test/mpi/cxx/coll/icgatherx.cxx
+++ b/test/mpi/cxx/coll/icgatherx.cxx
@@ -6,6 +6,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm gather test";
diff --git a/test/mpi/cxx/coll/icreducex.cxx b/test/mpi/cxx/coll/icreducex.cxx
index a8257ef..5757944 100644
--- a/test/mpi/cxx/coll/icreducex.cxx
+++ b/test/mpi/cxx/coll/icreducex.cxx
@@ -6,6 +6,7 @@
  */
 #include "mpi.h"
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 static char MTEST_Descrip[] = "Simple intercomm reduce test";
diff --git a/test/mpi/cxx/pt2pt/bsend1cxx.cxx b/test/mpi/cxx/pt2pt/bsend1cxx.cxx
index 36cc650..ea299f4 100644
--- a/test/mpi/cxx/pt2pt/bsend1cxx.cxx
+++ b/test/mpi/cxx/pt2pt/bsend1cxx.cxx
@@ -8,8 +8,8 @@
    bug fixes */
 
 #include "mpi.h"
-#include "mpitestcxx.h"
 #include "mpitestconf.h"
+#include "mpitestcxx.h"
 #ifdef HAVE_IOSTREAM
 // Not all C++ compilers have iostream instead of iostream.h
 #include <iostream>
diff --git a/test/mpi/cxx/pt2pt/sendrecvx.cxx b/test/mpi/cxx/pt2pt/sendrecvx.cxx
index ee5d2c4..8931f94 100644
--- a/test/mpi/cxx/pt2pt/sendrecvx.cxx
+++ b/test/mpi/cxx/pt2pt/sendrecvx.cxx
@@ -12,9 +12,9 @@
 
 /* #include <stdio.h> */
 #include "mpi.h"
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
-#include "mpitestconf.h"
 #ifdef HAVE_IOSTREAM
 // Not all C++ compilers have iostream instead of iostream.h
 #include <iostream>
diff --git a/test/mpi/cxx/topo/Makefile.am b/test/mpi/cxx/topo/Makefile.am
new file mode 100644
index 0000000..1729ba5
--- /dev/null
+++ b/test/mpi/cxx/topo/Makefile.am
@@ -0,0 +1,17 @@
+# -*- Mode: Makefile; -*-
+# vim: set ft=automake :
+#
+# (C) 2011 by Argonne National Laboratory.
+#     See COPYRIGHT in top-level directory.
+#
+
+include $(top_srcdir)/Makefile_cxx.mtest
+
+EXTRA_DIST = testlist
+
+# avoid having to write many "foo_SOURCES = foo.cxx" lines because
+# automake is too limited to figure this out for itself
+AM_DEFAULT_SOURCE_EXT = .cxx
+
+noinst_PROGRAMS = distgraphcxx
+
diff --git a/test/mpi/cxx/topo/distgraphcxx.cxx b/test/mpi/cxx/topo/distgraphcxx.cxx
new file mode 100644
index 0000000..f3ead85
--- /dev/null
+++ b/test/mpi/cxx/topo/distgraphcxx.cxx
@@ -0,0 +1,100 @@
+/* -*- Mode: C++; c-basic-offset:4 ; -*- */
+/*
+ *  (C) 2013 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+#include "mpi.h"
+#include "mpitestconf.h"
+#include "mpitestcxx.h"
+#ifdef HAVE_IOSTREAM
+// Not all C++ compilers have iostream instead of iostream.h
+#include <iostream>
+#ifdef HAVE_NAMESPACE_STD
+// Those that do often need the std namespace; otherwise, a bare "cout"
+// is likely to fail to compile
+using namespace std;
+#endif
+#else
+#include <iostream.h>
+#endif
+
+int main( int argc, char *argv[] )
+{
+    int errs = 0;
+    int indegree, outdegree, sources[4], dests[4], sweights[4], dweights[4];
+    int wrank, wsize;
+    MPI::Distgraphcomm dcomm;
+
+    MTest_Init();
+
+    // Create a graph where each process sends to rank+1, rank+3 and
+    // receives from rank - 2
+    wrank = MPI::COMM_WORLD.Get_rank();
+    wsize = MPI::COMM_WORLD.Get_size();
+    indegree  = 0;
+    outdegree = 0;
+    if (wrank+1 < wsize) dests[outdegree++] = wrank+1;
+    if (wrank+3 < wsize) dests[outdegree++] = wrank+3;
+    if (wrank-2 >= 0) sources[indegree++] = wrank-2;
+
+    // Create with no reordering to test final ranks
+    dcomm = MPI::COMM_WORLD.Dist_graph_create_adjacent( indegree, sources,
+				outdegree, dests, MPI::INFO_NULL, false );
+    
+    
+    // Check that the created communicator has the properties specified
+    if (dcomm.Get_topology() != MPI_DIST_GRAPH) {
+	errs++;
+	cout << "Incorrect topology for dist_graph: " << 
+	    dcomm.Get_topology() << "\n";
+    }
+    else {
+	int myindegree, myoutdegree;
+	bool myweighted;
+	dcomm.Get_dist_neighbors_count( myindegree, myoutdegree, myweighted );
+	if (myindegree != indegree) {
+	    errs++;
+	    cout << "Indegree is " << myindegree << " should be " << indegree 
+		 << "\n";
+	}
+	if (myoutdegree != outdegree) {
+	    errs++;
+	    cout << "Outdegree is " << myoutdegree << " should be " << 
+		outdegree << "\n";
+	}
+	if (myweighted) {
+	    errs++;
+	    cout << "Weighted is true, should be false\n";
+	}
+    }
+    if (!errs) {
+	int mysources[4], mysweights[4], mydests[4], mydweights[4], i;
+	dcomm.Get_dist_neighbors( 4, mysources, mysweights, 
+				  4, mydests, mydweights );
+	// May need to sort mysources and mydests first
+	for (i=0; i<indegree; i++) {
+	    if (mysources[i] != sources[i]) {
+		errs++;
+	    }
+	}
+	for (i=0; i<outdegree; i++) {
+	    if (mydests[i] != dests[i]) {
+		errs++;
+	    }
+	}
+    }
+    dcomm.Free();
+
+    // ToDo: 
+    // Test dup and clone.  
+    // Test with weights.  
+    // Test with reorder.
+    // Test Dist_graph (not just adjacent) with awkward specification.
+    // Note that there is no dist_graph_map function in MPI (!)
+  
+    MTest_Finalize( errs );
+    MPI::Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/cxx/topo/testlist b/test/mpi/cxx/topo/testlist
new file mode 100644
index 0000000..5f2f4cb
--- /dev/null
+++ b/test/mpi/cxx/topo/testlist
@@ -0,0 +1 @@
+distgraphcxx 8
diff --git a/test/mpi/errors/cxx/errhan/throwtest.cxx b/test/mpi/errors/cxx/errhan/throwtest.cxx
index 12a3ba9..b00468d 100644
--- a/test/mpi/errors/cxx/errhan/throwtest.cxx
+++ b/test/mpi/errors/cxx/errhan/throwtest.cxx
@@ -15,6 +15,7 @@
 
 #include <mpi.h>
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 /* #define VERBOSE */
diff --git a/test/mpi/errors/cxx/io/throwtestfilex.cxx b/test/mpi/errors/cxx/io/throwtestfilex.cxx
index b28ca19..05ad038 100644
--- a/test/mpi/errors/cxx/io/throwtestfilex.cxx
+++ b/test/mpi/errors/cxx/io/throwtestfilex.cxx
@@ -15,6 +15,7 @@
 
 #include <mpi.h>
 #include <iostream>
+#include "mpitestconf.h"
 #include "mpitestcxx.h"
 
 /* #define VERBOSE */
diff --git a/test/mpi/include/mpitestcxx.h b/test/mpi/include/mpitestcxx.h
index a1301e7..57d15c2 100644
--- a/test/mpi/include/mpitestcxx.h
+++ b/test/mpi/include/mpitestcxx.h
@@ -4,6 +4,10 @@
  *  (C) 2001 by Argonne National Laboratory.
  *      See COPYRIGHT in top-level directory.
  */
+#ifndef MPITESTCONF_H_INCLUDED
+#error Required mpitestconf.h file not included first!
+#endif
+
 #ifndef MTEST_INCLUDED
 #define MTEST_INCLUDED
 /*

-----------------------------------------------------------------------

Summary of changes:
 src/binding/cxx/buildiface                |  202 ++++++++++++++++++++++++-----
 src/binding/cxx/cxxdecl3.dat              |    6 +
 test/mpi/configure.ac                     |    1 +
 test/mpi/cxx/coll/icallgathervx.cxx       |    1 +
 test/mpi/cxx/coll/icallgatherx.cxx        |    1 +
 test/mpi/cxx/coll/icbarrierx.cxx          |    1 +
 test/mpi/cxx/coll/icbcastx.cxx            |    1 +
 test/mpi/cxx/coll/icgathervx.cxx          |    1 +
 test/mpi/cxx/coll/icgatherx.cxx           |    1 +
 test/mpi/cxx/coll/icreducex.cxx           |    1 +
 test/mpi/cxx/pt2pt/bsend1cxx.cxx          |    2 +-
 test/mpi/cxx/pt2pt/sendrecvx.cxx          |    2 +-
 test/mpi/cxx/testlist.in                  |    1 +
 test/mpi/cxx/{spawn => topo}/Makefile.am  |    5 +-
 test/mpi/cxx/topo/distgraphcxx.cxx        |  100 ++++++++++++++
 test/mpi/cxx/topo/testlist                |    1 +
 test/mpi/errors/cxx/errhan/throwtest.cxx  |    1 +
 test/mpi/errors/cxx/io/throwtestfilex.cxx |    1 +
 test/mpi/include/mpitestcxx.h             |    4 +
 19 files changed, 296 insertions(+), 37 deletions(-)
 copy test/mpi/cxx/{spawn => topo}/Makefile.am (60%)
 create mode 100644 test/mpi/cxx/topo/distgraphcxx.cxx
 create mode 100644 test/mpi/cxx/topo/testlist


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list