function [ ovFlag ] = rctbsx_routControl_uncorsen_fn ( PGandSigEdgeCong , currLevel )


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% uncorsening, only call routing %%%%%%%%%%%%

disp(sprintf('Begin uncoarsening, call routing only!!')) ;


display ( 'Printing matlab cong to ../benchmark/matlabCong.out')
fid = fopen('/home/jho/routing/tpsmultilevel/benchmark/matlabCong.out','w') ;
[m,n]=size(PGandSigEdgeCong) ;
for i=1:m
	PGandSigEdgeCong ( i , 1 ) = ceil ( PGandSigEdgeCong ( i , 1 )) ;
end
for i=1:m
	fprintf (fid, '%d \n' , PGandSigEdgeCong( i , 1 )) ;
end
fclose(fid) ;

display ( 'Printing matlab ML setting to ../benchmark/matlabMLSetting.out' )
fid = fopen('/home/jho/routing/tpsmultilevel/benchmark/matlabMLSetting.out','w') ;
fprintf ( fid, 'rout_level_num %d \n' , currLevel ) ;
fprintf ( fid, 'uncorsen\n' ) ;
fclose(fid);

disp(sprintf('Calling Routing Routine: (Curr Level %d) UNCORSENING.. ...\n',currLevel));
system('/home/jho/routing/tpsmultilevel/src/batch.sh') ;

disp(sprintf('Finished Uncoarsening Routing Routine\n'));
disp(sprintf('The routing data is in ../benchmark/routResults.out')) ;
disp(sprintf('The edge usage data is in ../benchmark/routEdgeResults.out')) ;

disp(sprintf('The flag to see if ovflow occured during routing is in ../benchmark/routOvResults.out')) ;
fid = fopen('/home/jho/routing/tpsmultilevel/benchmark/routOvResults.out','r') ;
[ovFlag] = textread ('/home/jho/routing/tpsmultilevel/benchmark/routOvResults.out', '%d') ;
disp(sprintf('There is routing ov YES(1) NO(0) %d\n', ovFlag)) ;






