[jamming] command line targets build linear

matthew conte matt at baisoku.org
Thu Aug 9 23:12:51 PDT 2007


I find the current functionality useful. I regularly issue:

	$ jam all install

and

	$ jam uninstall clean

Building these targets concurrently would be undesirable.

--Matt.

Craig Allsop wrote:
> Hi Christopher/Jammers,
> 
> I'm using jam -j25 with Incredibuild and have discovered a small
> problem when running such a large number of jobs concurrently.
> 
> When you build a list of targets specified on the command line, jam
> will build them one after another in linear fashion. That is, it will
> wait until each target is completely done before progressing to the
> next one. This stalls job issues when using a large -j.
> 
> My solution to this would be to modify make() and create a hidden node
> with the list of command line targets as dependents and then launch
> one make0() on the hidden node. See diff below:
> 
> Craig.
> 
> 
> ==== //uc/main/src/tools/jam/make.c#4 - d:\dev\uc\main\src\tools\jam\make.c ====
> ***************
> *** 125,141 ****
>   	int i;
>   	COUNTS counts[1];
>   	int status = 0;		/* 1 if anything fails */
> 
>   	time( &clock1 );
> 
>   	memset( (char *)counts, 0, sizeof( *counts ) );
> 
>   	for( i = 0; i < n_targets; i++ )
>   	{
> ! 	    TARGET *t = bindtarget( targets[i] );
> 
> ! 	    make0( t, 0, 0, counts, anyhow );
> ! 	}
> 
>   	if( DEBUG_MAKE )
>   	{
> --- 125,143 ----
>   	int i;
>   	COUNTS counts[1];
>   	int status = 0;		/* 1 if anything fails */
> + 	 TARGET *t;
> 
>   	time( &clock1 );
> 
>   	memset( (char *)counts, 0, sizeof( *counts ) );
> 
> + 	t = bindtarget( "<jam>command-line" );
>   	for( i = 0; i < n_targets; i++ )
>   	{
> ! 		t->depends = targetentry( t->depends, bindtarget( targets[i] ) );	
> ! 	}
> 
> !     make0( t, 0, 0, counts, anyhow );
> 
>   	if( DEBUG_MAKE )
>   	{
> ***************
> *** 153,160 ****
> 
>   	status = counts->cantfind || counts->cantmake;
> 
> ! 	for( i = 0; i < n_targets; i++ )
> ! 	    status |= make1( bindtarget( targets[i] ) );
> 
>   	return status;
>   }
> --- 155,161 ----
> 
>   	status = counts->cantfind || counts->cantmake;
> 
> ! 	status |= make1( t );
> 
>   	return status;
>   }
> 
> 
> p.s. sorry about the dupe mail.
> _______________________________________________
> jamming mailing list  -  jamming at perforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming
> 


More information about the jamming mailing list