-
Notifications
You must be signed in to change notification settings - Fork 13
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
Adding multitask feature #2353
Adding multitask feature #2353
Conversation
avancinirodrigo
commented
Aug 11, 2020
•
edited
Loading
edited
- Migrate the kernel to multitask #2338
src/hpa/hpa.cpp
Outdated
HPA::~HPA(){ | ||
if(mainStack) { | ||
if( mainStack->getState() ) removeWorkers(mainStack->getState()); | ||
removeLockSections(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check indentation
//informacao sobre a quantidade de cores da maquina | ||
SYSTEM_INFO sysinfo; | ||
GetSystemInfo(&sysinfo); | ||
setNumCpu(sysinfo.dwNumberOfProcessors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it always use all processors available?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be interesting if the user could choose the amount of processors to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a method for that np()
. See it in hpa cmd tests.
src/hpa/parserHPA.cpp
Outdated
try{ | ||
fileModel.open(modelPath.c_str(), ifstream::in); | ||
}catch(exception e){ | ||
cout << "problema ao abrir o modelo, verifique o path" << endl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please translate to english at least the messages.
end | ||
|
||
function fillCsB() | ||
forEachCell(csB, function(cell) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about having a forEachParallelCell()
. Would that be possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think so, but it doesn't work with a cellular space as an argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably something that needs to be done in C++ level.
@avancinirodrigo, thanks. May I merge? |
Yes. |
Maybe you should try to call the function received as an argument by
ForEcahCell in parallel, not the opposite:
I do not remember the exact API of HPA, so consider the code below as a
pseudocode.
parallel_forEachCell(csA, f)
for cell in pairs(csA) do
hpa:parallel( "f", cel )
end
hpa:synchronize("f")
end
Something more...
I am not sure that HPA cannot receive Celluspces or tables as parameters of
parallel functions. It can just be a bug in the new version. However,
passing big tables to parallel functions could be a mistake due to the
necessary copy of parameters to the thread´s lua stack. HPA was designed to
see CellularSpaces as shared variables where several
functions/agents/automatons make simultaneous changes (SIMD or MIMD
parallelism models). We avoid copying large cellular spaces for preventing
memory/stack overflow. We believe that the majority of models that requires
high performance computing are very prone to deal with large geographical
regions or use high resolution spatial data.
…--
Prof. Dr. Tiago Garcia de Senna Carneiro
TerraLAB - Earth System Modelling and Simulation Laboratory
Computer Science Department, UFOP - Federal University of Ouro Preto
Campus Universitário Morro do Cruzeiro, Ouro Preto - MG, Brazil, 35400-000
+55 31 3559 1692 +55 31 3559 1253
www.decom.ufop.br/terralab www.decom.ufop.br
Em seg., 21 de set. de 2020 às 13:40, Pedro R. Andrade <
[email protected]> escreveu:
***@***.**** commented on this pull request.
------------------------------
In test/scripts/hpa-matrix-mult.lua
<#2353 (comment)>:
> + local csA = CellularSpace {
+ xdim = dim
+ }
+
+ local csB = CellularSpace {
+ xdim = dim
+ }
+
+ function fillCsA()
+ forEachCell(csA, function(cell)
+ cell.value = dim
+ end)
+ end
+
+ function fillCsB()
+ forEachCell(csB, function(cell)
Why not?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2353 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAR547BEARQN55YYXK2TBU3SG56YJANCNFSM4P3C6GRA>
.
|