From 2bdeee53593aabd2aae95c03bd0326a267068405 Mon Sep 17 00:00:00 2001 From: rhaas Date: Fri, 24 Aug 2012 15:35:29 +0000 Subject: do not attempt reductions in local mode unless auto_res[n] is set currently SphericalSurface_SetupRes will attempt a reduction in local mode even if all auto_res values are false, ie if there are no spheres whose resolution is to be set automatically. This causes MPI hangs if different processors own different numbers of components, as produced by the recursive load balancer and carpet::same_number_of_components_on_each_process = false (true by default but might change). This patch ameliorates the situation by only attempting a reduction if auto_res[n] is set, thus at least allowing SphericalSurface to be used when all ntheta, nphi are giving explicitly. It also adds a comment warning about auto_res. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/SphericalSurface/trunk@51 40f6ab95-0e4f-0410-8daa-ee8d7420be1d --- param.ccl | 2 ++ src/setup.cc | 3 +++ 2 files changed, 5 insertions(+) diff --git a/param.ccl b/param.ccl index 4217adf..231cb0b 100644 --- a/param.ccl +++ b/param.ccl @@ -19,6 +19,8 @@ CCTK_STRING name[42] "User friendly name of spherical surface" STEERABLE=always } "" +# Warning: this will MPI hang when the number of components per refinement +# level differs between processors BOOLEAN auto_res[42] "Automatically determine resolution according to radius and Cartesian resolution" { } no diff --git a/src/setup.cc b/src/setup.cc index db6a92f..76bf945 100644 --- a/src/setup.cc +++ b/src/setup.cc @@ -336,6 +336,9 @@ extern "C" void SphericalSurface_SetupRes (CCTK_ARGUMENTS) // can decide which reflevel to use // set resolution according to Radius and Cartesian resolution + + if (!auto_res[n]) + continue; CCTK_REAL my_radius; -- cgit v1.2.3