On Wed, Sep 16, 2009 at 9:05 AM, J. Cooley <j.a.coo...@warwick.ac.uk> wrote:
>
> Hi,
>
> I've written with my supervisor some code that computes the isogeny
> class of a curve over QQ. I would like to check it with the entire
> Cremona database overnight, but I'm not sure how to do that!
>
> To do it case by case I would do something like:
>
> sage: isogs, matrix = E.isogeny_class()
> sage: curves, matrix = E.isogeny_class()
> sage: newcurves, newmatrix = E.isogeny_class_new()
> sage: old = curves.sort()
> sage: new = newcurves.sort()
> sage: old == new
>
> where E is an elliptic curve in the Cremona database. I would like to
> leave this running overnight to check all the database, I have the
> full database (up to conductor 130,000) on my clone.
>
> I'm can run this on up to 8 cores on the computer I'm working on. I am
> very very new to programming in general, so if you could please tell
> me things like how to stop it timing out, how I can tell if it's using
> too much memory and/or is likely to crash the machine, how to stop it
> if it looks like it's going to take 100 years, if it's not quite done
> in the morning how I can continue to work on other stuff at the same
> time.
>
> Sorry for being such a newbie! Thanks in advance.
> Jenny

If you finish your code and post it to a trac ticket, I assure you
that if I'm the referee, I would run the test you mention above, then
take some glee in finding problems :-)

As far as explaining how to solve all the problems you mention above about
timeouts, etc., that would take a while to explain.  However, here are
some hints:

  * see the "alarm" command, by typing "alarm?"

  * check out the @parallel decorator  (note that you can't pickle and
send elliptic curves with @parallel due to some unresolved issue
involving forking an pari, so just send their Cremona label instead).

  * you should perhaps keep track of timings so you can compare the
speed of your implementation to the one already in Sage, which John
Cremona wrote (it's a PARI script, though).  If so, use the walltime
command (see "walltime?").

  * Regarding memory, type "man bash" and search for ulimit.  You
would type something like "ulimit -v 6400000" at the command line
before starting your program.  That would limit memory usage.    (By
the way, I think sysadmins *should* turn off linux virtual memory
overcommit for machines running big-memory calculations.)  All that
said, does your code use much memory?

  * Definitely use "try/except", since that allows your code to keep
going even if it fails in one case, e.g.,:

   try:
       something()
   except Exception, msg:
       record_failure(msg)

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to