Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aevol-eukaryotes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LUISELLI Juliette
aevol-eukaryotes
Commits
2ed48966
Commit
2ed48966
authored
1 year ago
by
David Parsons
Browse files
Options
Downloads
Patches
Plain Diff
remove commented code
parent
4cd22483
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libaevol/7/DnaFactory.cpp
+0
-22
0 additions, 22 deletions
src/libaevol/7/DnaFactory.cpp
with
0 additions
and
22 deletions
src/libaevol/7/DnaFactory.cpp
+
0
−
22
View file @
2ed48966
...
...
@@ -44,7 +44,6 @@ namespace aevol {
DnaFactory
::
DnaFactory
(
DnaFactory_Policy
policy
,
int
pool_size
,
int
init_size
,
int
pop_size
)
{
policy_
=
policy
;
pool_size_
=
pool_size
;
// printf("Pool init \n");
init
(
init_size
,
pop_size
);
}
...
...
@@ -75,8 +74,6 @@ void DnaFactory::init(int init_size, int pop_size) {
#pragma omp parallel reduction(+ : n)
{
n
+=
1
;
}
// printf("NB OpenMP : %d\n",n);
local_list_unused_dna_
.
resize
(
n
);
if
(
pop_size
!=
-
1
)
{
local_pool_size_
=
(
pop_size
/
n
)
*
4
;
...
...
@@ -114,7 +111,6 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
pop
=
new
Dna_7
(
request_size
);
return
pop
;
// return new Dna_7(request_size,this);
}
else
if
(
policy_
==
DnaFactory_Policy
::
FIRSTFIT
)
{
Dna_7
*
pop
=
nullptr
;
...
...
@@ -145,16 +141,12 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
Dna_7
*
pop
=
nullptr
;
if
(
local_list_unused_dna_
[
omp_get_thread_num
()].
empty
())
{
// #pragma omp atomic
// empty_global+=1;
if
(
list_unused_dna_
.
empty
())
{
pop
=
new
Dna_7
(
request_size
);
}
else
{
// Go to global (and lock)
#pragma omp critical(pop_dna)
{
// printf("Search global array of DNA\n");
std
::
list
<
Dna_7
*>::
iterator
found_it
;
for
(
auto
it
=
list_unused_dna_
.
begin
();
it
!=
list_unused_dna_
.
end
();
it
++
)
{
if
((
*
it
)
->
nb_block
()
>=
req_block
)
{
...
...
@@ -176,9 +168,6 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
// Go to local (and lock free)
std
::
list
<
Dna_7
*>::
iterator
found_it
;
// #pragma omp atomic
// local_empty++;
for
(
auto
it
=
local_list_unused_dna_
[
omp_get_thread_num
()].
begin
();
it
!=
local_list_unused_dna_
[
omp_get_thread_num
()].
end
();
it
++
)
{
...
...
@@ -205,13 +194,8 @@ Dna_7 *DnaFactory::get_dna(int request_size) {
void
DnaFactory
::
give_back
(
Dna_7
*
dna
)
{
dna
->
reset_stat
();
// delete dna;
if
(
policy_
==
DnaFactory_Policy
::
LOCAL_GLOBAL_FIT
)
{
if
(
local_list_unused_dna_
[
omp_get_thread_num
()].
size
()
==
local_pool_size_
)
{
// #pragma omp atomic
// free_space_local++;
Dna_7
*
pop
=
local_list_unused_dna_
[
omp_get_thread_num
()].
back
();
local_list_unused_dna_
[
omp_get_thread_num
()].
pop_back
();
...
...
@@ -219,16 +203,10 @@ void DnaFactory::give_back(Dna_7 *dna) {
{
list_unused_dna_
.
push_back
(
pop
);
}
}
// #pragma omp atomic
// free_local++;
local_list_unused_dna_
[
omp_get_thread_num
()].
push_front
(
dna
);
}
else
if
(
policy_
==
DnaFactory_Policy
::
ALLOCATE
)
{
delete
dna
;
}
else
{
// #pragma omp atomic
// free_global++;
#pragma omp critical(pop_dna)
{
list_unused_dna_
.
push_back
(
dna
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment