JPPF Forums

JPPF Help => Troubleshooting => Topic started by: plenglin on August 10, 2019, 02:52:05 AM

Title: Same task being executed multiple times
Post by: plenglin on August 10, 2019, 02:52:05 AM
I'm making a simple grid processing app where I schedule a job that is composed of multiple tasks. I have confirmed by examining my logs that every task is being evaluated multiple times: once for every thread of every node. However, I expect that each task only ever gets evaluated once, instead of whatever this is. What could be the reason for this, and how can I change this? For reference, I am using JPPF 6.1.1.
Title: Re: Same task being executed multiple times
Post by: plenglin on August 10, 2019, 04:31:19 AM
I tried downgrading to 6.0.3, and the issue remains. Is there something I'm simply not understanding conceptually?
Title: Re: Same task being executed multiple times
Post by: plenglin on August 10, 2019, 10:42:35 PM
I appear to have solved my problem by converting the system to use JPPFExecutorService and submitting Callables instead of submitting custom classes that extend AbstractTask.
Title: Re: Same task being executed multiple times
Post by: lolo on August 11, 2019, 07:35:09 AM
Hello,

Thank you for sharing the workaround you have found.
However, there must something more going on, since behind the scene Callables are actually wrapped into a subclass of AbstractTask.
Would it be possible for you to post a code sample that reproduces the issue? For example  the code of a task, how you create and submit the job, and some information about your grid topology should allow us to reproduce as well and investigate on our side.

Thank you very much for your time,
-Laurent
Title: Re: Same task being executed multiple times
Post by: plenglin on August 11, 2019, 09:55:53 AM
Unfortunately, I won't be able to provide you the code, since my codebase is a mess. I failed to reproduce the issue in a clean project, as well. I'm fairly certain I confirmed the bug was on JPPF's side via remote debugger, as well, but I could have missed something. I think I'll just blame my own incompetence  ;D

(For reference though, each job was to evaluate the fitnesses of 4000 chromosomes of a genetic algorithm. Each task processed 25 chromosomes at a time. The issue may have stemmed from the loop I wrote that grouped the chromosomes together. I only saw chromosomes logged once on the client side, but I saw them being logged multiple times on the node side. The driver seems to have gotten the right number of tasks, but the node seemed to have been repeatedly dispatching each task to itself. Still, I think it's my own code at fault here.)