1. A method for distributed computing, comprising: at a plurality of computing nodes, processing respective sets of data and calculating respective local values of one or more statistical parameters characterizing the sets of the data; defining a global condition, which is violated when a function defined over a weighted average of the respective local values crosses a predetermined threshold; separating the global condition into a plurality of local constraints, comprising a respective local constraint to be evaluated by each of the nodes based on the respective local values, such that violation of the respective local constraint in at least one of the nodes indicates a violation of the global condition; evaluating the respective local constraint independently at each of the nodes; and when at least one of the nodes detects that the respective local constraint is violated, outputting an indication that the global condition has been violated.