what is the exact serialization effect of `#pragma runlocal`?
Assuming that there are multiple make execution branches running in parallel and one of them tries to execute `#pragma runlocal`, does it mean that all the rest will pause while that is run?
What happens if this runlocal job spawns another emake? Would that also run locally or on agents? Would it parallelize?
Answer by eric melski · Mar 18, 2017 at 04:51 AM
The serialization effect of `#pragma runlocal` is described in the Electric Make User Guide, under "Running a Local Job on the Make Machine":
Forced serial mode – Electric Make executes a run-local job when all previous commands are complete, and does not allow other commands to run until the run-local job is complete. In other words, while the run-local job is running, no other build steps are executed.
So yes, work related to other make instances is paused while the `runlocal` job is executed. This is part of why the use of `#pragma runlocal` is discouraged except for "final" steps in your build, also as noted in the documentation:
Typically, final link or packaging steps are the only commands that should be marked runlocal.
@eric melski : According to forced serialization given in the document , emake will run only one job at a time (similar to j1 Correct me if I am wrong) and this increases the time more than normal gmake to execute those jobs. Wouldn't it be more faster if emake can run the number of jobs equal to number of agents on the same host or number of cores of system like normal gmake does
@Bhargav the point with runlocal jobs is that they are running on the emake host and explicitly not using agents. If more than one was run concurrently that would expose you to the risk that those jobs might interfere with one another via concurrent filesystem modifications, such that Electric Make could no longer guarantee the correctness of the build. This is really just another reason to limit the use of '#pragma runlocal'.
Can emake run a cluster build under a chroot environment? 2 Answers
Long serial chain - how to make it start building earlier in the build? 1 Answer
Is there any way to designate a makefile as a "critical section" with ElectricAccelerator? 3 Answers
Is there a way to give different groups priority access to resources? 2 Answers
Does eDepend work like clearmake -R? 1 Answer
Electric Cloud powers Continuous Delivery, helping organizations developing deliver better software faster by automating and accelerating build, test, and deployment processes at scale. Industry leaders like Qualcomm, SpaceX, Cisco, GE, Gap, and E*TRADE use Electric Cloud solutions to boost DevOps productivity and Agile throughput.