Timothy R. Chavez a écrit :
> Looks like you'll be shaving your head, Gilles :)  Attach a picture
> please!

Nope.
You soon see that there is a lot to cut off!

>> -    if (sched_setaffinity(0, sizeof(mask), &mask) < 0) {
>> -            printf("Thread %d: Can't set affinity: %s\n", tid, 
>> strerror(errno));
> 
> You'll want to use fprintf(stderr,...) here ??

This code is being removed (-)

>> +    if (cpuid == -1) {
>> +            printf("Thread %d: Can't set affinity.\n", thread_id);
> 
> Ditto.

I did not change what was made initially. I should.


> 
> debug(DBG_INFO, "RIP: Here lies the quick brown fox.  He was not quick 
> enough.")
> 
> Second, why are you even using it?  As it stands, tt doesn't seem at all
> consistent with how reporting is done by this test case as a whole.  If
> you want to introduce the debug() macro to the matrix_mult testcase, you
> might consider introducing it as a separate patch that takes the whole
> testcase into consideration?
> 
>> -    set_affinity(thread_id);
>>      pthread_barrier_wait(&mult_start);
>>      while (flags[thread_id] != THREAD_DONE) {
>>              pthread_mutex_lock(&t->mutex);
>> @@ -219,6 +232,7 @@ void main_thread(void)
>>      nsec_t start, end;
>>      long smin = 0, smax = 0, cmin = 0, cmax = 0, delta = 0;
>>      float savg, cavg;
>> +    int cpuid;
>>
>>      if (    stats_container_init(&sdat, ITERATIONS) ||
>>              stats_container_init(&shist, HIST_BUCKETS) ||
>> @@ -251,7 +265,15 @@ void main_thread(void)
>>      }
>>      memset(flags, 0, numcpus);
>>
>> -    set_affinity(numcpus-1);
>> +    cpuid = set_affinity();
>> +    if (cpuid == -1) {
>> +            printf("Main thread: Can't set affinity.\n");
> 
> Same as above.
> 
>> +            exit(1);
>> +    } else {
>> +            if (_dbg_lvl)
>> +                    printf("Main thread: Affinity set to cpu%d\n", cpuid);
>> +    }
>> +
> 
> Same as above.
> 
>>      /* run matrix mult operation sequentially */
>>      curdat = &sdat;



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to