Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelization not finishing #146

Closed
sabrinadraude opened this issue May 28, 2020 · 10 comments
Closed

Parallelization not finishing #146

sabrinadraude opened this issue May 28, 2020 · 10 comments
Labels

Comments

@sabrinadraude
Copy link

Hi,

I have been using the parallelization aspect of Platypus. However the code never finishes, after hours of leaving it to run. I'm not sure if there is something else I need to download?

problem = Problem(multiple_days_assigned_size, 2, 2)
problem.directions[1] = Problem.MINIMIZE
problem.directions[0] = Problem.MINIMIZE
problem.constraints[:] = ">=0"
problem.types[:] = Integer(0, my_counter_again - 1)
problem.function = lambda x: evaluation_function2(x, jobs, c_time_added_up, total_allowed_time_all_jobs,
                                                  extra_time)

# calculate the difference in models nsga2 and nsga3
if __name__ == "__main__":
    algorithms = [NSGAII, (NSGAIII, {"divisions_outer":12})]
    with ProcessPoolEvaluator(4) as evaluator:
        results = experiment(algorithms, [problem], nfe=2, evaluator=evaluator)

        # Calculate the hypervolume using assigned objective max and mins for comparing algorithms
        min_pri = 0
        min_cost = multiple_days_assigned_size * 30
        max_pri = multiple_days_assigned_size * 6.53
        max_cost = multiple_days_assigned_size * 130

        # calculate the hypervolume indicator between the algorithms
        hyp = Hypervolume(minimum=[min_pri, min_cost], maximum=[max_pri, max_cost])
        hyp_result = calculate(results, hyp, evaluator=evaluator)
        display(hyp_result, ndigits=3)

@jetuk
Copy link
Contributor

jetuk commented May 28, 2020

How long does evaluation_function2 take to run? Can you see if it is running and completing in a reasonable time? Does it work OK with NSGAII but not NSGAIII, or the other way around?

@sabrinadraude
Copy link
Author

Hiya,

the evaluation function takes a few mins to run for each of the algorithms separately. I'm not sure why it won't finish when I try use the parallelization . Should I try run it for less?

Cheers,

Sabrina

@jetuk
Copy link
Contributor

jetuk commented May 28, 2020

Can you try without the hypervolume lines at the bottom? It might be that each process is stalling trying to display the HV figure?

@sabrinadraude
Copy link
Author

I've tried that as well, and still after an hour no result has been created.

@jetuk
Copy link
Contributor

jetuk commented Jun 8, 2020

Sorry, I lost track of this issue. Did you manage to solve the problem? If not, do the algorithms solve individually without using the experiment function?

@sabrinadraude
Copy link
Author

Hiya,
yep they all solve individually. Just the experimenter doesn't conclude when I use my problem. I used the example code provided and that works, just my example doesn't.

@jetuk
Copy link
Contributor

jetuk commented Jun 8, 2020

Both examples are using the ProcessPoolEvaluator? Does your function do anything with threads or processes (e.g. uses the multiprocessing library)?

@sabrinadraude
Copy link
Author

Yep both use ProcessPoolEvaluator and my function does not include threads or processes.

@jetuk
Copy link
Contributor

jetuk commented Jun 8, 2020

I'm afraid its quite difficult to debug without your function unless you can isolate what block/function call is causing it to misbehave.

@github-actions
Copy link

github-actions bot commented Nov 4, 2022

This issue is stale and will be closed soon. If you feel this issue is still relevant, please comment to keep it active. Please also consider working on a fix and submitting a PR.

@github-actions github-actions bot added the Stale label Nov 4, 2022
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants