#include "LinkedList.h"
//#include "TestList.h"
#include "ca1.h"
#include <exception>
#include <string>
#include<fstream>
#include "mpi.h"

using std::exception;
using std::cout;
using std::endl;
using std::string;


int main(int argc, char* argv[]) {
	//testList();
  MPI_Init(&argc, &argv);
  // int prim = 0;
  // int rel = 0;
  try {
      run();
      //    for(int i = 1; i < n; i++) {
      // if(isPrimRoot(i)) prim++;
      // if(isRelPrime(i)) rel++;
      // }
      // cout<<"RelPrime: "<< rel << "\nPrim Root: " << prim << "\n";
  } catch (...) {
    //do nothing, just let MPI_Finalize() run
  }
  MPI_Finalize();
  ofstream status("status.txt");
  status << "Exiting program\n";
  status.close();
  return 0;
}