-
Oct 25th, 2014, 08:35 AM
#1
Thread Starter
New Member
Queuing work for processor
I have these problem which I think VB.NET might be able to solve but I'm not sure how to go about it.
I am doing a large number of simulation runs and each run calls an executable separately with parameters. So I might have something like:
Model.exe run1.txt
Model.exe run2.txt
.
.
Model.exe run10000.txt
I have a server with 60 cores so I need someway to kick off 60 runs and will start another run each time a core is freed up.
Does anyone roughly know how this can be done?
-
Oct 25th, 2014, 04:37 PM
#2
Re: Queuing work for processor
try this:
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim listOfRuns As New List(Of String)
listOfRuns.Add("Model.exe run1.txt")
listOfRuns.Add("Model.exe run2.txt")
For Each run In listOfRuns
Threading.ThreadPool.QueueUserWorkItem(AddressOf ProcessItem, run)
Next
End Sub
Private Sub ProcessItem(ByVal item As Object)
'this is where you run your executables
End Sub
End Class
there's more information on the ThreadPool here:
http://www.dotnetperls.com/threadpool-vbnet
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Oct 26th, 2014, 02:52 AM
#3
Re: Queuing work for processor
Hopefully not a lot of disk reads and writes involved in the simulations.
If you have 60 parallel processes logging to 60 different files at the same time, the file access may be a bottleneck and file access will sub optimal in the future as probably none of the files will be contiguous on the disk, but have blocks interleaved with all the other files being written at the time.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|