473,657 Members | 2,800 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invoking External Batch Program on Multiple Core Machine

Hello! You may remember me as the guy who's trying to learn C# and using
that old version 2003 of visual studio. (Although free version of command
line .NET compiler is available, so if some new feature would greatly
simplify my life, then I am not opposed)

I currently have an application that is single threaded that does batch work
(you pass it a file in the command line, it runs for 2-45 minutes and spits
out another file). I do not own the application and do not know what it is
written in.

This is very annoying since I have a dual core machine and would like to get
my work done as quickly as possible.

Is there a way to invoke a foreign application from C# to run on a specified
core? (If so, can you point me to an example?)

Right now we do our work, click "compile" and then wait. Eventually I would
like to try to implement some form of distributed computing on all our
office computers, so that someone needing to compile 4-5 items can occupy
the same number of idle cores accross the network.

To implement this I want to make a generic C# workhorse program that waits
around for work, occupies all cores until the work is done and returns the
results as soon as possible. I'm hoping that through smart use of
inheritance, I can make the differences between the distributed client and
the local client as little as possible.

Note: I have deliberately excluded details on what the compilation is for,
just in case my employer would have a problem with it (even though I doubt
they would).

--
LTP

:)
May 16 '07 #1
1 1818
On Wed, 16 May 2007 01:35:57 -0700, Luc The Perverse
<sl************ ***********@cc. usu.eduwrote:
Hello! You may remember me as the guy who's trying to learn C# and using
that old version 2003 of visual studio. (Although free version of
command line .NET compiler is available, so if some new feature would
greatly
simplify my life, then I am not opposed)
A free version of the *IDE* is available, not just the command line
compiler. You should upgrade, VS 2005 is very nice (I haven't used 2003,
but I have a friend who is using it now and every time I mention "well, VS
does this for me" he always finds himself saying "really? VS 2003 doesn't
do that"...I gather it's a pretty significant upgrade, and frankly I was
surprised at how much was left usable in the Express version, considering
it's free).
I currently have an application that is single threaded that does batch
work (you pass it a file in the command line, it runs for 2-45 minutes
and spits out another file). I do not own the application and do not
know what it is written in.

This is very annoying since I have a dual core machine and would like to
get my work done as quickly as possible.
So long as you remember that "dual core" does not mean "dual hard drive"
or "dual RAM". :) Depending on what that application is actually doing,
you may or may not realize benefits by having it run in the background
while you try to get something else done.
Is there a way to invoke a foreign application from C# to run on a
specified core? (If so, can you point me to an example?)
You can use the Process class to start a new process with a specific
command, and you can even set the ProcessorAffini ty on the class instance
to control what CPUs it runs on. However, why would you want to set a
specific CPU? Windows is smart enough to distribute the workload fairly
across whatever CPUs are available. There's no need to assign the process
to a specific one.
Right now we do our work, click "compile" and then wait. Eventually I
would like to try to implement some form of distributed computing on all
our
office computers, so that someone needing to compile 4-5 items can occupy
the same number of idle cores accross the network.
The idea is sound. So sound, in fact, that I'm pretty sure I've read of
implementations that already exist to do this sort of thing. I think
there are even general-purpose solutions that you might be able to use
off-the-shelf. That said, depending on what exactly you're trying to do,
it may not be very hard to do it. Use some sort of peer-to-peer
architecture to control workload requests (.NET remoting? Socket? WCF?
Whatever...), run the process (capturing the output if you like).

Just keep in mind the caveat I mentioned at the outset: just because a CPU
core is available, that doesn't mean that running a process on the
computer won't impact whatever work someone else is already doing on the
computer.

Pete
May 16 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

47
3852
by: Richard Hayden | last post by:
Hi, I have the following code: /******************************** file1.c #include <iostream> extern void dummy(); inline int testfunc() {
2
3218
by: Michel Schilthuizen | last post by:
Hi, I am working on an application that can use functionlity in some sort of plugins. I have implemented this by using Assembly.LoadFrom and MethodInfo.GetMethods. The calling of the plugins is handled in threads. All works fine, but when I call a method that processes for some time, the mainthread (my form) becomes unresponsive.
5
3623
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
4
10522
by: Ê÷Éϲä»Ò | last post by:
'rar' is not recognized as an internal or external command, operable program or batch file. import os import time source = target_dir = r'e:\temp\bak' target = target_dir+time.strftime('%Y%m%d%H%M%S')+'.rar' rar_cmd = "rar a -idcdp %s %s" % (target,' '.join(source))
4
2646
by: | last post by:
Hello, I am attempting to convert multiple .wav files to the .flac format via a batch script. I know that this can be done with numerous software implementations automatically for me; however, i am interested to understand how to create a script to perform my purpose and since this function is useful, what the hey! I am rather new to batch files but would appreciate any help. TIA My process thus far has been the following: I edited the...
60
4903
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the 'target' programming community herein) to get some community input and verify (or not) the following two statements. Few programmers (3 to7%) UNDERSTAND 'Strategic Functional Migration
14
3524
by: Gio Galma | last post by:
how I can invoke the db2diag utility in a Windows environment? in my D:\Program Files\IBM\SQLLIB\BIN directory I can see only db2diag.dll, and it seems there isn't the command line version; which is the DB2 tool that uses this dll, in order to analyze the db2diag.log? thank you in advance for help (and please, excuse my bad english) Jo --
1
1497
by: Emerald Saint | last post by:
Hi. I been away and didn't get here again until now. Thank you for your offer to share programs that you have. I studied up and refreshed my memory about linkers and compilers. So I have the answer to the question I asked here. I found a Microsoft site where they have 'Express' editions for VisualC++ and Visual Basic and other stuff. It is all free. I downloaded the VC++ Express edition and discovered there are ways to use it for...
6
1877
by: John O'Flaherty | last post by:
Hello. I have an ms acess database that I use to track my mp3 files. I have included code that lets me select and play files by invoking an mp3 player (Winamp). This is done by using visual basic command "shell c:\winamp\winamp.exe blah-blah.mp3". It works nicely. I can use this database from a laptop, either by copying the .mdb file to the laptop or by clicking a shortcut that points to the .mdb file on the main machine. The file play...
0
8403
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8610
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7345
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6174
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5636
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4327
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2735
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1730
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.