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

option for single mode for runs greater than one #253

Closed
DrCatman opened this issue Feb 3, 2021 · 2 comments
Closed

option for single mode for runs greater than one #253

DrCatman opened this issue Feb 3, 2021 · 2 comments

Comments

@DrCatman
Copy link
Member

DrCatman commented Feb 3, 2021

when runs are greater than one, the execution mode defaults to multi-threaded execution when local mode is selected.

when single mode is specified, simulation execution should be single- threaded

The execution mode needs to be clear

note:
jupyter has control of the threads and uses tornado for multi-threading
@rogervs

@rogervs
Copy link

rogervs commented Feb 9, 2021

With following:

exec_context = ExecutionContext()

system_params = {
    'a': [1.0],
    'b': [1.0],
    'c': [0],
    'dt': [0.1]
}

the params variable inside a policy function looks like this:
{'a': 1.0, 'b': 1.0, 'c': 0, 'dt': 0.1}
This is what is expected.

However, by setting the following:
exec_context = ExecutionContext(context=ExecutionMode.single_mode)

the params variable inside a policy function becomes a list with a dictionary inside it:
[{'a': 1.0, 'b': 1.0, 'c': 0, 'dt': 0.1}]
Which breaks the simulation.

If however, we add a parameter sweep (whilst maintaining single_mode):

system_params = {
    'a': [1.0, 2.0],
    'b': [1.0],
    'c': [0],
    'dt': [0.1]
}

the params variable inside a policy function drops the enclosing list and is once again just a dictionary:
{'a': 1.0, 'b': 1.0, 'c': 0, 'dt': 0.1}
for first run.

{'a': 2.0, 'b': 1.0, 'c': 0, 'dt': 0.1}
for second run.

@JEJodesty I think this relates to what we discussed in the last Core-Tech meeting.
Probably related to:
#254
#251
#248
#242

@rogervs
Copy link

rogervs commented Feb 21, 2021

Related to cadCAD-org/demos@1813045 , fix implemented in cadCAD-org/demos@2f0dbd5 merely by removing requirement for multi_proc

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

No branches or pull requests

4 participants