Swap out Deno harness for gnu parallel harness as we were not running to completion

This commit is contained in:
Joshua Coles 2023-02-20 09:56:58 +00:00
parent c33a2a207f
commit 3f6a8f0282
4 changed files with 10 additions and 25 deletions

View File

@ -141,6 +141,7 @@ void DLASystem::updateClusterRadius(double pos[]) {
}
if (killCircle + 2 >= gridSize / 2) {
std::cerr << "Early Exit" << endl;
this->running = false;
}
}
@ -221,6 +222,8 @@ DLASystem::~DLASystem() {
delete[] grid[i];
delete[] grid;
csv_out.flush();
if (csv_out.is_open()) {
csv_out.close();
}

3
harness.bash Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
parallel "../run {1} {2} {3}" ::: {0..10} ::: {0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0} ::: 1000

View File

@ -1,25 +0,0 @@
#!/usr/bin/env -S deno run --allow-env --allow-run
const execPath = Deno.args[0];
function* range(min, max, incr = 1): Generator<number> {
let i = min;
do {
yield i
i += incr;
} while (i < max)
}
let ps = []
for (let seed of range(0, 10)) {
for (let prob of (range(0, 1, 0.05))) {
const p = Deno.run({
cmd: [execPath, seed, prob, 1000],
});
ps.push(p)
}
}
await Promise.all(ps);

View File

@ -29,6 +29,8 @@ Config::Config(int argc, char **argv) {
str << "./out-" << seed << '-' << stickProbability << "-" << maxParticles << ".csv";
std::ofstream csv_out(str.str());
this->csv = std::move(csv_out);
this->csv << "frame" << "," << "x" << "," << "y" << std::endl;
}
}
@ -47,5 +49,7 @@ int main(int argc, char **argv) {
sys->Update();
}
cout << "hey" << endl;
return 0;
}