RadioBanter

RadioBanter (https://www.radiobanter.com/)
-   Antenna (https://www.radiobanter.com/antenna/)
-   -   Speedup NEC-Engine, using multiple CPU-Cores (https://www.radiobanter.com/antenna/125231-speedup-nec-engine-using-multiple-cpu-cores.html)

[email protected] September 23rd 07 08:34 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
Has anybody a solution to speedup the NEC-Engine, using multiple CPU-
Cores?
In standard use, only one NEC-Engine is running. The NEC-Engine does
not use multi-threading technique and therefore only one CPU-Core is
running.

Todays computers have multiple cores. Even I am using one with two
cores (Intel Dual-Core). And there are more cores available in the
future (3,4 and more).

My question is, is threre a solution for speeding up the antenna
calculation using NEC2/4-Engine? If not, I plan to code a wrapper NEC-
Engine, that is able to busy all CPU-Cores and merging the results to
one output file. Especially antenna calculation can be easly divided
into multiple parts (eg. radiation pattern division). If there is a
solution, I do not want to reinvent the tire again.

Regards,
Aziz


art September 23rd 07 09:53 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
On 23 Sep, 12:34, wrote:
Has anybody a solution to speedup the NEC-Engine, using multiple CPU-
Cores?
In standard use, only one NEC-Engine is running. The NEC-Engine does
not use multi-threading technique and therefore only one CPU-Core is
running.

Todays computers have multiple cores. Even I am using one with two
cores (Intel Dual-Core). And there are more cores available in the
future (3,4 and more).

My question is, is threre a solution for speeding up the antenna
calculation using NEC2/4-Engine? If not, I plan to code a wrapper NEC-
Engine, that is able to busy all CPU-Cores and merging the results to
one output file. Especially antenna calculation can be easly divided
into multiple parts (eg. radiation pattern division). If there is a
solution, I do not want to reinvent the tire again.

Regards,
Aziz


Way to go Aziz, programmers are not keeping up with machines
available.
You could make a lot of money with that
Art KB9MZ.....XG


[email protected] September 24th 07 01:28 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
On Sep 23, 12:34 pm, wrote:
Has anybody a solution to speedup the NEC-Engine, using multiple CPU-
Cores?
In standard use, only one NEC-Engine is running. The NEC-Engine does
not use multi-threading technique and therefore only one CPU-Core is
running.


The NEC engine calls standard matrix math routines, so one can replace
the libraries with a multicore library (or, even, with a MPI based
cluster library). This can help a lot on huge models (thousands of
segments)


Todays computers have multiple cores. Even I am using one with two
cores (Intel Dual-Core). And there are more cores available in the
future (3,4 and more).

My question is, is threre a solution for speeding up the antenna
calculation using NEC2/4-Engine? If not, I plan to code a wrapper NEC-
Engine, that is able to busy all CPU-Cores and merging the results to
one output file. Especially antenna calculation can be easly divided
into multiple parts (eg. radiation pattern division). If there is a
solution, I do not want to reinvent the tire again.


Or when you're doing multiple frequencies.

The NEC engine does things in several chunks:
a) building the matrix from all the geometry, including the coupling
between segments -this is frequency dependent
b) solving the matrix for the segment currents - this is a
straightforward (but time consuming) linear equation solving process
c) calculating the field by integrating all the segment currents -
this is independent among the az/el's or near field points in the
output.

So there's opportunities for parallelism in each of the three chunks,
some of which are almost embarassingly parallel (EP).
a) if you're doing an analysis at multiple frequencies, running each
frequency on a separate machine/core is a great idea, since they're
essentially independent.
b) as you suggested, breaking up the output computation (c, above) is
a natural
c) using a multicore or cluster matrix math package can help with b,
above.


Whatever you do, you should seriously contemplate basing your work on
the NEC4 engine, rather than the older NEC 2 engine. Sure, you'll
have to pay for it, but it's structured better for what you want to
do, and more accurate to boot.




Roy Lewallen September 24th 07 03:47 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
wrote:
. . .
Whatever you do, you should seriously contemplate basing your work on
the NEC4 engine, rather than the older NEC 2 engine. Sure, you'll
have to pay for it, but it's structured better for what you want to
do, and more accurate to boot.


I was recently told that the non-commercial NEC-4 license doesn't
include source code. I haven't confirmed this, but it's something you
should investigate before purchasing an NEC-4 license if you intend to
modify the source code.

You'll also, of course, need a Fortran compiler capable of compiling a
multi-threaded application.

Roy Lewallen, W7EL

Frank September 24th 07 05:27 AM

Speedup NEC-Engine, using multiple CPU-Cores
 

"Roy Lewallen" wrote in message
...
wrote:
. . .
Whatever you do, you should seriously contemplate basing your work on
the NEC4 engine, rather than the older NEC 2 engine. Sure, you'll
have to pay for it, but it's structured better for what you want to
do, and more accurate to boot.


I was recently told that the non-commercial NEC-4 license doesn't include
source code. I haven't confirmed this, but it's something you should
investigate before purchasing an NEC-4 license if you intend to modify the
source code.

You'll also, of course, need a Fortran compiler capable of compiling a
multi-threaded application.

Roy Lewallen, W7EL


I have a non-commercial license, and it came with NEC 4.1 FORTRAN
source code.

Frank



[email protected] September 24th 07 06:05 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
On Sep 23, 7:47 pm, Roy Lewallen wrote:
wrote:



I was recently told that the non-commercial NEC-4 license doesn't
include source code. I haven't confirmed this, but it's something you
should investigate before purchasing an NEC-4 license if you intend to
modify the source code.


My non-commercial copy included Source. I can't imagine that getting
only precompiled versions would be particularly useful, unless they're
willing to make a whole raft of versions (more than you get with the
release I got) with various values for the maximum segments, etc.

OTOH, LLL did just change management, so they assigned all the
licenses from UC to the new LLL management consortium, and maybe they
changed how it works for new licenses. The website still says to make
your check payable to Regents of UC

http://www.llnl.gov/ipac/technology/...titles/nec.php

And someday, Gerry Burke is going to retire, and whoever picks it up
from him may not be as willing and helpful to, for instance, recompile
peculiar versions for you.


You'll also, of course, need a Fortran compiler capable of compiling a
multi-threaded application.

That would be if you're doing finegrained parallelism (e.g. using a
multiprocessor BLAS library. Several of the strategies (dividing it
up by frequency) could actually be done by a reasonably simple shell
script/batch file that fires off the executable on different
processors with different input files. For my own NEC on a Cluster
runs, I've done the separate runs on separate machines and merge the
output files in post processing strategy.

Roy Lewallen, W7EL




John Smith September 24th 07 06:19 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
wrote:
Has anybody a solution to speedup the NEC-Engine, using multiple CPU-
Cores?
In standard use, only one NEC-Engine is running. The NEC-Engine does
not use multi-threading technique and therefore only one CPU-Core is
running.

Todays computers have multiple cores. Even I am using one with two
cores (Intel Dual-Core). And there are more cores available in the
future (3,4 and more).

My question is, is threre a solution for speeding up the antenna
calculation using NEC2/4-Engine? If not, I plan to code a wrapper NEC-
Engine, that is able to busy all CPU-Cores and merging the results to
one output file. Especially antenna calculation can be easly divided
into multiple parts (eg. radiation pattern division). If there is a
solution, I do not want to reinvent the tire again.

Regards,
Aziz


The nec engine would need to be multi-core aware. As some have already
pointed out, you would need the source and the ability to modify it ...

At the present time, I'd be surprised if a 64 bit version of the engine
even existed; however, I have not even looked into that.

Regards,
JS

[email protected] September 24th 07 10:42 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
It seems to be difficult to realize my wish! Nevertheless I will start
with an simple antenna optimizer using multiple cpu cores without
modifiying the nec-engines (e.g. NEC2 executables). Antenna
optimization can be easily parallelized. Every sort of antenna
parameters (experiment) could run on different processes and therefore
can take advantage of multiple cpu cores.
I will see, how far I can go.
Aziz


[email protected] September 24th 07 06:40 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
On Sep 23, 9:27 pm, "Frank" wrote:
"Roy Lewallen" wrote in message

...



wrote:
. . .
Whatever you do, you should seriously contemplate basing your work on
the NEC4 engine, rather than the older NEC 2 engine. Sure, you'll
have to pay for it, but it's structured better for what you want to
do, and more accurate to boot.


I was recently told that the non-commercial NEC-4 license doesn't include
source code. I haven't confirmed this, but it's something you should
investigate before purchasing an NEC-4 license if you intend to modify the
source code.


You'll also, of course, need a Fortran compiler capable of compiling a
multi-threaded application.


Roy Lewallen, W7EL


I have a non-commercial license, and it came with NEC 4.1 FORTRAN
source code.

Frank


I'll jump in here without knowing much about the program, but in
general having the Fortran source code doesn't do much to solve your
problem. The function calls to the run-time system is where the
problems will occur. Unless there are versions that support multi-
processors, you are still screwed.

Paul, KD7HB


[email protected] September 24th 07 08:23 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
Hello Roy,


That would be if you're doing finegrained parallelism (e.g. using a
multiprocessor BLAS library. Several of the strategies (dividing it
up by frequency) could actually be done by a reasonably simple shell
script/batch file that fires off the executable on different
processors with different input files. For my own NEC on a Cluster
runs, I've done the separate runs on separate machines and merge the
output files in post processing strategy.


Using Clusters, remembers me to my past university days. Indeed, I
used up to 20-60 personal computers on the computer centre, to compute
a ray-tracing movie. That was in the 90īth.
How do you handle the process communication? And how do you handle the
results?
There are more reasonably possibilities to speed up antenna
calculation and in special case of course optimizing too. The reason,
why I am want to speed up is, that antenna optimizing takes a lot of
time. I am often using the optimizing tool of 4nec2. It is a very nice
feature of 4nec2, to parameterize the antanne elements using
mathematical formulas. Anyone here, using this feature extensiv?
Aziz


Nate Bargmann September 25th 07 01:12 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
I'm not sure if this is what you're looking for, NEC ported to C:

http://5b4az.chronos.org.uk/pages/nec2.html

73, de Nate

--

"The optimist proclaims that we live in the best of all possible worlds,
the pessimist fears this is true."

[email protected] September 30th 07 11:35 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
Good news!

It is really possible, to speed up NEC calculations with CPUs
containing more then one core. I will try to implement a wrapper-
executable, that makes possible with your old NEC-engines (e.g. NEC2).
It need no recompilation of nec engine or any modifications. Just
renaming the old engine and putting the wrapper-engine on the same
directory with the original nec engine file name.

After implementing a new antenna optimizer (that one uses also multi-
core, multi-cpu enhancement), I will start with the wrapper code. I
will test the code with 4nec2, so many of you could take advantage of
multi-cores with 4nec2.

regards,
Aziz


[email protected] October 1st 07 05:00 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
On Sep 25, 5:12 am, Nate Bargmann
wrote:
I'm not sure if this is what you're looking for, NEC ported to C:


Hmmm.. Isn't that the version that used f2c to convert the FORTRAN to
C? Probably a bad plan overall.. there's some reputed bugs in the
process, and it's going to use different libraries, etc. If you're
worried about performance, stick with the FORTRAN and use a good
compiler.



[email protected] October 1st 07 05:01 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
On Sep 30, 3:35 pm, wrote:
Good news!

It is really possible, to speed up NEC calculations with CPUs
containing more then one core. I will try to implement a wrapper-
executable, that makes possible with your old NEC-engines (e.g. NEC2).
It need no recompilation of nec engine or any modifications. Just
renaming the old engine and putting the wrapper-engine on the same
directory with the original nec engine file name.

After implementing a new antenna optimizer (that one uses also multi-
core, multi-cpu enhancement), I will start with the wrapper code. I
will test the code with 4nec2, so many of you could take advantage of
multi-cores with 4nec2.

regards,
Aziz


An excellent idea. Arie has already put a decent symbol substitution
processor in, so if you can read the same files, and then farm out the
various symbol values to the processors in a reasonable way, that
would be pretty useful.


[email protected] October 1st 07 08:48 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
Hello Jim,

on the last 6 month, I wrote a "C-language-like" NEC-Compiler, which
generates symbolic antenna models and therefore the output model can
be read directly from 4nec2. The generated code is fully symbolic, so
the antenne parameters can be optimized with 4nec2 as usual.

As an experiment of one of the simplest optimization function (monte
carlo method), I started the new optimizer and of course in the hope
of getting some speed enhancements. Some antenne problems have a big
local minima problem and sometimes the optimization get stucks in a
next optimum level (local minima), but not the best one (global
minima).

With the monte carlo method, this can not be happend, but it takes
much more computation time. The new optimizer of course, uses the new
NEC-compiler, to generate different parameters and NEC-Input for the
engines.

At the moment, I interrupted the development of the optimizer and
startet with the NEC-Engine Wrapper. I have coded during last night
the most parts of it and I just have to merge the results now. On my
dual-core Intel CPU, the performance level of the CPU goes directly to
100% with running two NEC-Engines in the background, so they use all
the CPU-Cores at the same time.
Merging the results, is much more non-trivial part. I hope, I can
solve this very elegant.
The integration of the NEC-Wrapper will be transparent and seamless.

I will see, how far I can go.

Regards,
Aziz


[email protected] October 1st 07 09:13 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
On 1 Okt., 06:01, wrote:
On Sep 30, 3:35 pm, wrote:





Good news!


It is really possible, to speed up NEC calculations with CPUs
containing more then one core. I will try to implement a wrapper-
executable, that makes possible with your old NEC-engines (e.g. NEC2).
It need no recompilation of nec engine or any modifications. Just
renaming the old engine and putting the wrapper-engine on the same
directory with the original nec engine file name.


After implementing a new antenna optimizer (that one uses also multi-
core, multi-cpu enhancement), I will start with the wrapper code. I
will test the code with 4nec2, so many of you could take advantage of
multi-cores with 4nec2.


regards,
Aziz


An excellent idea. Arie has already put a decent symbol substitution
processor in, so if you can read the same files, and then farm out the
various symbol values to the processors in a reasonable way, that
would be pretty useful.- Zitierten Text ausblenden -

- Zitierten Text anzeigen -


I forgot to mention, that the nec code is compatible with 4nec2-files.
I am also able to compile the 4nec2 symbolic code. And the compiled
output is also compatible to 4nec2.



[email protected] October 3rd 07 09:36 AM

Speedup NEC-Engine, using multiple CPU-Cores
 
IT IS INCREDIBLE!
My beta NEC-Booster is WORKING now!

I implemented the Frequency Sweep (FR-Cards 1) optimization. For
more then one Frequency, the multi-processor / multi-core enhancement
of my PC is fully occupied. On my dual-core Pentium, the calculation
time decreases almost to half of normal NEC2 calculation time.

I will do now the Radiation Pattern optimization. Especially, if
somebody only have one Frequency defined. This part is a non-trivial
part and takes some more implementation time.

I need some people as a beta-tester. So I can fix all bugs and special
cases.
I will let you know, when I am finished.
Aziz


[email protected] October 8th 07 08:30 PM

Speedup NEC-Engine, using multiple CPU-Cores
 
Update:

Now implemented also Radiation-Pattern-Division. It is working.

On most antenna calculations, there will be speed enhancements on
multi-core / multi-processor systems with original windows-based NEC2
engines. But not for all antennas. It depends on many factors.

I achieved a seamless integration with fall backs, if there is no
optimization possible. The generated (merged) output will be 100%
compatible.

State now: Testing beta-version.
Coming State: Documentation and making on the web free (for private
use) for download.

I hope, at the lastest one week there will be a first relase for
download.

Regards,
Aziz



All times are GMT +1. The time now is 01:51 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
RadioBanter.com