Skip to content

Commit

Permalink
Fix jac1d by adding laik_finish_world_resize
Browse files Browse the repository at this point in the history
We require malleable code to explicitly tell LAIK when we are
done transfering data between old and new processes to be able
to free the resources and enable process to terminate.
That is, after calling laik_finish_world_resize, the application
cannot access the old group any longer, as it does not longer
exist.
  • Loading branch information
weidendo-lrz committed Sep 30, 2024
1 parent ec3a69b commit c02f383
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions examples/jac1d.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ int main(int argc, char* argv[])
LAIK_DF_None, LAIK_RO_None);
laik_free_partitioning(pWriteOld);
laik_free_partitioning(pReadOld);

laik_finish_world_resize(inst);
}
laik_partitioning_set_name(pWrite, "pWrite");
laik_partitioning_set_name(pRead, "pRead");
Expand Down Expand Up @@ -287,6 +289,8 @@ int main(int argc, char* argv[])
pWrite = pWriteNew;
pRead = pReadNew;

laik_finish_world_resize(inst);

// exit if we got removed from world
if (laik_myid(world) < 0) {
laik_finalize(inst);
Expand Down
2 changes: 1 addition & 1 deletion include/laik/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Laik_Group* laik_world(Laik_Instance* i);
/**
* Notify LAIK that the application will not use the given group any longer.
* This allows to free group resources if no process and neither LAIK internally
* needs the group anymore (all LAIK objects depending on the group are removed)
* needs the group anymore (all LAIK objects depending on the group are removed).
*/
void laik_release_group(Laik_Group* g);

Expand Down

0 comments on commit c02f383

Please sign in to comment.