09-08-2021 09:59 AM
Hello,
As said in the object, I wonder if there is any relation between threadId and the UUT position (socket) ?
Regards,
FranckH
Solved! Go to Solution.
09-09-2021 02:07 PM
I guess I don't understand why you need to correlate them. Sockets can have more than one thread. Besides, at any point during the execution you can grab either (Thread.Id or RunState.TestSockets.MyIndex). So correlating them doesn't make sense.
Maybe if you explain the need a little more there might be a better way to accomplish what you want.
09-10-2021 01:34 AM
I'm getting location from output message:
case UIMessageCodes.UIMsg_OutputMessages:
OutputMessages outMsg = e.uiMsg.ActiveXData as OutputMessages;
OutputMessages appOutputMessages = _engine.NewOutputMessages();
outMsg.CopyMessagesToCollection(appOutputMessages);
outMsg.Clear();
foreach (OutputMessage outputMessage in appOutputMessages)
{
foreach (Location location in outputMessage.ExecutionLocations)
From this location, I could get a thread id:
location.ThreadId
So I was wondering if I could get Num Socket from this information ?
Meanwhile, I've successfully implemented a complex but functionnal solution:
case UIMessageCodes.UIMsg_OutputMessages:
(...)
foreach (Execution item in _appMgr.Executions)
{
if (item.NumThreads > 0)
{
PropertyObject seqContextPO = item.GetThread(0)?.GetSequenceContext(0, out int frameId).AsPropertyObject();
int testSocket = Convert.ToInt32(seqContextPO.GetValNumber("RunState.TestSockets.Count", 0));
List<Execution> socketState = new List<Execution>();
for (int Iindex = 0; Iindex < testSocket; Iindex++)
{
socketState.Add(seqContextPO.GetValVariant("RunState.Root.Locals.ModelPluginConfiguration.RuntimeVariables.PerSocket[" + Iindex.ToString() + "].Execution", 0) as Execution);
if (socketState[Iindex].Id == location.ExecutionId)
{
iSoc = Iindex;
}
}
}
}
With iSoc the socket index. Maybe there is a more straightforward solution, but I can't find any.
Regards,
FranckH
09-10-2021 09:54 AM
PropertyObject seqContextPO = item.GetThread(0)?.GetSequenceContext(0, out int frameId).AsPropertyObject();
int iSoc = Convert.ToInt32(seqContextPO.GetValNumber("RunState.TestSockets.MyIndex", 0));
09-13-2021 01:46 AM
Thank you !