-typedef struct s_smpi_mpi_cart_topology {
- int nnodes;
- int ndims;
- int *dims;
- int *periodic;
- int *position;
-} s_smpi_mpi_cart_topology_t;
-
-typedef struct s_smpi_mpi_graph_topology {
- int nnodes;
- int nedges;
- int *index;
- int *edges;
-} s_smpi_mpi_graph_topology_t;
-
-typedef struct s_smpi_dist_graph_topology {
- int indegree;
- int *in;
- int *in_weights;
- int outdegree;
- int *out;
- int *out_weights;
- int is_weighted;
-} s_smpi_mpi_dist_graph_topology_t;
-
-typedef struct s_smpi_mpi_topology {
- MPIR_Topo_type kind;
- union topo {
- MPIR_Graph_Topology graph;
- MPIR_Cart_Topology cart;
- MPIR_Dist_Graph_Topology dist_graph;
- } topo;
-} s_smpi_mpi_topology_t;
-
-void smpi_topo_destroy(MPI_Topology topo) {
- if(topo == nullptr) {
- return;
- }
- switch (topo->kind) {
- case MPI_CART:
- smpi_cart_topo_destroy(topo->topo.cart);
- break;
- case MPI_GRAPH:
- // This topology is not supported by SMPI yet
- smpi_graph_topo_destroy(topo->topo.graph);
- break;
- case MPI_DIST_GRAPH:
- // This topology is not supported by SMPI yet
- smpi_dist_graph_topo_destroy(topo->topo.dist_graph);
- break;
- default:
- return;
- }
- xbt_free(topo);
-}
+/* static functions */
+static int assignnodes(int ndim, int nfactor, int *pfacts,int **pdims);
+static int getfactors(int num, int *nfators, int **factors);