Commit f126a16b authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

fix the previous fix. problem was not the size of the links buffer per se, but...

fix the previous fix. problem was not the size of the links buffer per se, but that we were allowing bad geometries.


Former-commit-id: e677a019de5142acb211596a0ea1489c912bce31
parent 78801287
......@@ -974,7 +974,9 @@ void engine_maketasks ( struct engine *e ) {
/* Split the tasks. */
scheduler_splittasks( sched );
/* Allocate the list of cell-task links. */
/* Allocate the list of cell-task links. The maximum number of links
is the number of cells (s->tot_cells) times the number of neighbours (27)
times the number of interaction types (2, density and force). */
if ( e->links != NULL )
free( e->links );
if ( ( e->links = malloc( sizeof(struct link) * s->tot_cells * 27 * 2 ) ) == NULL )
......@@ -1077,7 +1079,7 @@ void engine_maketasks ( struct engine *e ) {
/* Skip? */
if ( t->skip )
continue;
/* Self-interaction? */
if ( t->type == task_type_self && t->subtype == task_subtype_density ) {
scheduler_addunlock( sched , t , t->ci->super->ghost );
......
......@@ -192,6 +192,10 @@ void space_regrid ( struct space *s , double cell_max ) {
for ( k = 0 ; k < 3 ; k++ )
cdim[k] = floor( s->dim[k] / fmax( h_max*kernel_gamma*space_stretch , cell_max ) );
/* Check if we have enough cells for periodicity. */
if ( s->periodic && (cdim[0] < 3 || cdim[1] < 3 || cdim[2] < 3) )
error( "Must have at least 3 cells in each spatial dimension when periodicity is switched on." );
/* In MPI-Land, we're not allowed to change the top-level cell size. */
#ifdef WITH_MPI
if ( cdim[0] < s->cdim[0] || cdim[1] < s->cdim[1] || cdim[2] < s->cdim[2] )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment