Skip to content

Commit 4653225

Browse files
committed
Add ProcessorCount parameter
1 parent 309c7cb commit 4653225

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

entries/ocoddo/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ Hope you find this interesting.
1313
- Make sure you set build mode to `Release`
1414
- Build
1515
- Run as `./ocoddo ./input.txt`
16-
- You can try different parameters for your hardware: `./ocoddo ./input.txt --jumper-count=192 --part-size=192`. Try values from `128`, `192`, `256`, and up
16+
- You can try different parameters for your hardware: `./ocoddo ./input.txt --jumper-count=192 --part-size=192 --processor-count=32`. Try values from `128`, `192`, `256`, and up
1717

1818

1919

2020
Made by O
21+

entries/ocoddo/src/Project1.lpr

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
var
3232
JumperCount: UPS;
3333
PartSize: UPS;
34+
ProcessorCount: U8;
3435

3536
type
3637
THash = U32;
@@ -240,11 +241,6 @@ TStationSummary = record
240241

241242
procedure Process(out AStations: TStationResultArray); overload;
242243

243-
function ProcessorCount: U8;
244-
begin
245-
Result := LogicalProcessorCount;
246-
end;
247-
248244
procedure Initialize(out AContext: TContext);
249245
var
250246
I: Ind;
@@ -376,6 +372,7 @@ TStationSummary = record
376372
if Length(Parameters) = 0 then
377373
Exit;
378374

375+
ProcessorCount := LogicalProcessorCount;
379376
JumperCount := 256 * 1024;
380377
PartSize := 192 * 1024 - ReadMargin;
381378

@@ -387,7 +384,9 @@ TStationSummary = record
387384
if N = 'jumper-count' then
388385
JumperCount := V * 1024
389386
else if N = 'part-size' then
390-
PartSize := (V * 1024) - ReadMargin;
387+
PartSize := (V * 1024) - ReadMargin
388+
else if N = 'processor-count' then
389+
ProcessorCount := V;
391390
end;
392391

393392
Run(&File(Fix(Value(Parameters[0]))));

0 commit comments

Comments
 (0)