Buggy code:
FgsCli . knowledgeFile = Args . getPathFile ( cmd . getOptionValue ( "knowledge" , null ) , false ) ; FgsCli . variableFile = Args . getPathFile ( cmd . getOptionValue ( "exclude-variables" , null ) , false ) ; FgsCli . delimiter = Args . getCharacter ( cmd . getOptionValue ( "delimiter" , "\t" ) ) ; FgsCli . penaltyDiscount = Args . getDouble ( cmd . getOptionValue ( "penalty-discount" , "4.0" ) ) ; FgsCli . depth = Args . getIntegerMin ( cmd . getOptionValue ( "depth" , "-1" ) , ( - 1 ) ) ; FgsCli . faithfulness = cmd . hasOption ( "faithful" ) ; FgsCli . numOfThreads = Args . getInteger ( cmd . getOptionValue ( "thread" , Integer . toString ( Runtime . getRuntime ( ) . availableProcessors ( ) ) ) ) ; FgsCli . verbose = cmd . hasOption ( "verbose" ) ; FgsCli . ignoreLinearDependence = cmd . hasOption ( "ignore-linear-dependence" ) ; FgsCli . graphML = cmd . hasOption ( "graphml" ) ; FgsCli . dirOut = Args . getPathDir ( cmd . getOptionValue ( "out" , "." ) , false ) ; FgsCli . outputPrefix = cmd . getOptionValue ( "output-prefix" , String . format ( "fgs_%s_%d" , FgsCli . dataFile . getFileName ( ) , System . currentTimeMillis ( ) ) ) ; FgsCli . validationOutput = ! ( cmd . hasOption ( "no-validation-output" ) ) ; } catch ( ParseException | FileNotFoundException exception ) { System . err . println ( exception . getLocalizedMessage ( ) ) ; FgsCli . showHelp ( ) ; System . exit ( ( - 127 ) ) ; } try { Path outputFile = Paths . get ( FgsCli . dirOut . toString ( ) , ( ( FgsCli . outputPrefix ) + ".txt" ) ) ; try ( PrintStream writer = new PrintStream ( new BufferedOutputStream ( Files . newOutputStream ( outputFile , StandardOpenOption . CREATE ) ) ) ) { writer . println ( "Runtime<seq2seq4repair_space>Parameters:" ) ; writer . printf ( "number<seq2seq4repair_space>of<seq2seq4repair_space>threads<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , FgsCli . numOfThreads ) ; writer . printf ( "verbose<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . verbose ) ; writer . println ( ) ; writer . println ( "Algorithm<seq2seq4repair_space>Parameters:" ) ; writer . printf ( "penalty<seq2seq4repair_space>discount<seq2seq4repair_space>=<seq2seq4repair_space>%f\n" , FgsCli . penaltyDiscount ) ; writer . printf ( "depth<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . depth ) ; writer . printf ( "faithfulness<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . faithfulness ) ; writer . printf ( "ignore<seq2seq4repair_space>linear<seq2seq4repair_space>dependence<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . ignoreLinearDependence ) ; writer . println ( ) ; File datasetFile = FgsCli . dataFile . toFile ( ) ; int numOfCases = ( DataUtility . countLine ( datasetFile ) ) - 1 ; int numOfVars = DataUtility . countColumn ( datasetFile , FgsCli . delimiter ) ; writer . println ( "Data<seq2seq4repair_space>File:" ) ; writer . printf ( "file<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . dataFile . getFileName ( ) ) ; writer . printf ( "cases<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , numOfCases ) ; writer . printf ( "variables<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , numOfVars ) ; writer . println ( ) ; if ( ( FgsCli . knowledgeFile ) != null ) { writer . println ( "Knowledge:" ) ; writer . printf ( "file<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . knowledgeFile . getFileName ( ) ) ; writer . println ( ) ; } Set < String > variables = FileIO . extractUniqueLine ( FgsCli . variableFile ) ; if ( ( FgsCli . variableFile ) != null ) { writer . println ( "Variable<seq2seq4repair_space>Exclusion:" ) ; writer . printf ( "file<seq2seq4repair_space>=<seq2seq4repair_space>%s\n" , FgsCli . variableFile . getFileName ( ) ) ; writer . printf ( "variables<seq2seq4repair_space>to<seq2seq4repair_space>exclude<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , variables . size ( ) ) ; writer . println ( ) ; } DatasetReader datasetReader = new TabularDatasetReader ( FgsCli . dataFile , FgsCli . delimiter ) ; DataSet dataSet = datasetReader . readInContinuousData ( variables ) ; writer . println ( "Dataset<seq2seq4repair_space>Read<seq2seq4repair_space>In:" ) ; writer . printf ( "cases<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , dataSet . getNumRows ( ) ) ; writer . printf ( "variables<seq2seq4repair_space>=<seq2seq4repair_space>%,d\n" , dataSet . getNumColumns ( ) ) ; writer . println ( ) ; FgsCli . validate ( dataSet , writer ) ; Fgs fgs = new Fgs ( new edu . cmu . tetrad . data . CovarianceMatrixOnTheFly ( dataSet ) ) ; fgs . setOut ( writer ) ; fgs . setDepth ( FgsCli . depth ) ; fgs . setIgnoreLinearDependent ( FgsCli . ignoreLinearDependence ) ; fgs . setPenaltyDiscount ( FgsCli . penaltyDiscount ) ; fgs . setNumPatternsToStore ( 0 ) ; fgs . setFaithfulnessAssumed ( FgsCli . faithfulness ) ; <START_BUG> fgs . setNumProcessors ( FgsCli . numOfThreads ) ; <END_BUG> fgs . setVerbose ( FgsCli . verbose ) ; if ( ( FgsCli . knowledgeFile ) != null ) { fgs . setKnowledge ( IKnowledgeFactory . readInKnowledge ( FgsCli . knowledgeFile ) ) ; } writer . flush ( ) ; Graph graph = fgs . search ( ) ; writer . println ( ) ; writer . println ( graph . toString ( ) . trim ( ) ) ; writer . flush ( ) ; if ( FgsCli . graphML ) { Path graphOutputFile = Paths . get ( FgsCli . dirOut . toString ( ) , ( ( FgsCli . outputPrefix ) + "_graph.txt" ) ) ; try ( PrintStream graphWriter = new PrintStream ( new BufferedOutputStream ( Files . newOutputStream ( graphOutputFile , StandardOpenOption . CREATE ) ) ) ) { graphWriter . println ( GraphmlSerializer . serialize ( graph , FgsCli . outputPrefix ) ) ; } } } } catch ( Exception exception ) { System . err . println ( exception . getMessage ( ) ) ; System . exit ( ( - 126 ) ) ; } } private static void validate ( DataSet dataSet , PrintStream writer ) throws Exception { } private static void writeToFile ( Path outputFile , Set < String > set ) { } private static void showHelp ( ) { } }

Fix:
fgs . setParallelism ( FgsCli . numOfThreads ) ;