mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2023-01-28, 23:11   #1
Archetexture
 
Jan 2023

32 Posts
Default LLR Multithreading/Multitask

Is it possible to have LLR run multiple tests at the same time? Either in GUI or Console Version.

I got Multithreading working in the Console Version, but thats only working efficiently for larger tests.
So is it possible to have it test multiple primes at the same time?
Archetexture is offline   Reply With Quote
Old 2023-01-29, 01:03   #2
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5·937 Posts
Default

Quote:
Originally Posted by Archetexture View Post
Is it possible to have LLR run multiple tests at the same time? Either in GUI or Console Version.

I got Multithreading working in the Console Version, but thats only working efficiently for larger tests.
So is it possible to have it test multiple primes at the same time?
To run as many LLRs in their directories as you have physical cores, split the input file and put those with the same header line in their own directories along with a copy of the LLR program (*).

Alternatively, set up prpnet which enqueues work for LLR instances.

(*) On linux you can set PATH to include $HOME/bin and put LLR there.

Last fiddled with by paulunderwood on 2023-01-29 at 01:17
paulunderwood is offline   Reply With Quote
Old 2023-01-29, 01:28   #3
Archetexture
 
Jan 2023

32 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
To run as many LLRs in their directories as you have physical cores, split the input file and put those with the same header line in their own directories along with a copy of the LLR program (*).
Can you give a step by step guide on what we need to do? Thank you very much!
Archetexture is offline   Reply With Quote
Old 2023-01-29, 01:52   #4
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5×937 Posts
Default

Let's assume you have 4 cores.

Open a terminal/console.

mkdir LLR_workspace
cd LLR_workspace
mkdir core_1
mkdir core_2
mkdir core_3
mkdir core_4

copy LLR to those four "core directories".

I assume you have Windows since you mentioned the console version of LLR.

I defer you to somebody else on how split the file into 4, each of which will go in its own core folder.

The worst way to do this is to open the master input file in a text editor and open 4 "new" files. Copy the first line of the master input to each fo the core files. Then copy and paste sections of the master file to the core files. Finally save each of the core input files to their respective core folders. This a naive way of splitting the input. Somebody else will chip in and tell you how to do it programmatically in the console -- maybe a batch file you could run.

Also someone will tell you how to write and save a batch file to be run from LLR_workspace to start all LLRs. The worse case is to have 4 consoles open. Not bad, but if you have 128 cores this is a poor solution!

Sorry I cannot help you with Wind-up-ows. I only know how I'd do it with Linux.

Last fiddled with by paulunderwood on 2023-01-29 at 02:14
paulunderwood is offline   Reply With Quote
Old 2023-01-29, 02:17   #5
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2×1,531 Posts
Default

Splitting a LLR sieve file equally into several (here 4) files using awk.
kar_bon is offline   Reply With Quote
Old 2023-01-29, 02:21   #6
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5×937 Posts
Default

Quote:
Originally Posted by kar_bon View Post
Splitting a LLR sieve file equally into several (here 4) files using awk.
That's fine for Linux, but what is needed is a Windows method. It would be instructive to write three batch files: One to create X directories and copy LLR, one to split input, and another to start the LLRs. Maybe a fourth to check for primes.

Last fiddled with by paulunderwood on 2023-01-29 at 02:26
paulunderwood is offline   Reply With Quote
Old 2023-01-29, 02:26   #7
Archetexture
 
Jan 2023

916 Posts
Default

Thank you!!! I got it working, copied LLR, split my Sieve and wrote a simple batch file that opens them up.
I will come back to you when I will test it with Linux, Paul!
Archetexture is offline   Reply With Quote
Old 2023-01-29, 02:34   #8
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

5×937 Posts
Default

Quote:
Originally Posted by Archetexture View Post
Thank you!!! I got it working, copied LLR, split my Sieve and wrote a simple batch file that opens them up.
I will come back to you when I will test it with Linux, Paul!
paulunderwood is offline   Reply With Quote
Old 2023-01-29, 03:20   #9
kar_bon
 
kar_bon's Avatar
 
Mar 2006
Germany

2·1,531 Posts
Default

Quick 'dirty' DOS-batch WIN:

ToDo
- create a new folder
- put your splitted files in there named 1.txt, 2.txt, 3.txt, ... , n.txt for running n instances of LLR
- put in this folder cllr(64).exe, too (the commandline version of LLR64, I'm using an older version w/o any other DLL/EXE)
- create the batch with following code
Code:
set count=4
set i=1
:loop
md %i%
copy cllr64.exe %i%
copy %i%.txt %i%
cd %i%
start cllr64.exe %i%.txt
set /a i+=1
cd ..
IF %i% LEQ %count% GOTO :loop
- set 'count' the number of desired instances

-> count folders with the cllr64.exe and the n.txt input file will be created and cllr64 will be started processing the input file

Test with small count and small candidates first.

Last fiddled with by kar_bon on 2023-01-29 at 03:21
kar_bon is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Multithreading existing code robert44444uk Software 13 2021-03-16 12:32
Pluripotent Laptop for College Multithreading veganjoy jvang 46 2019-01-06 20:08
Processor stuck at 25% when multithreading GaEL YAFU 18 2015-12-31 10:08

All times are UTC. The time now is 13:59.


Fri Jul 7 13:59:43 UTC 2023 up 323 days, 11:28, 0 users, load averages: 1.05, 1.16, 1.16

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔