cirosantilli/parsec-benchmark

freqmine enters infinite loop if there would be no outputs due to high minimum support

samuel-cavalcanti opened this issue · 3 comments

@************ can you reproduce this bug ?

 parsecmgmt -a run -p freqmine -i native

btw, I fix it. In the fpmax.cpp , you must change the return 0 to exit(0) and move the FSout* fout,
before the if statement.

	fptree->init(-1, 0, 0);
	FSout* fout; // move <- HERE
#ifdef ENABLE_PARSEC_HOOKS
	__parsec_roi_begin();
#endif
	fptree->scan2_DB(workingthread);
	fdat->close();
	if(fptree->itemno==0)return 0;
	
	if(argc==4)
	{
		fout = new FSout(argv[3]);
			fptree->generate_all(fptree->itemno, 0, fout);
		
		printLen();
		exit(0); //<- HERE
	}

	fptree->FP_growth_first(fout);

Oi!

I don't reproduce:

./get-inputs -n
time parsecmgmt -a run -p freqmine -i native

runs successfully:

[PARSEC] Benchmarks to run:  parsec.freqmine

[PARSEC] [========== Running benchmark parsec.freqmine [1] ==========]
[PARSEC] Deleting old run directory.
[PARSEC] Setting up run directory.
[PARSEC] Unpacking benchmark input 'native'.
webdocs_250k.dat
[PARSEC] Running 'time /home/ciro/bak/git/parsec-benchmark/pkgs/apps/freqmine/inst/amd64-linux.gcc/bin/freqmine webdocs_250k.dat 11000':
[PARSEC] [---------- Beginning of output ----------]
PARSEC Benchmark Suite Version 3.0-beta-20150206
transaction number is 250000
829
28599
363898
2699198
13410070
47495313
124190838
245065199
369974305
430373350
386138019
265795578
138598934
53551164
14790217
2753445
311877
17498
269
the data preparation cost 0.840124 seconds, the FPgrowth cost 345.384833 seconds

real    5m46.238s
user    5m45.661s
sys     0m0.488s
[PARSEC] [----------    End of output    ----------]
[PARSEC]
[PARSEC] BIBLIOGRAPHY
[PARSEC]
[PARSEC] [1] Bienia. Benchmarking Modern Multiprocessors. Ph.D. Thesis, 2011.
[PARSEC]
[PARSEC] Done.

real    5m47.054s
user    5m46.164s
sys     0m0.916s

Are you sure you have the right input file? How much time did you give it?

However, I do think there's a bug in that program. It appears that if there are no outputs for a given minimum-support (i.e. high minium-support), it just never exits, e.g. these work fine:

cd pkgs/apps/freqmine
./inst/amd64-linux.gcc/bin/freqmine inputs/T10I4D100K_3.dat 1
./inst/amd64-linux.gcc/bin/freqmine inputs/T10I4D100K_3.dat 2

but this fails as there aren't any sets with support 3 or greater:

./inst/amd64-linux.gcc/bin/freqmine inputs/T10I4D100K_3.dat 3

I don't think your patch will solve this, GDB indicates (modify to add -g to the Makefile) that the the infinite loop happens at:

	fptree -> scan1_DB(fdat);

native runs with a relatively large argument of 11k:

run_args="webdocs_250k.dat 11000"

so if a different smaller input (not the corredt 250k entries one) is given, it will also likely loop (has to have at least 11k lines).

You are right. My issue appears with a custom input. I will look in this scan1_DB function, maybe I can fix it.
Desde já obrigado pela atenção e pela resposta super completa.

OK! Sem problema. I actually had some fun with this stuff!