
function [ sigEdgeCong ] = rctbsx_routControl_corsen_fn ( PGandSigEdgeCong , urrLevel )

global numEdges 

disp(sprintf('##########temp is below threshold###############\n'))
display ( 'Printing matlab cong to ../benchmark/matlabCong.out' )
fid = fopen('/home/jho/routing/tpsmultilevel/benchmark/matlabCong.out','w') ;
[m,n]=size(PGandSigEdgeCong) ;
m
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, 'corsen\n' ) ;
fclose(fid);

%% need to tell the routing whether this is the 1st iteration or not
%% if iter > 1, then routing needs to read in the previous routing results
%% else do not read in previous routing results as there are none!!!

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

disp(sprintf('Finished Routing Routine\n'));
disp(sprintf('Reading in signal congestion info from routEdgeResults.out')) ;
[eidc,eid,congc,cong]=textread('/home/jho/routing/tpsmultilevel/benchmark/routEdgeResults.out', '%s %d %s %d');

sigEdgeCong = cong ;
