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

Multiple cases can be generated only when parallel_processing is not used #115

Open
mohammadamint opened this issue Feb 29, 2024 · 2 comments

Comments

@mohammadamint
Copy link
Collaborator

Issue:
generate_daily_load_profiles function can only generated cases without parallel processing, which highly increases running time. Would it be possible to extend the parallel processing to the generation of cases also?

@Bachibouzouk
Copy link
Collaborator

For this one need a way to reassign the result of a parallel process to the correct case, but this is possible. Could you describe your use case with dummy code?

@Bachibouzouk
Copy link
Collaborator

The function which parallelize the work by executing RAMP at the appliance level is single_appliance_daily_load_profile

Basically the parallelization consists of listing the arguments for all the appliance profiles which a UseCase entails and feed this to a multiprocessing pool of workers. The workers go through the list in an unordered fashion and we collect the resulting profiles and reorder them thanks to the day index. In that case all profiles are attached to a single UseCase instance, but if you have many UseCase instances you can also pass this information to the parallelized function to allow you redispatching the resulting profile to the right usecases. (It is like going from having one kitchen and many waiter to serve one restaurant to having one kitchen and many waiters to serve several restaurants, each dish needs to bear the information about the restaurant it needs to be sent to)

The single_appliance_daily_load_profile function could be modified in this fashion:

def single_appliance_daily_load_profile(args):
    uc, app, args = args
    app.generate_load_profile(*args, power=app.power[args[0]])

    return uc, args[0], app.daily_use

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants