Re: [Gems-users] TM - runtime error


Date: 15 Sep 2009 21:13:23 -0500
From: holey003@xxxxxxx
Subject: Re: [Gems-users] TM - runtime error
Sorry... I copied wrong function.
Correct one is here.

void Barrier_breaking(int* local_sense,int id, int num_thr) {
  volatile int ret;
   int temp;
if ((*local_sense) == 0) (*local_sense) = 1;
	else
		  (*local_sense) = 0;
	
   printf("%d :local_sense = %d\n",id,*local_sense);
   pthread_mutex_lock(&bar_lock);
   printf("%d :mutex locked ...\n",id);
   count++;
   ret = (count == num_thr);
   printf("%d :ret = %d\n",id,ret);
   pthread_mutex_unlock(&bar_lock);
   printf("%d :mutex unlocked ...\n",id);
   SIMICS_BEGIN_BARRIER;
if(ret) {
     SIMICS_BREAK_EXECUTION
	    count = 0;
   	sense = (*local_sense);
   } else {
	  while (sense != (*local_sense)){
       //usleep(1);     // For non-simulator runs
       //printf("%d :waiting for sense..\n",id);
} }
   SIMICS_END_BARRIER;
}


On Sep 15 2009, holey003@xxxxxxx wrote:

I am seeing some problem in Barrier_breaking() function in transaction.c file.
Here is the function for reference.

void Barrier_non_breaking(int* local_sense,int id, int num_thr) {
  volatile int ret;
if ((*local_sense) == 0) (*local_sense) = 1;
	else
		  (*local_sense) = 0;
	
   pthread_mutex_lock(&bar_lock);
   count++;
   ret = (count == num_thr);
   pthread_mutex_unlock(&bar_lock);
   SIMICS_BEGIN_BARRIER;
if(ret) {
	    count = 0;
   	sense = (*local_sense);
   } else {
	  while (sense != (*local_sense)){
       //usleep(1);     // For non-simulator runs
} }
   SIMICS_END_BARRIER;
}

Function keeps on looping in the last while loop with thread 0. It doesn't come out of it. And there is some different behavior when some printf is added inside the loop. Hence the 'prioqueue' benchmark stalls at this point. But on the actual machine, it works fine. Is there any known problem
with simics with this kind of code?

Also SIMICS_BEGIN_BARRIER and SIMICS_END_BARRIER should give call to function in command.C file which is not happening apparently. Is there any known problem with magic calls as well?

Thanks,
Anup

On Sep 10 2009, Haris Volos wrote:

If you are lust looking for a simple benchmark and not interested in
virtualization then I would recommend you quit 'conswtch'. A simple
benchmark you could look at is 'prioqueue'.

On Thu, Sep 10, 2009 at 4:47 PM,  <holey003@xxxxxxx> wrote:
I didn't know that 'conswtch' tests virtualization. Now I have set
XACT_ENABLE_VIRTUALIZATION_LOGTM_SE to true and recompiled ruby. No change
seen in debug messages though. I see both if and else printfs before and
after setting virtualization flag.

Attaching my benchmark running script for reference.
Is there another simple benchmark? I tried deque, but it hangs.

Thanks,
Anup

On Sep 10 2009, Haris Volos wrote:

'conswtch' tests the virtualization part of LogTM. Do you have
virtualization enabled? To enable it you can use
logtm_virtualization_se in config.py when creating scripts. The idea
behind 'conswtch' is to bind two threads per processor, and force
context switches inside a transaction to check whether transactional
isolation works correctly. Note that 'conswtch' could take some time
before starting any transactions because the OS needs to schedule all
threads waiting behind the barrier. Do you see both printfs, or just
the 'if printf'?

On Thu, Sep 10, 2009 at 3:36 PM,  <holey003@xxxxxxx> wrote:

I have added few comments but not modified functionality. Please find the
source code attached.
I can see print messages I have added in 'while' loops but not able to
see
any transactions happening. That's why I think magic calls are not
working.

And I have cross checked all the flags set. Attaching rubyconfig.defaults
for reference. (this is reply to another thread).

Thanks,
Anup

On Sep 10 2009, Polina Dudnik wrote:

Well, here's what I think: the number of threads for conswitch must not
be
very straightforward, so when you specify 3, it probably never gets to
the
part of the program where transactions are.

The script must be right and I was wrong.

So, now that I look at it, I know what the problem is. Look at this
message:

End exposed action for thread 0 of proc 3 PC [0x11728, line 0x11700]
36500 3 [3,0] endEscapeAction WARNING escape depth < 1. Depth = 0
val = 6

What it is telling you is that you are ending an escape action without
having started it.

Did you modify the source code for conswitch in any way?

Thank you.

Polina

On Thu, Sep 10, 2009 at 2:55 PM, <holey003@xxxxxxx> wrote:

Ok.. But I got this value from conswtch.simics script where no. of
threads
are 2*processors-2. If I make it 3, I can't see debug messages for
transactions, which means callback to simics from benchmark having
those
macros, e.g. BEGIN_WORKLOAD_TRANSACTION, are not working. Why would
they
work when number of threads are more?

-Anup

On Sep 10 2009, Polina Dudnik wrote:

> You can't run 6 threads on 4 processors because TM threads need > to >
> bind to
>processors, plus there needs to be an extra processor for OS. So, 6
threads
>would run on 7+ processors.
>
>On Tue, Sep 8, 2009 at 3:08 PM, <holey003@xxxxxxx> wrote:
>
>> Hi,
>>
>> I am running 'conswtch' benchmark with 6 threads and 100 >>
>> transactions.
>> I am
>> simulating a 4-core machine. I got following error while running >> the
>> code.
>>
>> Turning I-STC off and flushing old data
>> Turning D-STC off and flushing old data
>> D-STC is currently *OFF*
>> I-STC is currently *OFF*
>> Deprecation warning: variable assignment without variable prefix >> $.
>> cpu0: no-instruction-fetch
>> cpu1: no-instruction-fetch
>> cpu2: no-instruction-fetch
>> cpu3: no-instruction-fetch
>> Caught time breakpoint
>> successful installation of the ruby timing model.
>> Ruby Timing Mode
>> Creating event queue...
>> Creating event queue done
>> Creating system...
>>  Processors: 4
>> Creating system done
>> Ruby initialization complete
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700]
>> 36500 3 [3,0] endEscapeAction WARNING escape depth < 1. Depth = 0
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  38250 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  183000 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  184750 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  329500 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  331250 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  476000 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  477750 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  622500 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  624250 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  769000 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  770750 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  915500 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  917250 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  1062000 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 6
>> Begin exposed action for thread 0 of proc 3 PC [0x116f0, line >>
>> 0x116c0]
>>  1063750 3 [3,0] Begin ESCAPE ACTION - ESCAPE DEPTH: 1 PC >>
>> [0x116f0, >>
>> line
>> 0x116c0]
>> val = 7
>> End exposed action for thread 0 of proc 3 PC [0x11728, line >> 0x11700] >>  1208500 3 [3,0] END ESCAPE ACTION - ESCAPE DEPTH: 0 PC >> [0x11728, >>
>> line
>> 0x11700]
>> val = 2048
>> Commit CLOSED transaction for thread 0 of proc 3 XID 0
>> commitTransaction ERROR NOT IN XACT proc =3 logical_proc = 3 xid >> = 0
>> isOpen
>> = 0 tid = -1 pc = [0x11788, line 0x11780] level = 0 time = >> 1210500
>> simics-common: log_tm/TransactionInterfaceManager.C:243: void
>> TransactionInterfaceManager::commitTransaction(int, int, bool):
Assertion
>> `m_transactionLevel[thread] >= 1' failed.
>> Abort (SIGABRT) in main thread
>> The simulation state has been corrupted. Simulation cannot >> continue.
>> Please restart Simics.
>> Starting command line. (May have skipped commands in script >> files.) >> [cpu3] v:0x0000000000011788 p:0x00026085788  magic (sethi >> 0x800, >>
>> %g0)
>> Setting new inspection cpu: cpu3
>>
>>
>> What does m_escapeDepth store?
>> Also it is always showing 'thread 0 of proc 3'. How can I assure >> >>
>> if >>
>> each
>> thread is bound to processor? I am using commands
>> con0.input "psrset -c 1 \n"
>> con0.input "psrset -c 2 \n"
>> con0.input "psrset -c 3 \n"
>> before running the benchmark.
>>
>>
>> Thanks,
>> Anup
>> _______________________________________________
>> Gems-users mailing list
>> Gems-users@xxxxxxxxxxx
>> https://lists.cs.wisc.edu/mailman/listinfo/gems-users
>> Use Google to search the GEMS Users mailing list by adding "site:
>> https://lists.cs.wisc.edu/archive/gems-users/"; to your search.
>>
>>
>
_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:
https://lists.cs.wisc.edu/archive/gems-users/"; to your search.



_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.



_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding
"site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.



_______________________________________________
Gems-users mailing list
Gems-users@xxxxxxxxxxx
https://lists.cs.wisc.edu/mailman/listinfo/gems-users
Use Google to search the GEMS Users mailing list by adding "site:https://lists.cs.wisc.edu/archive/gems-users/"; to your search.


[← Prev in Thread] Current Thread [Next in Thread→]