Throwing exception when packet size is negative.
This commit is contained in:
parent
f4d8b43f7d
commit
2cc112c33b
1 changed files with 4 additions and 1 deletions
|
|
@ -6,7 +6,6 @@
|
|||
# include <eoFunctor.h>
|
||||
# include <vector>
|
||||
|
||||
|
||||
template< typename EOT >
|
||||
class ParallelApply : public MpiJob
|
||||
{
|
||||
|
|
@ -32,6 +31,10 @@ class ParallelApply : public MpiJob
|
|||
data( _pop ),
|
||||
packetSize( _packetSize )
|
||||
{
|
||||
if ( _packetSize <= 0 )
|
||||
{
|
||||
throw std::runtime_error("Packet size should not be negative.");
|
||||
}
|
||||
tempArray = new EOT[ packetSize ];
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue