Page 1 of 1

Serialize all Processes

Posted: Mon Jan 27, 2014 5:47 pm
by maps
Dear All,

TM1 10.1 fixpack 2
ParallelInteraction=T

Im having a copy process which I like to schedule as chore.

The process copies over data from one slice to another for almost all of the cubes in my TM1 application by country.

Data tab: ExecuteProcess( CopyProcessForAllCubes, vCountry);

If I execute the process for several countries (iterating over the country dimension and executing the subprocesses) the process is hanging (deadlock?) or running forever.

I need to serialize the process to avoid any deadlock. I already read that in 10.1 the synchronized function can be used.

The problem I see is that I need to define a Lock Object which I don't want to define by cube. Is there not an easy way to serialize the processes in general and not by cube?

Would the execution change if I loop via while in the prolog over the countries instead of using the datatab?

Thanks for helping.

Re: Serialize all Processes

Posted: Mon Jan 27, 2014 6:36 pm
by tomok
Do you want the easy solution or the hard one? The easy solution is to export the data for each cube and company to a flat file and then call another TI process that takes the flat file and loads it into the desired location(s). This will get around the locking problem and will execute pretty quickly. The hard answer is to figure the layout of your "slices", figure out where your locking is happening and adjust how you are doing the processese.

Re: Serialize all Processes

Posted: Tue Jan 28, 2014 2:42 am
by TableManagerOne
Synchronized probably isn't what you want. It has a very specific use wrt performance, and can also be used when you're really paranoid about protecting global state. Tomok's suggestion should do the trick.

It's worth clarifying though that Synchronized doesn't need to operate in terms of cubes - it accepts arbitrary strings.

The doc has:
In this example, the two lock objects' names were chosen to be the same as the cubes' names. But a lock object's name does not have to be the same as other Cognos® TM1® objects (cubes, dimensions, subsets, etc.).
For example, the following is perfectly valid:

Code: Select all

sCube_1='Cube_1';
vCountry='Uzbekistan';

Synchronized( sCube_1 | '_' | vCountry );
Another thread also calling Synchronized with 'Cube_1_Uzbekistan' would block.

Re: Serialize all Processes

Posted: Tue Jan 28, 2014 8:29 am
by maps
@Tomok export and import is already pretty tough because there are about 20 subprocesses I had to change.

But if I understood TableManagerOne correctly I can just define a string called "blockMe" in the CopyProcessForAllCubes (this one calls all the subprocesses). So this String is the same for all Countries which will synchronize all the processes.

Data tab: ExecuteProcess( CopyProcessForAllCubes, vCountry);

Co the copyProcessForAllCubes contains the synchronized with a static string.

Re: Serialize all Processes

Posted: Tue Jan 28, 2014 5:48 pm
by BariAbdul
maps wrote:@Tomok export and import is already pretty tough because there are about 20 subprocesses I had to change.

But if I understood TableManagerOne correctly I can just define a string called "blockMe" in the CopyProcessForAllCubes (this one calls all the subprocesses). So this String is the same for all Countries which will synchronize all the processes.

Data tab: ExecuteProcess( CopyProcessForAllCubes, vCountry);

Co the copyProcessForAllCubes contains the synchronized with a static string.
Hi Maps ,Did it worked for you? Could it be possible to post your final workaround,Please? Thanks