Closed Fernando3161 closed 4 years ago
I think this is a problem related to the interaction between the jit
decorator and pickling.
I'll try to test out the code tonight, but in the meantime a couple of things you could try:
https://esa.github.io/pygmo2/misc.html?highlight=set_serialization#pygmo.set_serialization_backend
jit
decorator not on the methods directly, but on functions defined within the bodies of the methods. Something like:def fitness(self, x):
@jit(float64[:](float64[:]), nopython=True)
def _a(x):
...
@jit(float64[:](float64[:]), nopython=True)
def _b(x):
...
@jit(float64[:](float64[:]), nopython=True)
def _c(x):
...
return [_a(x)[0], _b(x)[0], _c(x)[0]]
@Fernando3161 I tried the arch_example2.py
script on my linux machine and it does not produce any error. So perhaps this is a Windows-specific problem.
Did you try the suggestions I gave in my previous comment?
@Fernando3161 we had a similar problem in #31, where the workarounds suggested here successfully fixed the issue.
Hello! The problem was solved. Thanks for the input. I could implement the decorators properly. Works in win10 https://github.com/Fernando3161/git_archi/blob/master/multi_objective_optmization.py
@Fernando3161 glad that you solved it!
Keep in mind that we are still experiencing some issues when numba is used in conjunction with multiprocessing. We haven't gotten to the bottom of it yet, but the problems seem confined to a specific linux setup currently.
Will close this in the meantime.
Hi! I am trying to use the jit decorator to increase speed in a large problem. I am testing with the following function:
`class toy_problem_o2:
`def archipielago_opt(f,n): start = time.time() funct=f(n) name=funct.get_name()
if __name__ == '__main__': archipielago_opt(toy_problem_o2,2)
I am having an AssertionError,When I do it without the decorator, the problem works fine and I get the theoretical optimal solutions for 2 variables.
Can it be solved with the jit decorator?