Skip to content
Snippets Groups Projects
Commit 4a4aa459 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Lock and unlock both cells when trying to run the gravity M-M task.

parent eeaa0e88
No related branches found
No related tags found
1 merge request!576Gravity splittask (non-MPI)
...@@ -317,11 +317,15 @@ void task_unlock(struct task *t) { ...@@ -317,11 +317,15 @@ void task_unlock(struct task *t) {
cell_munlocktree(ci); cell_munlocktree(ci);
break; break;
case task_type_grav_mm:
case task_type_grav_long_range: case task_type_grav_long_range:
cell_munlocktree(ci); cell_munlocktree(ci);
break; break;
case task_type_grav_mm:
cell_munlocktree(ci);
cell_munlocktree(cj);
break;
default: default:
break; break;
} }
...@@ -444,12 +448,20 @@ int task_lock(struct task *t) { ...@@ -444,12 +448,20 @@ int task_lock(struct task *t) {
break; break;
case task_type_grav_long_range: case task_type_grav_long_range:
case task_type_grav_mm:
/* Lock the m-poles */ /* Lock the m-poles */
if (ci->mhold) return 0; if (ci->mhold) return 0;
if (cell_mlocktree(ci) != 0) return 0; if (cell_mlocktree(ci) != 0) return 0;
break; break;
case task_type_grav_mm:
/* Lock both m-poles */
if (ci->mhold || cj->mhold) return 0;
if (cell_mlocktree(ci) != 0) return 0;
if (cell_mlocktree(cj) != 0) {
cell_munlocktree(ci);
return 0;
}
default: default:
break; break;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment