Skip Menu |

This queue is for tickets about the Graph-Easy CPAN distribution.

Report information
The Basics
Id: 27759
Status: resolved
Worked: 15 min
Priority: 0/
Queue: Graph-Easy

People
Owner: Nobody in particular
Requestors: cpeel [...] us.ibm.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: v0.55 - ability to adjust layout time limit
Date: Tue, 26 Jun 2007 14:09:56 -0600
To: bug-Graph-Easy [...] rt.cpan.org
From: Casey Peel <cpeel [...] us.ibm.com>
Today I was looking for a way to easily output an ASCII-art version of an internally-used graph structure. Graph::Easy fit the bill *perfectly*, but, alas the layout engine is stopping before being able to output the graph (message is: layout did not finish in time). According to the FAQ there is a hard-coded limit of 5 seconds for the layout to complete. For my purposes, I'm more than happy to wait much longer than 5 seconds for this to complete. It would be nice to be able to specify the limit instead of having it hard-coded at 5 seconds. Not looking for it to be faster necessarily -- just that it be allowed to run for longer than 5 seconds without recompiling it. Using graphviz export isn't an option since graphviz doesn't appear to be able to do ASCII-art. Thanks, -- Casey Casey A. Peel IBM Tivoli Identity Manager Performance Team 303.353.5199 - cpeel@us.ibm.com Overclocking middleware since ITIM 4.4.
Subject: Re: [rt.cpan.org #27759] v0.55 - ability to adjust layout time limit
Date: Tue, 26 Jun 2007 23:30:00 +0200
To: bug-Graph-Easy [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, On Tuesday 26 June 2007 22:20:03 Casey Peel via RT wrote: Show quoted text
> Tue Jun 26 16:20:01 2007: Request 27759 was acted upon. > Transaction: Ticket created by cpeel@us.ibm.com > Queue: Graph-Easy > Subject: v0.55 - ability to adjust layout time limit > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: cpeel@us.ibm.com > Status: new > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27759 > > > > > Today I was looking for a way to easily output an ASCII-art version of an > internally-used graph structure. Graph::Easy fit the bill *perfectly*, > but, alas the layout engine is stopping before being able to output the > graph (message is: layout did not finish in time). > > According to the FAQ there is a hard-coded limit of 5 seconds for the > layout to complete. For my purposes, I'm more than happy to wait much > longer than 5 seconds for this to complete. It would be nice to be able > to specify the limit instead of having it hard-coded at 5 seconds. Not > looking for it to be faster necessarily -- just that it be allowed to run > for longer than 5 seconds without recompiling it. Using graphviz export > isn't an option since graphviz doesn't appear to be able to do ASCII-art.
It depends on how you do the layout: * with Graph::Easy in Perl use: my $graph Graph::Easy->new(); $graph->timeout(60); # 60 seconds * with graph-easy on the command line: graph-easy input.txt --timeout=60 Please not that in both cases the layout may not finish due to: * the graph being too complicated for the layouter. if so, please report this as a bug so I can fix it! * the layouter running into an endless loop - please report this too! In these case you can try to simplify the graph a bit, and see if this helps. I am sorry, but the current layouter really needs some work! (I intend to focus next weekend on Graph::Easy again, as my BigInt is now finished after todays round of heavy working :) Thanx for using my work, Tels - -- Signed on Tue Jun 26 23:26:13 2007 with key 0x93B84C15. Get one of my photo posters: http://bloodgate.com/posters PGP key on http://bloodgate.com/tels.asc or per email. "I don't remember which consonant to put the heavy-metal umlaut over, so "Spinal Tap" will have to do. Just take a cue from Mötlëy Crüë - thë mörë ümläüts, thë härdër yøü røck. It's some kind of rule or something. Or was it "the more umlauts, the harder you suck"? I can never remember..." -- general_re (8883) in http://slashdot.org/comments.pl?sid=113396&cid=9604233 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iQEVAwUBRoGFYHcLPEOTuEwVAQLAawf9FPbfHByyMK0slVM5tCf3UhDe4cf+f/o7 bKvwPo88HsiVZrPX4E/abitrvcJFSgHquwDcKoLDurWMM3UFwCtusjq0eSCqNBZy jjhR/Wj/2KEqEBvy0681JiiHI+V5rR6+nH0N4p7UY7srKIWAV3U2rff4/+Q8cgQ8 oygiw2uCNIrYr65h5ezckoZo6KoqR4K86XdvWo8biuZKx0KIdgoO/TACTajz8oL2 A4aSBaromc7X0Y5em4ylVWe1oSXrS6JZdRXBdDVOn0ajuriFcsvwn51eXlrDcpts ln8ygNa5T7Ko/gYbGAbde5jY58JrG+Bo8JYuPQrX4XIyagTMrgTxLw== =1R0+ -----END PGP SIGNATURE-----
From: cpeel [...] kence.org
Show quoted text
> my $graph Graph::Easy->new(); > $graph->timeout(60); # 60 seconds
Looks like I didn't dig around enough in the PODs -- thanks :) When I set the timeout to 120 seconds the script started sucking up memory and I had to cancel it. I'm uploading two files: a sample data file and a test script. Interestingly, if I sanitized the input file slightly differently the script didn't have the memory problem, only placed a few nodes and edges, then politely quit. The initial sanitizing changed the length of some of the strings so this makes sense as that obviously impacts how the nodes will be laid out.
[ b2cTempRolepwreset ] --> [ b2cGetResendstep1 ] [ checktamlockout ] --> [ suspenditimaccount ] [ checktamlockout ] --> [ END ] [ b2cTempRoleCheck ] --> [ b2cCheckPortalInst ] [ b2cTempRoleCheck ] --> [ b2cstringpwreset ] [ b2cSendEmailToOldAddress ] --> [ b2cMasterRoleChange ] [ START ] --> [ ESFState ] [ b2cResendStep1Email ] --> [ b2cNoAccess ] [ b2cNoAccessEmail ] --> [ MODIFYPERSON ] [ b2ccheckPortalInstance ] --> [ b2cResendStep1Email ] [ ENFORCEPOLICYFORPERSON ] --> [ B2CMigration ] [ ENFORCEPOLICYFORPERSON ] --> [ SendEmailToNewAddress ] [ ENFORCEPOLICYFORPERSON ] --> [ b2cSendEmailToNewAddress ] [ getprofilechange ] --> [ getstringpwreset ] [ getprofilechange ] --> [ profilechange ] [ suspenditimaccount ] --> [ END ] [ b2cstringpwreset ] --> [ b2cGetResendstep1 ] [ SendEmailToNewAddress ] --> [ checktamlockout ] [ MasterRoleModifiedEmail ] --> [ getpincleared ] [ MasterRoleChange ] --> [ MasterRoleModifiedEmail ] [ MasterRoleChange ] --> [ getpincleared ] [ profilechange ] --> [ getstringpwreset ] [ getOldEmailAddress ] --> [ SendEmailToOldAddress ] [ getOldEmailAddress ] --> [ checkPwdChange ] [ ESFState ] --> [ b2cRoleCheck ] [ resetcredentials ] --> [ MasterRoleChange ] [ MODIFYPERSON ] --> [ checktamlockout ] [ MODIFYPERSON ] --> [ ENFORCEPOLICYFORPERSON ] [ b2cGetResendstep1 ] --> [ b2ccheckPortalInstance ] [ b2cGetResendstep1 ] --> [ b2cNoAccess ] [ pincleared ] --> [ getprofilechange ] [ b2cGetOldEmailAddress ] --> [ b2cSendEmailToOldAddress ] [ b2cGetOldEmailAddress ] --> [ b2cMasterRoleChange ] [ b2cMasterRoleModifiedEmail ] --> [ b2cGetProfileChange ] [ b2cCheckPortalInst ] --> [ b2cTempRolepwreset ] [ b2cNoAccess ] --> [ b2cCkPortInst ] [ b2cNoAccess ] --> [ MODIFYPERSON ] [ sendTimemail ] --> [ MODIFYPERSON ] [ b2cRoleCheck ] --> [ b2cGetOldEmailAddress ] [ b2cRoleCheck ] --> [ getOldEmailAddress ] [ B2CMigration ] --> [ B2CmigrationMaster ] [ stringpwreset ] --> [ getresendstep1 ] [ getstringpwreset ] --> [ getresendstep1 ] [ getstringpwreset ] --> [ stringpwreset ] [ ChangePassword ] --> [ resetcredentials ] [ b2cProfileChange ] --> [ b2cGetstringpwreset ] [ getpincleared ] --> [ pincleared ] [ getpincleared ] --> [ getprofilechange ] [ getresendstep1 ] --> [ checkPortalInst ] [ getresendstep1 ] --> [ MODIFYPERSON ] [ SendEmailToOldAddress ] --> [ checkPwdChange ] [ checkPwdChange ] --> [ resetcredentials ] [ checkPwdChange ] --> [ ChangePassword ] [ b2cSendEmailToNewAddress ] --> [ checktamlockout ] [ b2cCkPortInst ] --> [ b2cNoAccessEmail ] [ b2cGetstringpwreset ] --> [ b2cTempRoleCheck ] [ b2cGetstringpwreset ] --> [ b2cGetResendstep1 ] [ b2cMasterRoleChange ] --> [ b2cMasterRoleModifiedEmail ] [ b2cMasterRoleChange ] --> [ b2cGetProfileChange ] [ checkPortalInst ] --> [ sendTimemail ] [ b2cGetProfileChange ] --> [ b2cProfileChange ] [ b2cGetProfileChange ] --> [ b2cGetstringpwreset ] [ B2CmigrationMaster ] --> [ checktamlockout ]
#!/usr/bin/perl use Graph::Easy; use Graph::Easy::Parser; $filename = "sanitized.txt"; $parser = Graph::Easy::Parser->new(); $graph = $parser->from_file($filename); # testcase 1: # outputs: layout did not finish in time if(1) { $graph->set_attribute("flow","south"); print $graph->as_ascii(); } # testcase 2: # outputs: nothing, eats memory like it was candy before I had to kill it if(0) { $graph->timeout(120); $graph->set_attribute("flow","south"); print $graph->as_ascii(); }
Subject: Re: [rt.cpan.org #27759] v0.55 - ability to adjust layout time limit
Date: Wed, 27 Jun 2007 07:38:56 +0200
To: bug-Graph-Easy [...] rt.cpan.org
From: Tels <nospam-abuse [...] bloodgate.com>
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hello, On Wednesday 27 June 2007 00:52:02 Casey Peel via RT wrote: Show quoted text
> Queue: Graph-Easy > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=27759 > >
> > my $graph Graph::Easy->new(); > > $graph->timeout(60); # 60 seconds
> > Looks like I didn't dig around enough in the PODs -- thanks :) > > When I set the timeout to 120 seconds the script started sucking up > memory and I had to cancel it. I'm uploading two files: a sample data > file and a test script. > > Interestingly, if I sanitized the input file slightly differently the > script didn't have the memory problem, only placed a few nodes and > edges, then politely quit. The initial sanitizing changed the length of > some of the strings so this makes sense as that obviously impacts how > the nodes will be laid out.
Thanx for the report, I look into it as soon as possible. I know there is someendles-loop somewhere but I haven't found an easy testcase to trigger it yet. In any event, it should neither eat up all memory, nor abot the layout :) PS: I just noticed it is not possible to set the timeout via the Mediawiki integration - oops :) All the best, Tels - -- Signed on Wed Jun 27 07:37:25 2007 with key 0x93B84C15. Get one of my photo posters: http://bloodgate.com/posters PGP key on http://bloodgate.com/tels.asc or per email. Ich bin mit der Gesamtsituation unzufrieden! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iQEVAwUBRoH3+ncLPEOTuEwVAQLnqgf9GsRAcmRBh5Ch6h6kCDyVbXsUqn7SJ6BZ ONoC8U7sz5qL7nJu3e3te6diYFa5WzoEQNAfN8cj3/OFDIYPVuqKPQog3MonHZcc eNSclOXK2pr0dkJLTKf6aEA5mmn4I1diGvAYRi9Ef9cLWt30bziHWV9psygMvChU qVBRQKffxoIKSF70O1xB4vrfz5oXcnPLLnjFNdkymMol5nhJLYUmED3ZAXI+qcg7 r/S5CUzRHh63ZAAc62v0Di1KFR238Oivt6AgvYZAWHFmXOqclbscCNzWy27PMv2j 94IQp3+PVX/uTNd1GVsXqnKJryKqSYB9R0dG7H/2Du2zGhQ6F2fQmQ== =O1qu -----END PGP SIGNATURE-----
On Wed Jun 27 01:38:43 2007, nospam-abuse@bloodgate.com wrote: Sorry for the long delay, I recently got another bug report with a smaller testcase for an endless loop and fixed two occurances of this. And now your input example finishes without eating all memory :) Although it is only able to draw all but one edge. The fix will be in the soon-to-be-released v0.58 of Graph::Easy. Again sorry for the delay, Tels
Forgot to close this bug report. The Layouter still needs some work, but the basic issues you had (setting timeout, and memory leak and endless loop) are now fixed. Thank you for your report! :)