Re: [sage-support] problem with parallel decorator

2013-02-20 Thread mmarco
I have opened ticket #14154 with a more detailed description, and the code 
that triggers the problem (eventually).

El miércoles, 20 de febrero de 2013 22:21:22 UTC+1, William escribió:
>
> On Wed, Feb 20, 2013 at 11:27 AM, mmarco > 
> wrote: 
> > I am writing some complicated code to compute braid monodromy of plane 
> > curves. In order to do so, i am using a @parallel decorator on some 
> > function. But i am finding some strange behaviour: the first time that i 
> run 
> > it, it works ok. But after that, if i try to re-run the same 
> computation, i 
> > get no answer. After a long wait (much longer than the expected time for 
> an 
> > answer), i stop the computation (pressing ESC in the notebook), and i 
> get 
> > the message "killing any remaining workers". 
> > 
> > Has somebody experienced something like this? Is there any known 
> solution? 
>
> @parallel is just a lightweight wrapper around the operating system 
> fork -- it's a few hundred lines of code total.   See 
>
>
> http://hg.sagemath.org/sage-main/file/ec1fb07db6e2/sage/parallel/use_fork.py#l1
>  
>
> I have no clue what problem you're having, given the ambiguous nature 
> of your description and that you did not provide any source code. 
> However, a general issue with fork involves what happens file 
> descriptors, e.g., open connections to subprocesses -- it's possible 
> that could be relevant for you... 
>
> William 
>
>
>
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> Groups 
> > "sage-support" group. 
> > To unsubscribe from this group and stop receiving emails from it, send 
> an 
> > email to sage-support...@googlegroups.com . 
> > To post to this group, send email to 
> > sage-s...@googlegroups.com. 
>
> > Visit this group at http://groups.google.com/group/sage-support?hl=en. 
> > For more options, visit https://groups.google.com/groups/opt_out. 
> > 
> > 
>
>
>
> -- 
> William Stein 
> Professor of Mathematics 
> University of Washington 
> http://wstein.org 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] problem with parallel decorator

2013-02-20 Thread William Stein
On Wed, Feb 20, 2013 at 11:27 AM, mmarco  wrote:
> I am writing some complicated code to compute braid monodromy of plane
> curves. In order to do so, i am using a @parallel decorator on some
> function. But i am finding some strange behaviour: the first time that i run
> it, it works ok. But after that, if i try to re-run the same computation, i
> get no answer. After a long wait (much longer than the expected time for an
> answer), i stop the computation (pressing ESC in the notebook), and i get
> the message "killing any remaining workers".
>
> Has somebody experienced something like this? Is there any known solution?

@parallel is just a lightweight wrapper around the operating system
fork -- it's a few hundred lines of code total.   See

http://hg.sagemath.org/sage-main/file/ec1fb07db6e2/sage/parallel/use_fork.py#l1

I have no clue what problem you're having, given the ambiguous nature
of your description and that you did not provide any source code.
However, a general issue with fork involves what happens file
descriptors, e.g., open connections to subprocesses -- it's possible
that could be relevant for you...

William



>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>



-- 
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] problem with parallel decorator

2013-02-20 Thread mmarco
I am writing some complicated code to compute braid monodromy of plane 
curves. In order to do so, i am using a @parallel decorator on some 
function. But i am finding some strange behaviour: the first time that i 
run it, it works ok. But after that, if i try to re-run the same 
computation, i get no answer. After a long wait (much longer than the 
expected time for an answer), i stop the computation (pressing ESC in the 
notebook), and i get the message "killing any remaining workers".

Has somebody experienced something like this? Is there any known solution?

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] Re: set Gurobi parameters in MixedIntegerLinearProgram?

2013-02-20 Thread Nathann Cohen
Hell !!!

The Gurobi and CPLEX backends for MixedIntegerLinearProgram() are extremely 
> convenient.  
>

Glad to learn it :-)
 

> Is there any prospect of solver_parameter() being implemented in the 
> Gurobi backend?
>

None from me ! I use CPLEX at the moment but I never mess with the solver 
parameters in the first place. I think I implemented #10785 for a friend 
who needed it :-)
 

> At present, when I use MixedIntegerLinearProgram()  with solver="Gurobi" 
> and try to set a Gurobi parameter using p.solver_parameter(), I get a 
> "not implemented" error.


Yepyepyep ! The solver_parameter method forwards everything it is given to 
thebackend, and there is no solver_parameter in the Gurobi backend.

I'm most interested in changing the tolerance for equality constraints for 
> an MIP.  I'd also like to change the 'threads' parameter (to be polite to 
> colleagues with whom I share an 8 core machine).
>

Ahahahah. You could also use "nice" when you start Sage ! This way Gurobi 
will not eat all the ressources :-)

I'd switch to solver="CPLEX", for which -- according to the documentation 
> -- the backend does implement 
> solver_parameter(), except that CPLEX is taking forever to solve MIPs that 
> Gurobi solves quickly.  It could be a difference i the default parameter 
> settings.
>

Well... Would you be willing to write this patch yourself ? I can help a 
bit and I will most probably be the one to review your patch before it gets 
included into Sage, but I do not even have Gurobi installed on my machine 
right now... Their license procedure is a nightmare :-)

Nathann

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] set Gurobi parameters in MixedIntegerLinearProgram?

2013-02-20 Thread Raniere Silva
Hi Daniel,

> The Gurobi and CPLEX backends for MixedIntegerLinearProgram() are extremely 
> convenient.  
> 
> Is there any prospect of solver_parameter() being implemented in the Gurobi 
> backend?

No.

Nathann work in the parameters for GLPK
(http://trac.sagemath.org/sage_trac/ticket/12736) and AFAIK didn't it for any
other solver.

Raniere

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] set Gurobi parameters in MixedIntegerLinearProgram?

2013-02-20 Thread Daniel Friedan
The Gurobi and CPLEX backends for MixedIntegerLinearProgram() are extremely 
convenient.  

Is there any prospect of solver_parameter() being implemented in the Gurobi 
backend?

At present, when I use MixedIntegerLinearProgram()  with solver="Gurobi" 
and try to set a Gurobi parameter using p.solver_parameter(), I get a "not 
implemented" error.

I'm most interested in changing the tolerance for equality constraints for 
an MIP.  I'd also like to change the 'threads' parameter (to be polite to 
colleagues with whom I share an 8 core machine).

I'd switch to solver="CPLEX", for which -- according to the documentation 
-- the backend does implement 
solver_parameter(), except that CPLEX is taking forever to solve MIPs that 
Gurobi solves quickly.  It could be a difference i the default parameter 
settings.

thanks,
Daniel


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] using cpickle to store matrix object

2013-02-20 Thread akhil
Thanks a lot for your prompt help.

Regards,

AKHIL.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [sage-support] using cpickle to store matrix object

2013-02-20 Thread Robert Bradshaw
It's cPickle with a capital P.

On Wed, Feb 20, 2013 at 2:30 AM, akhil  wrote:
> Hello,
>
>
> I want to use cpickle to store a matrix object in a text file. Sample code
> is as follows:
>
> A = matrix(GF(2),2,3)  #creating a 2 * 3 matrix having all entries
> zero
>
> import cpickle as pickle
>
> pickle.dump(A,open("testpickle.txt",'w'))
>
> sage: Traceback (most recent call last):
>   File "s_rough.py", line 6, in 
> import cpickle as pickle
> ImportError: No module named cpickle
>
> The same code when tried with the pickle module, works as desired.
> Is this because cpickle is not supported in SAGE? Or is there a mistake in
> the way it is being called?
>
> Please help.
>
> Thanks and regards,
>
> AKHIL.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-support+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-support@googlegroups.com.
> Visit this group at http://groups.google.com/group/sage-support?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




[sage-support] using cpickle to store matrix object

2013-02-20 Thread akhil
Hello,


I want to use cpickle to store a matrix object in a text file. Sample code 
is as follows:

A = matrix(GF(2),2,3)  #creating a 2 * 3 matrix having all entries 
zero

import cpickle as pickle

pickle.dump(A,open("testpickle.txt",'w'))

sage: Traceback (most recent call last):
  File "s_rough.py", line 6, in 
import cpickle as pickle
ImportError: No module named cpickle

The same code when tried with the pickle module, works as desired.
Is this because cpickle is not supported in SAGE? Or is there a mistake in 
the way it is being called?

Please help.

Thanks and regards,

AKHIL.


-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.