How to let other xgsubmitted tasks share cpus with visual studio build tasks?

245 Views Asked by At

I can use incredibuild as a visual studio extension package to build my code using many cpus.

Also I can use xgconsole msbuild ... command.

But if I want to add some other tasks along with vc build at the same time. So I tried it in some ways:

  1. Use a batch config.bat:

    xgSubmit /command task1
    xgSubmit /command task2
    msbuild  ***.sln /t:rebuild
    

Then use command

xgConsole /command="config.bat" /profile=pro.xml

My pro.xml as follows:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Profile FormatVersion="1">
<Tools>
    <Tool Filename="MSBuild" AllowIntercept="true" />
    <Tool Filename="Tracker" AllowIntercept="true" />
    <Tool Filename="CL" AllowIntercept="true" />
    <Tool Filename="Tracker" AllowRemote="true" />
    <Tool Filename="CL" AllowRemote="false" />
</Tools>
</Profile>

But the problem is, the tracker process created a cl process, then the cl process created a lot of other cl processes. So I set the cl as AllowIntercept and AllowRemote in the xml config file. But with this xml config, the xgconsole cannot dispatch cl processes to other cpus, just report an error.

  1. So I tried another way: I rename the Visual Studio cl.exe as clChild.exe, and backup another one, name it as clorigin.exe.

Then I designed my own cl.exe. In my own cl.exe, I check that if the parent process is tracker.exe, Then I start the clorigin.exe, and transfer the command para to it, then wait for the clorigin.exe to terminate; if the parent process is cl.exe, then I start clchild.exe.

But this way is also of no use. Simply, you can think out it is of no use.

So I think maybe I should not start the clorigin.exe by StartProcess API, which just start another process; maybe I should do it as the execute api in unix, when start a child process, in the taskmanager it just can see the parent process, which means just the parent process to finish the task of another exe, but not created a new process id?

Maybe what I think is in the wrong way, but how to let other tasks to share and be dispatched to many cpus with visual studio compile tasks at same time?

1

There are 1 best solutions below

0
On

Using the IncrediBuild Visual Studio plugin (or BuildConsole command) is the easiest and most optimized (performance wise) way to execute your solution using IncrediBuild. If you prefer to execute your builds using your custom profile, your profile.xml should look as follow (please pay attention that the Tracker shouldn't be mentioned in the profile):

<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <Profile FormatVersion="1"> <Tools> <Tool Filename="MSBuild" AllowIntercept="true" /> <Tool Filename="cl" AllowRemote="True" DeriveCaptionFrom="lastparam" VCCompiler="True" VCCompilerUnbatch="True" /> <Tool Filename="link" AllowRemote="false" DeriveCaptionFrom="firstparam" VCLinker="True" MonitorFileChanges="true" />

</Tools> </Profile>

(The writer works in IncrediBuild)