Files
UnrealEngineUWP/Engine/Source/Programs/ParallelExecutor/Private/ParallelExecutor.cpp
Ben Marsh df7c0e26f5 Fix logs not being flushed when running ParallelExecutor.
#codereview Paul.Fazio

[CL 2574287 by Ben Marsh in Main branch]
2015-06-02 15:14:04 -04:00

35 lines
885 B
C++

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "ParallelExecutor.h"
#include "RequiredProgramMainCPPInclude.h"
#include "BuildGraph.h"
IMPLEMENT_APPLICATION(ParallelExecutor, "ParallelExecutor")
int main(int ArgC, const char* ArgV[])
{
// TODO: command line options for limiting number of processes
// TODO: add ability to modify environment for child process, and add to job
// TODO: add a FPlatformMisc::WaitForProcessOutput() with optional parameter for cancel event
FCommandLine::Set(TEXT(""));
setvbuf(stdout, NULL, _IONBF, 0);
if(ArgC != 2)
{
wprintf(TEXT("Missing argument to ParallelExecutor for build graph."));
return 1;
}
FBuildGraph Graph;
if(!Graph.ReadFromFile(ArgV[1]))
{
wprintf(TEXT("Couldn't read '%s'"), ArgV[1]);
return 1;
}
return Graph.ExecuteInParallel(FPlatformMisc::NumberOfCoresIncludingHyperthreads());
}