List Info

Thread: command line targets build linear




command line targets build linear
user name
2007-08-08 18:56:06
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:devucmainsrctoolsjammake.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  -  jammingperforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Re: command line targets build linear
country flaguser name
United States
2007-08-10 01:12:51
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:devucmainsrctoolsjammake.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  -  jammingperforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming
> 
_______________________________________________
jamming mailing list  -  jammingperforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

Re: command line targets build linear
user name
2007-08-10 03:09:19
Hi Matt,

There is no problem with this, jam will not install anything
before it
is built - see the Install rule. But, currently it may build
A B & C
before installing A B & C, what I'm saying is that it
should install A
whilst it is building B - there are no dependencies between
the two
and concurrent execution is fine. In fact you can test this
yourself.
Just add this to your root jamfile:

Depends mytest : all install ;

Now run jam -j2 mytest

Uninstalling and cleaning are not dependent so will have no
problem
running at the same time.

Craig.

On 8/10/07, matthew conte <mattbaisoku.org> wrote:
> 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:devucmainsrctoolsjammake.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  -  jammingperforce.com
> > http://maillist.perforce.com/mailman/listinfo/jamming
> >
> _______________________________________________
> jamming mailing list  -  jammingperforce.com
> http://maillist.perforce.com/mailman/listinfo/jamming
>
_______________________________________________
jamming mailing list  -  jammingperforce.com
http://maillist.perforce.com/mailman/listinfo/jamming

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )