As follow-up to the comments: Unless I'm missing something, instead of
int tdd = 0;
foreach (TasksData td in tasks)
{
int val = tdd;
Task t1 = Task.Factory.StartNew(() => startParallelMethod(iteration, tasks[val], SOMState.dataset.GroupedData[val], tasks[val].Map, SOMState.dataset.GroupedDataDictionary[val]));
netTasks.Add(t1);
tdd++;
}
you could write (please note: pseudo code!)
Parallel.For(0, tasks.Length, val => {
startParallelMethod(iteration, tasks[val], SOMState.dataset.GroupedData[val], tasks[val].Map, SOMState.dataset.GroupedDataDictionary[val])
});
As your original code uses await you could wrap the Parallel.For code in a Task.Run() and its behavior should be the same outside the method (although this is, same as your initial sample, far away from best practice on using async-await).
Nevertheless - with few changes you should be able to let the Runtime decide how many tasks to use.