diff --git a/Control/AthenaMP/python/AthenaMPConfig.py b/Control/AthenaMP/python/AthenaMPConfig.py index 17ff30cfacb904dc1bdc95fc63a3317fcc32d31c..64ec414a01fe71507dd64cc5a1bd8d94bcd1b52f 100644 --- a/Control/AthenaMP/python/AthenaMPConfig.py +++ b/Control/AthenaMP/python/AthenaMPConfig.py @@ -74,6 +74,9 @@ def AthenaMPCfg(flags): # Compute event chunk size chunk_size = getChunkSize(flags) + if chunk_size < 1: + msg.warning('Nonpositive ChunkSize (%i) caught, setting it to 1', chunk_size) + chunk_size = 1 # Configure Strategy debug_worker = flags.Concurrency.DebugWorkers diff --git a/Control/AthenaMP/python/PyComps.py b/Control/AthenaMP/python/PyComps.py index 7df98401249f8557775ad668f0211b7d52e48a1f..2f2005db39947c7e01a9dd22426a894ce2389afa 100644 --- a/Control/AthenaMP/python/PyComps.py +++ b/Control/AthenaMP/python/PyComps.py @@ -58,6 +58,9 @@ class MpEvtLoopMgr(AthMpEvtLoopMgr): event_range_channel = jp.AthenaMPFlags.EventRangeChannel() chunk_size = getChunkSize() + if chunk_size < 1: + msg.warning('Nonpositive ChunkSize (%i) caught, setting it to 1', chunk_size) + chunk_size = 1 debug_worker = jp.ConcurrencyFlags.DebugWorkers() use_shared_reader = jp.AthenaMPFlags.UseSharedReader() diff --git a/Control/AthenaMPTools/src/SharedEvtQueueProvider.cxx b/Control/AthenaMPTools/src/SharedEvtQueueProvider.cxx index 4a99a081d6d01d8c23051ccb1d54c3db3ee282d6..3017139d8ce2f58e28592dff068126d30a42c496 100644 --- a/Control/AthenaMPTools/src/SharedEvtQueueProvider.cxx +++ b/Control/AthenaMPTools/src/SharedEvtQueueProvider.cxx @@ -66,6 +66,11 @@ int SharedEvtQueueProvider::makePool(int maxevt, int nprocs, const std::string& return -1; } + if(m_nChunkSize<=0) { + ATH_MSG_ERROR( "Non-positive chunk size requested: " << m_nChunkSize); + return -1; + } + m_nEvtRequested = maxevt; m_nprocs = (nprocs==-1?sysconf(_SC_NPROCESSORS_ONLN):nprocs); m_nprocesses = m_nprocs;