title: Spark: understanding partitioning - cores
body: <p>I'd like to understand partitioning in Spark.
  I am running spark in local mode on windows 10. 
  My laptop has 2 physical cores and 4 logical cores. </p>
  
  <p>1/ Terminology : to me, a core in spark = a thread. So a core in Spark is different than a physical core, right? A Spark core is associated to a task, right? 
  If so, since you need a thread for a partition, if my sparksql dataframe has 4 partitions, it needs 4 threads right?</p>
  
  <p>2/ If I have 4 logical cores, does it mean that I can only run 4 concurrent threads at the same time on my laptop? So 4 in Spark?</p>
  
  <p>3/ Setting the number of partitions : how to choose the number of partitions of my dataframe, so that further transformations and actions run as fast as possible? 
  -Should it have 4 partitions since my laptop has 4 logical cores? 
  -Is the number of partitions related to physical cores or logical cores?
  -In spark documentations, it's written that you need 2-3 tasks per CPU. Since I have two physical coresn should the nb of partitions be equal to 4or6?</p>
  
  <p>(I know that number of partitions will not have much effect on local mode, but this is just to understand)</p>