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

Support the new command line option "--pow-threads" of IRI in dcurl #86

Closed
marktwtn opened this issue Nov 21, 2018 · 5 comments
Closed
Assignees

Comments

@marktwtn
Copy link
Collaborator

The IOTA IRI commit has added the new command line option --pow-threads for assigning Number of threads to use for proof-of-work calculation.

The dcurl should support the --pow-threads in CPU implementation.

The priority of the CPU thread number would be:

  1. Assigned by IRI --pow-threads
  2. Environment variable DCURL_NUM_CPU
  3. Core number detected by dcurl
@marktwtn marktwtn changed the title Support the new command line option --pow-threads of IRI in dcurl Support the new command line option "--pow-threads" of IRI in dcurl Nov 21, 2018
@marktwtn marktwtn self-assigned this Nov 21, 2018
@jserv
Copy link
Member

jserv commented Nov 21, 2018

I wonder the usability of env $DCURL_NUM_CPU. @chenwei-tw, can you comment this?
Once thread pool is fully integrated into dcurl, I don't think it is worthy to maintain such special mechanism.

@furuame
Copy link
Member

furuame commented Nov 22, 2018

The pow-threads can be used to initialize threadpool's number of threads instead $DCURM_NUM_CPU, but we need take care ccurl-compat scenario.

In the ccurl-compat interface, no system-related arguments can be passed to dcurl. If DCURL_NUM_CPU removed, ccurl-compat must use the default setting (e.g. CPU core number)

@marktwtn
Copy link
Collaborator Author

I guess the CPU thread number priority would be the same as I mentioned before.

Since DCURL_NUM_CPU and core number are detected during the dcurl_init function
and the --pow-thread value is passed when calling the dcurl_entry function,
there would be extra code inside the dcurl_entry for overwriting the initialized value.

@marktwtn
Copy link
Collaborator Author

I prefer remove the DCURL_NUM_CPU and let ccurl-compat use the default setting.
Since if --pow-threads is greater than DCURL_NUM_CPU, the memory allocation in the PoWXXX_Context_Initialize function would not be enough.

@chenwei-tw is it acceptable in ccurl-compat? I am not really familiar with it.

@furuame
Copy link
Member

furuame commented Nov 27, 2018

I guess the CPU thread number priority would be the same as I mentioned before.
Since DCURL_NUM_CPU and core number are detected during the dcurl_init function
and the --pow-thread value is passed when calling the dcurl_entry function,
there would be extra code inside the dcurl_entry for overwriting the initialized value.

Ok I got it. That's alright if the dcurl_entry would be passed with --pow-thread

I prefer remove the DCURL_NUM_CPU and let ccurl-compat use the default setting.
Since if --pow-threads is greater than DCURL_NUM_CPU, the memory allocation in the PoWXXX_Context_Initialize function would not be enough.

It's okay. We can use the saturated value (DCURL_NUM_CPU) if --pow-threads is greater than this.

marktwtn added a commit to marktwtn/dcurl that referenced this issue Nov 27, 2018
If the "--pow-threads" value is greater than 0 and less than the maximum available resources,
the number of threads would be equal to the "--pow-threads" value.
Otherwise, the number of threads would be set with the original mechanism.

The GPU and FPGA implementation are not affected by the "--pow-threads".

Close DLTcollab#86.
marktwtn added a commit to marktwtn/dcurl that referenced this issue Nov 29, 2018
If the "--pow-threads" value is greater than 0 and less than the maximum available resources,
the number of threads would be equal to the "--pow-threads" value.
Otherwise, the number of threads would be set with the original mechanism.

The GPU and FPGA implementation are not affected by the "--pow-threads".

Close DLTcollab#86.
marktwtn added a commit to marktwtn/dcurl that referenced this issue Nov 30, 2018
If the "--pow-threads" value is greater than 0 and less than the maximum available resources,
the number of threads would be equal to the "--pow-threads" value.
Otherwise, the number of threads would be set with the original mechanism.

The GPU and FPGA implementation are not affected by the "--pow-threads".

Close DLTcollab#86.
marktwtn added a commit to marktwtn/dcurl that referenced this issue Nov 30, 2018
If the "--pow-threads" value is greater than 0 and less than the maximum available resources,
the number of threads would be equal to the "--pow-threads" value.
Otherwise, the number of threads would be set with the original mechanism.

The GPU and FPGA implementation are not affected by the "--pow-threads".

Close DLTcollab#86.
@jserv jserv closed this as completed in #87 Nov 30, 2018
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

3 participants