From a2111b48cc37d66e8b90652927898d51435af4b5 Mon Sep 17 00:00:00 2001 From: ganu453 Date: Sat, 22 Jan 2022 15:12:24 +0530 Subject: [PATCH 1/2] Improving message for - ArgumentOutOfRangeException Trying to solve issue - https://github.com/MicrosoftResearch/Naiad/issues/19 --- Naiad/Runtime/Controlling/Controller.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Naiad/Runtime/Controlling/Controller.cs b/Naiad/Runtime/Controlling/Controller.cs index 72b4c94..6ccfb47 100644 --- a/Naiad/Runtime/Controlling/Controller.cs +++ b/Naiad/Runtime/Controlling/Controller.cs @@ -768,6 +768,9 @@ public BaseController(Configuration config) if (this.configuration.Endpoints != null) { + if(this.configuration.Endpoints.Length >= this.configuration.ProcessID){ + throw new ApplicationException("Intended process number (-p) should less then the number supplied to -n"); + } endpoint = this.configuration.Endpoints[this.configuration.ProcessID]; } From 67f8f805eef72ae664238ed68714f8eafac6cc4a Mon Sep 17 00:00:00 2001 From: ganu453 Date: Sat, 22 Jan 2022 15:14:25 +0530 Subject: [PATCH 2/2] fixing code --- Naiad/Runtime/Controlling/Controller.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Naiad/Runtime/Controlling/Controller.cs b/Naiad/Runtime/Controlling/Controller.cs index 6ccfb47..17fc80e 100644 --- a/Naiad/Runtime/Controlling/Controller.cs +++ b/Naiad/Runtime/Controlling/Controller.cs @@ -768,7 +768,8 @@ public BaseController(Configuration config) if (this.configuration.Endpoints != null) { - if(this.configuration.Endpoints.Length >= this.configuration.ProcessID){ + if (this.configuration.ProcessID >= this.configuration.Endpoints.Length) + { throw new ApplicationException("Intended process number (-p) should less then the number supplied to -n"); } endpoint = this.configuration.Endpoints[this.configuration.ProcessID];