1 argument.  All rows are independent, and run in parallel
765570
private ValFrame rowwise(Env env, Frame fr, final AstPrimitive fun) {
    final String[] names = fr._names;

    final AstFunction scope = env._scope;  // Current execution scope; needed to lookup variables

    // do a single row of the frame to determine the size of the output.
    double[] ds = new double[fr.numCols()];
    for (int col = 0; col < fr.numCols(); ++col)
      ds[col] = fr.vec(col).at(0);
    int noutputs = fun.apply(env, env.stk(), new AstRoot[]{fun, new AstRow(ds, fr.names())}).getRow().length;

    Frame res = new MRTask() {
      @Override
      public void map(Chunk chks[], NewChunk[] nc) {
        double ds[] = new double[chks.length]; // Working row
        AstRoot[] asts = new AstRoot[]{fun, new AstRow(ds, names)}; // Arguments to be called; they are reused endlessly
        Session ses = new Session();                      // Session, again reused endlessly
        Env env = new Env(ses);
        env._scope = scope;                               // For proper namespace lookup
        for (int row = 0; row < chks[0]._len; row++) {
          for (int col = 0; col < chks.length; col++) // Fill the row
            ds[col] = chks[col].atd(row);
          try (Env.StackHelp stk_inner = env.stk()) {
            double[] valRow = fun.apply(env, stk_inner, asts).getRow(); // Make the call per-row
            for (int newCol = 0; newCol < nc.length; ++newCol)
              nc[newCol].addNum(valRow[newCol]);
          }
        }
        ses.end(null);        // Mostly for the sanity checks
      }
    }.doAll(noutputs, Vec.T_NUM, fr).outputFrame();
    return new ValFrame(res);
  }
1063069
private Result runOnLocalPartitions(Query query) {
        PartitionIdSet mutablePartitionIds = getLocalPartitionIds();

        Result result = doRunOnQueryThreads(query, mutablePartitionIds, LOCAL_NODE);
        if (isResultFromAnyPartitionMissing(mutablePartitionIds)) {
            doRunOnPartitionThreads(query, mutablePartitionIds, result);
        }
        assertAllPartitionsQueried(mutablePartitionIds);

        return result;
    }
1169143
private void runMultigetSliceQuery(final List<K> param) {
		MultigetSliceQuery<K, N, V> multigetSliceQuery = HFactory
				.createMultigetSliceQuery(keyspace, keySerializer,
						nameSerializer, valueSerializer);

		multigetSliceQuery.setColumnFamily(columnFamily);

		multigetSliceQuery.setKeys(param);

		multigetSliceQuery.setRange(start, finish, reversed, maxColumnCount);

		QueryResult<Rows<K, N, V>> result = multigetSliceQuery.execute();

		queryResult.add(result.get());

		// Add current query execution time to internal variable
		// totalExecutionTimeMicro. When parallelism is enabled, this value might not be correct 
		// always due to available system resources and thread implementation
		totalExecutionTimeMicro.addAndGet(result.getExecutionTimeMicro());
		// Add current query execution time to internal variable
		// totalExecutionTimeNano. When parallelism is enabled, this value might not be correct 
		// always due to available system resources and thread implementation
		totalExecutionTimeNano.addAndGet(result.getExecutionTimeNano());
		
		//Add host used to the list
		m_hostsUsed.put(result.getHostUsed().getIp(), result.getHostUsed());

	}
1193454
async function run() {
  await benchmark(
    () => map(f => f(), createPromiseFuncs()),
    'Map (concurrency: 3)'
  );
  await benchmark(
    () => mapWithOptions(f => f(), { concurrency: 1 }, createPromiseFuncs()),
    'Map (concurrency: 1)'
  );
  await benchmark(
    () => mapSeries(f => f(), createPromiseFuncs()),
    'Map series'
  );
}
704248
private static boolean isPartialRow(Iterable<ExpandedPair> pairs, Iterable<ExpandedRow> rows) {
    for (ExpandedRow r : rows) {
      boolean allFound = true;
      for (ExpandedPair p : pairs) {
        boolean found = false;
        for (ExpandedPair pp : r.getPairs()) {
          if (p.equals(pp)) {
            found = true;
            break;
          }
        }
        if (!found) {
          allFound = false;
          break;
        }
      }
      if (allFound) {
        // the row 'r' contain all the pairs from 'pairs'
        return true;
      }
    }
    return false;
  }
524357
def p_parallelblock(self, p):
        ''
        p[0] = ParallelBlock(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
196742
def run(self, row, **kwargs):
        
        self.source = row
        kwargs['output'] = self.__graph__()
        super(CSVRowProcessor, self).run(**kwargs)
        return kwargs['output']
82371
def _process_non_parallel(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
        
        for gap_value, n_clusters in [self._calculate_gap(X, n_refs, n_clusters)
                                      for n_clusters in cluster_array]:
            yield (gap_value, n_clusters)
895073
def _run_cnvkit_single(data, background=None):
    
    if not background:
        background = []
    ckouts = _run_cnvkit_shared([data], background)
    if not ckouts:
        return [data]
    else:
        assert len(ckouts) == 1
        return _associate_cnvkit_out(ckouts, [data])
791258
def runInParallel(*fns):
        
        proc = []
        for fn in fns:
            p = Process(target=fn)
            p.start()
            proc.append(p)
        for p in proc:
            p.join()
1163671
def class_can_run_parallel(test_class: unittest.TestSuite) -> bool:
        
        for test_case in test_class:
            return not getattr(test_case, "__no_parallel__", False)
738127
function processRow(row) {
        if (!row) row = {};
        for (var i = 0; i < hooks.length; i++) {
            if (hooks[i].call(row, req, row) === true) return false;
        }
        return true;
    }
1021728
def prepare_rows(self,
                     rows,
                     indent,
                     has_header):

        ''''''

        out = []

        def row_wrapper(row):
            new_rows = [
                self.wrapfunc(item).split('\n')
                for item in row
            ]
            rows = []
            for item in map(lambda *args: args, *new_rows):
                if isinstance(item, (tuple, list)):
                    rows.append([substr or '' for substr in item])
                else:
                    rows.append([item])
            return rows

        logical_rows = [
            row_wrapper(row)
            for row in rows
        ]

        columns = map(lambda *args: args, *reduce(operator.add, logical_rows))

        max_widths = [
            max([len(six.text_type(item)) for item in column])
            for column in columns
        ]
        row_separator = self.row_delimiter * (len(self.prefix) + len(self.suffix) + sum(max_widths) +
                                              len(self.delim) * (len(max_widths) - 1))

        justify = self._JUSTIFY_MAP[self.justify.lower()]

        if self.separate_rows:
            out.append(
                self.ustring(
                    indent,
                    self.LIGHT_GRAY,  # pylint: disable=no-member
                    row_separator
                )
            )
        for physical_rows in logical_rows:
            for row in physical_rows:
                line = self.prefix \
                        + self.delim.join([
                                justify(six.text_type(item), width)
                                for (item, width) in zip(row, max_widths)
                        ]) + self.suffix
                out.append(
                    self.ustring(
                        indent,
                        self.WHITE,  # pylint: disable=no-member
                        line
                    )
                )
            if self.separate_rows or has_header:
                out.append(
                    self.ustring(
                        indent,
                        self.LIGHT_GRAY,  # pylint: disable=no-member
                        row_separator
                    )
                )
                has_header = False
        return out
16309
def partition(list_, columns=2):
    

    iter_ = iter(list_)
    columns = int(columns)
    rows = []

    while True:
        row = []
        for column_number in range(1, columns + 1):
            try:
                value = six.next(iter_)
            except StopIteration:
                pass
            else:
                row.append(value)

        if not row:
            return rows
        rows.append(row)
1195486
def run_command_parallel(meth, *args, &block)
      debug "P: #{meth} on #{@boxes.size} boxes (#{@boxes.collect {|b| b.host }.join(', ')})"
      threads = []

      raps = Rye::Rap.new(self)
      (@boxes || []).each do |box|
        threads << Thread.new do
          Thread.current[:rap] = box.send(meth, *args, &block) # Store the result in the thread
        end
      end

      threads.each do |t|
        Kernel.sleep 0.03 # Give the thread some breathing room

        begin
          t.join # Wait for the thread to finish
        rescue Exception => ex
          # Store the exception in the result
          raps << Rap.new(self, [ex])
          next
        end

        raps << t[:rap] # Grab the result
      end

      raps
    end
1173230
@Override
  public void run() {
    synchronized (lock) {
      if (!callables.hasNext()) {
        checkEnd();
        return;
      }

      for (int i = 0; i < parallelism && callables.hasNext(); i++) {
        setupNext(callables.next());
      }
    }

    future.whenCancelled(() -> {
      cancel = true;
      checkNext();
    });
  }
411954
def parallel(processes, threads):
    
    pool = multithread(threads)
    pool.map(run_process, processes)
    pool.close()
    pool.join()