Here is some new bad news, and i mean really bad news

Apr 12, 2014 166 Replies

FDTD takes a lot of memory, but being a time-domain thing, it can model time-dependent systems such as photoresist or nonlinear optics. I sort of backed into needing to code my own--I needed an optimizing simulator to design very nonintuitive devices (near-IR metal antennas coupled to

0.25x0.45 micron SOI waveguides), and I couldn't buy one at the time (2004ish).

So I took a well-tested FDTD engine, Berkeley Tempest 6.0, for which I had the source, and wrapped it in a giant REXX script that functioned like a math program, geometry generator, and optimizer. It took about three or four months, but it worked great.

Then I ran out of CPU cycles, so I wrote a clusterized FDTD that used the same subset of the TEMPEST syntax that I'd used in the script, and added some cluster-specific stuff. On a 14-core cluster (7 dual Opteron boxes), it ran about 12 times as fast as the uniprocessor version, and more than 20 times faster than TEMPEST on the same hardware. It was nice having TEMPEST to compare with, because that let me do apples-to-apples sanity checks on the same exact simulation. That sped up debugging a lot, I can tell you. The Linux thread scheduler is completely fascist--if you aren't root, you can't even _reduce_ the priority of some of your own threads to indicate which ones are time-critical, and if you are root, making one thread real time priority makes threads in the process real time, and the user interface freezes till the computation is done. Brain dead.

Coding something like that wasn't really in my job description, so I had to do it as a part-time task, but I had a lot of fun doing it.

There's still some obscure bug in the dispersive metal support (metals like copper, silver, and gold, where n < k, i.e. the real part of the dielectric constant is negative). I'll fix it one of these days.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

No, it's just white Gaussian noise, because if you just use DC, it all disappears on the next time step.

Cheers

Phil Hobbs

Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net

Interesting. And yes, having an oracle is priceless in debugging algorithmic code. I would do analysis in Mathematica, and use it to generate test case to which the C/C++ must comply to six places.

I don't know if Linux had this in 2004, but the standard POSIX solution (there is 95% overlap with Linux nowadays) is to choose your scheduling scope to be threads (versus processes).

If the LinkedIn photo on the net is current, you already possess the required beard.

When the right job comes along.

Joe Gwinn

I know this is a somewhat late reply, but in fact the Motorola 68040 microprocessor, and Intel's microprocessors from the Pentium to the present day, all handle denormal numbers very slowly. It is _not_ simply a question of a retrofit of floating-point units designed for a different format.

John Savard

Yup. In just about any large scale computation denormals are a nuisance.

Cheers

Phil Hobbs

On a VAX 11/780, single precision and double precision were not the only floating point options. H_floating and G_floating were a very useful set of further-precision number formats, with good FORTRAN library support. Modern VMS has X_floating 128-bit, giving 33 decimal places and exponents up to 10**4932.

For a theoretician who doesn't like to normalize his units, these were actually quite useful... and it worked because almost ALL the floating point was microcoded. You don't get FLOPS performance that way, but it saves weeks of debugging.

At least on the original VAX-11/780 only 32 bit F_FLOAT and 64 bit D_FLOAT were available, using the same floating point formats as PDP-11 FP-11 coprocessor family floats (and 32 bit float FIS instruction set on older PDP-11 machines). These mixed endian formats definitively did _not_ support denorms nor INF.

On later VAX models, the 64 bit G_FLOAT and 128 bit H_FLOAT was available, neither having denorms nor INF. On some compilers, you had to select between the 54 bit D and G float format, the first one with better precission, the latter with larger exponent range.

Is that X_FLOAT an OpenVMS Alpha data type ? Alpha also supported IEEE float representations with denorms and INF. Apart from those features, why would it be better than the 128 bit H_FLOAT ?

Denorms are a problem with floating point add/sub, since you must first adjust the exponents to be the same by shifting right the mantissa of the smaller operand, before performing the FP add/sub. Then you have to shift left the result, until the first non-sero bit drops into the carry bit (normalized values) or the maximum shift count is exceeded (denorms) and finally store the result into a register or memory location.

In practice, you will need a slightly wider barrel shifter to handle the denorms.

In numerical analysis, on of the first thing to learn is how to avoid extremely small or extremely large internal results in long calculations.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required