~ubuntu-branches/ubuntu/vivid/slurm-llnl/vivid

« back to all changes in this revision

Viewing changes to src/plugins/task/affinity/dist_tasks.c

  • Committer: Bazaar Package Importer
  • Author(s): Gennaro Oliva
  • Date: 2011-05-06 10:48:55 UTC
  • mfrom: (3.3.17 sid)
  • Revision ID: james.westby@ubuntu.com-20110506104855-689k27p8y71vit5x
Tags: 2.2.5-1
New upstream release 

Show diffs side-by-side

added added

removed removed

Lines of Context:
484
484
        for (s=0, s_miss=false; s<sockets; s++) {
485
485
                for (c=0, c_hit=c_miss=false; c<cores; c++) {
486
486
                        for (t=0, t_hit=t_miss=false; t<threads; t++) {
 
487
                                /* If we are pretending we have a
 
488
                                   larger system than we really have
 
489
                                   this is needed to make sure we
 
490
                                   don't bust the bank.
 
491
                                */
 
492
                                if (i >= bit_size(alloc_bitmap))
 
493
                                        i = 0;
487
494
                                if (bit_test(alloc_bitmap, i)) {
488
495
                                        bit_set(alloc_mask, i);
489
496
                                        (*whole_thread_cnt)++;
542
549
{
543
550
        bitstr_t *req_map, *hw_map;
544
551
        slurm_cred_arg_t arg;
545
 
        uint16_t p, t, num_cpus, sockets, cores;
 
552
        uint16_t p, t, new_p, num_cpus, sockets, cores;
546
553
        int job_node_id;
547
554
        int start;
548
555
        char *str;
567
574
                return NULL;
568
575
        }
569
576
        debug3("task/affinity: slurmctld s %u c %u; hw s %u c %u t %u",
570
 
                sockets, cores, *hw_sockets, *hw_cores, *hw_threads);
 
577
               sockets, cores, *hw_sockets, *hw_cores, *hw_threads);
571
578
 
572
 
        num_cpus   = MIN((sockets * cores),
573
 
                          ((*hw_sockets)*(*hw_cores)));
 
579
        num_cpus = MIN((sockets * cores), ((*hw_sockets)*(*hw_cores)));
574
580
        req_map = (bitstr_t *) bit_alloc(num_cpus);
575
581
        hw_map  = (bitstr_t *) bit_alloc(conf->block_map_size);
 
582
 
576
583
        if (!req_map || !hw_map) {
577
584
                error("task/affinity: malloc error");
578
585
                FREE_NULL_BITMAP(req_map);
597
604
        for (p = 0; p < num_cpus; p++) {
598
605
                if (bit_test(req_map, p) == 0)
599
606
                        continue;
 
607
                /* If we are pretending we have a larger system than
 
608
                   we really have this is needed to make sure we
 
609
                   don't bust the bank.
 
610
                */
 
611
                new_p = p % conf->block_map_size;
600
612
                /* core_bitmap does not include threads, so we
601
613
                 * add them here but limit them to what the job
602
614
                 * requested */
603
615
                for (t = 0; t < (*hw_threads); t++) {
604
 
                        uint16_t bit = p * (*hw_threads) + t;
 
616
                        uint16_t bit = new_p * (*hw_threads) + t;
605
617
                        bit_set(hw_map, bit);
606
618
                }
607
619
        }