<commit_before>/**
  * Created by ashiqimran on 3/6/17.
  */
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
import scala.annotation.tailrec
import scala.reflect.ClassTag
import scala.util._
//import org.apache.spark._
import org.apache.spark.graphx._
import org.apache.spark.internal.Logging
import org.apache.spark.rdd.RDD
object GraphGenerator {
  val RMATa = 0.45
  val RMATb = 0.15
  val RMATd = 0.25
  val RMATc = 0.15
  def main(args: Array[ String ]): Unit = {


    val conf = new SparkConf().setAppName("GraphGenerator")
    //conf.setMaster("local[1]")
    val sc = new SparkContext(conf)
    val V = args(0);
    val E = args(1);
    val result:Graph[Int, Int] = rmatGraph(sc,V,E)
    //result.vertices.saveAsTextFile("vertices")
    result.edges.map{case Edge(src, dst, prop) => (src , dst)}.map(x=>s”${x._1},${x._2}”).repartition(1).saveAsTextFile("edges")

  }

  def rmatGraph(sc: SparkContext, requestedNumVertices: Int, numEdges: Int): Graph[Int, Int] = {
    // let N = requestedNumVertices
    // the number of vertices is 2^n where n=ceil(log2[N])
    // This ensures that the 4 quadrants are the same size at all recursion levels
    val numVertices = math.round(<commit_msg>Working version<commit_after>/**
  * Created by ashiqimran on 3/6/17.
  */
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
import scala.annotation.tailrec
import scala.reflect.ClassTag
import scala.util._
//import org.apache.spark._
import org.apache.spark.graphx._
import org.apache.spark.internal.Logging
import org.apache.spark.rdd.RDD
object GraphGenerator {
  val RMATa = 0.45
  val RMATb = 0.15
  val RMATd = 0.25
  val RMATc = 0.15
  def main(args: Array[ String ]): Unit = {


    val conf = new SparkConf().setAppName("GraphGenerator")
    conf.setMaster("local[2]")
    val sc = new SparkContext(conf)
    val V = Integer.parseInt(args(0))
    val E = Integer.parseInt(args(1))
    val result:Graph[Int, Int] = rmatGraph(sc,V,E)
    //result.vertices.saveAsTextFile("vertices")
    result.edges.map{case Edge(src, dst, prop) => (src , dst)}.map(x=>s"${x._1},${x._2}").repartition(1).saveAsTextFile("edges")


    //println(result.vertices.collect().mkString("\n"))
  }

  def rmatGraph(sc: SparkContext, requestedNumVertices: Int, numEdges: Int): Graph[Int, Int] = {
    // let N = requestedNumVertices
    // the number of vertices is 2^n where n=ceil(log2[N])
    // This ensures that the 4 quadrants are the same size at all recursion levels
    val numVertices = math.round(
{'fraction_non_alphanumeric': 0.14065586724614776, 'fraction_numerical': 0.019755037534571317, 'mean_word_length': 3.741573033707865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4308977', 'n_tokens_mistral': 933, 'n_tokens_neox': 878, 'n_words': 213}