Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Iker Martín Álvarez
Proteo
Commits
7775ddae
Commit
7775ddae
authored
Oct 28, 2024
by
iker_martin
Browse files
Bugfix for Rep/Dist structs, where empty values where not considered.
parent
919758e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Codes/MaM/MAM_Types.c
View file @
7775ddae
...
@@ -91,9 +91,9 @@ void comm_data_info(malleability_data_t *data_struct_rep, malleability_data_t *d
...
@@ -91,9 +91,9 @@ void comm_data_info(malleability_data_t *data_struct_rep, malleability_data_t *d
def_malleability_entries
(
data_struct_dist
,
data_struct_rep
,
&
entries_type
);
def_malleability_entries
(
data_struct_dist
,
data_struct_rep
,
&
entries_type
);
MPI_Bcast
(
MPI_BOTTOM
,
1
,
entries_type
,
mall
->
root_collectives
,
mall
->
intercomm
);
MPI_Bcast
(
MPI_BOTTOM
,
1
,
entries_type
,
mall
->
root_collectives
,
mall
->
intercomm
);
if
(
is_children_group
&&
(
data_struct_rep
->
entries
!=
0
||
data_struct_dist
->
entries
!=
0
)
)
{
if
(
is_children_group
)
{
init_malleability_data_struct
(
data_struct_rep
,
data_struct_rep
->
entries
);
if
(
data_struct_rep
->
entries
!=
0
)
{
init_malleability_data_struct
(
data_struct_rep
,
data_struct_rep
->
entries
);
}
init_malleability_data_struct
(
data_struct_dist
,
data_struct_dist
->
entries
);
if
(
data_struct_dist
->
entries
!=
0
)
{
init_malleability_data_struct
(
data_struct_dist
,
data_struct_dist
->
entries
);
}
//FIXME Valgrind not freed
}
}
def_malleability_qty_type
(
data_struct_dist
,
data_struct_rep
,
&
struct_type
);
def_malleability_qty_type
(
data_struct_dist
,
data_struct_rep
,
&
struct_type
);
...
@@ -102,17 +102,21 @@ void comm_data_info(malleability_data_t *data_struct_rep, malleability_data_t *d
...
@@ -102,17 +102,21 @@ void comm_data_info(malleability_data_t *data_struct_rep, malleability_data_t *d
if
(
is_children_group
)
{
if
(
is_children_group
)
{
for
(
i
=
0
;
i
<
data_struct_rep
->
entries
;
i
++
)
{
for
(
i
=
0
;
i
<
data_struct_rep
->
entries
;
i
++
)
{
MPI_Type_size
(
data_struct_rep
->
types
[
i
],
&
type_size
);
MPI_Type_size
(
data_struct_rep
->
types
[
i
],
&
type_size
);
data_struct_rep
->
arrays
[
i
]
=
(
void
*
)
malloc
(
data_struct_rep
->
qty
[
i
]
*
type_size
);
//FIXME This memory is not freed -- How should be done?
data_struct_rep
->
arrays
[
i
]
=
(
void
*
)
malloc
(
data_struct_rep
->
qty
[
i
]
*
(
size_t
)
type_size
);
//FIXME This memory is not freed -- How should be done?
data_struct_rep
->
requests
[
i
]
=
(
MPI_Request
*
)
malloc
(
data_struct_rep
->
request_qty
[
i
]
*
sizeof
(
MPI_Request
));
if
(
data_struct_rep
->
request_qty
[
i
])
{
for
(
j
=
0
;
j
<
data_struct_rep
->
request_qty
[
i
];
j
++
)
{
data_struct_rep
->
requests
[
i
]
=
(
MPI_Request
*
)
malloc
(
data_struct_rep
->
request_qty
[
i
]
*
sizeof
(
MPI_Request
));
data_struct_rep
->
requests
[
i
][
j
]
=
MPI_REQUEST_NULL
;
for
(
j
=
0
;
j
<
data_struct_rep
->
request_qty
[
i
];
j
++
)
{
data_struct_rep
->
requests
[
i
][
j
]
=
MPI_REQUEST_NULL
;
}
}
}
}
}
for
(
i
=
0
;
i
<
data_struct_dist
->
entries
;
i
++
)
{
for
(
i
=
0
;
i
<
data_struct_dist
->
entries
;
i
++
)
{
data_struct_dist
->
arrays
[
i
]
=
(
void
*
)
NULL
;
// TODO Se podria inicializar aqui?
data_struct_dist
->
arrays
[
i
]
=
(
void
*
)
NULL
;
// TODO Se podria inicializar aqui?
data_struct_dist
->
requests
[
i
]
=
(
MPI_Request
*
)
malloc
(
data_struct_dist
->
request_qty
[
i
]
*
sizeof
(
MPI_Request
));
if
(
data_struct_dist
->
request_qty
[
i
])
{
for
(
j
=
0
;
j
<
data_struct_dist
->
request_qty
[
i
];
j
++
)
{
data_struct_dist
->
requests
[
i
]
=
(
MPI_Request
*
)
malloc
(
data_struct_dist
->
request_qty
[
i
]
*
sizeof
(
MPI_Request
));
data_struct_dist
->
requests
[
i
][
j
]
=
MPI_REQUEST_NULL
;
for
(
j
=
0
;
j
<
data_struct_dist
->
request_qty
[
i
];
j
++
)
{
data_struct_dist
->
requests
[
i
][
j
]
=
MPI_REQUEST_NULL
;
}
}
}
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment