Unified Parallel C

1 program Added 2026-02-26T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled Evidence Report issue View issues
Aliases: UPC
Provenance: commit 1be72ca9c6 · authored 2026-02-26T22:38:01+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

6 sources · pl_id: pl/unified-parallel-c
LLM (this repo) · 1PldbLinguistWikipediaHyperpolyglotWikidata · Q2095090

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmsparallel · message passing · imperative (procedural) · structured
Typingstatic, weak, manifest
Designed byUPC Consortium
Influenced byC · AC · Split-C · Parallel C Preprocessor
Homepagehttp://upc-lang.org

Extensions claimed by this language

1 claim. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.upclinguistprimary7.3K files

Related languages

UPC (1.00)pH (0.22)Data Parallel Haskell (0.19)UFL (0.19)Glasgow Parallel Haskell (0.17)

LLM-contributed programs

Monte Carlo Pi Estimation

Provenance: commit 1be72ca9c6 · authored 2026-02-26T22:38:01+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
code.c · added: 2026-02-26T10:00:00Z
// Compute pi by approximating the area of a circle of radius 1.
// Algorithm: generate random points in [0,1]x[0,1] and measure the fraction
// of them falling in a circle centered at the origin (approximates pi/4)
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <upc.h>

int hit() { // return non-zero for a hit in the circle
   double x = rand()/(double)RAND_MAX;
   double y = rand()/(double)RAND_MAX;
   return (x*x + y*y) <= 1.0;
}

// shared array for the results computed by each thread
shared int64_t all_hits[THREADS];

int main(int argc, char **argv) {
    int64_t trials = 100000000;
    if (argc > 1) trials = (int64_t)atoll(argv[1]);
    int64_t my_trials = (trials + THREADS - 1 - MYTHREAD)/THREADS;

    srand(MYTHREAD); // seed each thread's PRNG differently

    int64_t my_hits = 0;
    for (int64_t i=0; i < my_trials; i++)
        my_hits += hit(); // compute in parallel

    all_hits[MYTHREAD] = my_hits; // publish results
    upc_barrier;

    if (MYTHREAD == 0) { // fetch results from each thread
        // (could alternatively call upc_all_reduce())
        int64_t total_hits = 0;
        for (int i=0; i < THREADS; i++)
            total_hits += all_hits[i];
        double pi = 4.0*total_hits/(double)trials;
        printf("PI estimated to %10.7f from %lld trials on %d threads.\n",
               pi, (long long)trials, THREADS);
    }

    return 0;
}

Real programs from Software Heritage

No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)

Contribute — propose a file extension

Tell us where to find evidence about Unified Parallel C (mapped to pl/unified-parallel-c). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Unified Parallel C/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Unified HQ9+ unified-diff →