You are on page 1of 2

#include "general_IO.

hpp"
#include "general_defs.hpp"
#include "maxchordal_subgraph.hpp"
#include <iostream>
#include <mpi.h>

using namespace std;

//Algorithm to Find the Maximal Chordal Subgraph in an Undirected Graph


int main(int argc, char *argv[])
{
int id; //Id of processor
int p; //Number of processors
int row_index=0;
float total_edge_wt; //Total weight of all edges
int b[500000];
MPI_Status status;
int fst;
double elapsed_time;
{

( argv[1] );
if ( !the_file.is_open() )
{
cout<<"Could not open file\n";
MPI_Abort(MPI_COMM_WORLD, MPI_ERR_ARG);
}

int m=atoi(argv[2]); //number of nodes


fst=atoi(argv[3]);
int undirected=atoi(argv[4]);
if(undirected==0) //Make the graph undirected
{
make_undirected(argv[1]);
cout << "before input \n";
row_index=graph_input("input.txt",fst,m,p,Allrows);
}
else
{
cout << "before input X\n";
row_index=graph_input(argv[1],fst,m,p,Allrows);
}
}
if(p>0)
{
MPI_Recv(&row_index,1, MPI_INT,0, 001, MPI_COMM_WORLD, &status);
MPI_Recv(&b, row_index, MPI_INT,0, 010, MPI_COMM_WORLD, &status);
}
MPI_Bcast(Allrows,p,MPI_INT,0,MPI_COMM_WORLD);
CSR C;
vector<int> myvals;
for(int k=0;k<row_index;k++)
{
myvals.push_back(b[k]); //Insert an element at the end of the
container (for 1D vectors/arrays).
}
create_CSR(myvals,&C);

You might also like