Re: [Meep-discuss] time-averaged magnetic field amplitude

2008-06-19 Thread Zheng Li

Steven G. Johnson wrote:

On Jun 19, 2008, at 1:40 PM, matt wrote:
  
I discovered that this approach is incompatible with meep-mpi as-is.  
The h5math and file deletion needs to be run serially.  I just  
output the files I need and use h5math from the command line, but  
that would require either a long h5math expression "d1*d1 + d2*d2  
+ ...", or a bash script which operates on two h5 files at a time.


I tried putting a (= 0 (meep-my-rank)) in the step function to  
serialize this, but then meep-mpi deadlocked as warned in the  
documentation.



Hi Matt,

Checking for (zero? (meep-my-rank)) should work, but you have to put  
it in the right place.


I suspect that you based your convert-complex-h5 function on the  
convert-h5 in an old version of Meep.  If you look at convert-h5 in  
the latest version (0.10.1), you'll find that it looks like:


(define (convert-h5 rm? convert-cmd . step-funcs)
   (define (convert fname)
 (if (zero? (meep-my-rank))
 (if (and (zero? (system (string-append convert-cmd " \""  
fname "\"")))

  rm?)
.)

where the check of meep-my-rank was inserted in Meep 0.10.1 precisely  
to serialize any conversion commands done on the output files.


Steven

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


  

Hi, everyone

I think, this file-based solution consumes lots of CPU time which is not 
suitable for some particular tasks
such as far-field calculations, although manipulating fields in certain 
areas in meep-C++ is relatively easy

and fast.

Zheng
2008-6-20
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] time-averaged magnetic field amplitude

2008-06-19 Thread Steven G. Johnson
On Jun 19, 2008, at 1:40 PM, matt wrote:
> I discovered that this approach is incompatible with meep-mpi as-is.  
> The h5math and file deletion needs to be run serially.  I just  
> output the files I need and use h5math from the command line, but  
> that would require either a long h5math expression "d1*d1 + d2*d2  
> + ...", or a bash script which operates on two h5 files at a time.
>
> I tried putting a (= 0 (meep-my-rank)) in the step function to  
> serialize this, but then meep-mpi deadlocked as warned in the  
> documentation.

Hi Matt,

Checking for (zero? (meep-my-rank)) should work, but you have to put  
it in the right place.

I suspect that you based your convert-complex-h5 function on the  
convert-h5 in an old version of Meep.  If you look at convert-h5 in  
the latest version (0.10.1), you'll find that it looks like:

(define (convert-h5 rm? convert-cmd . step-funcs)
   (define (convert fname)
 (if (zero? (meep-my-rank))
 (if (and (zero? (system (string-append convert-cmd " \""  
fname "\"")))
  rm?)
.)

where the check of meep-my-rank was inserted in Meep 0.10.1 precisely  
to serialize any conversion commands done on the output files.

Steven

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] Question on h5tovtk

2008-06-19 Thread David Domenech
Dear Alex,

You can decide which dataset extract with the command 'h5tovtk' using the
modifier "-d" followed by the name of the dataset.
By default extracts the first dataset that in your case is 'ex' (look at the
man page)

To extract 'Ey' dataset for instance:

>> h5tovtk -t 150 -o test.vtk -d ey test-e.h5

Best,

J.D.Domenech



Alex wrote :
>
> Dear Steven and meep community,
> I created a hdf5-file with all E-field components using
> ...
> (to-appended "e" (at-every 0.5 output-efield))
> ...
>
> this seems to work, since h5ls gives:
>
> h5ls test-e.h5
> ex   Dataset {50, 50, 50, 200/Inf}
> ey   Dataset {50, 50, 50, 200/Inf}
> ez   Dataset {50, 50, 50, 200/Inf}
>
> Now I want to convert this hdf5-file into the vtk format, a vector vtk
> file for mayavi (to get a vector plot with arrows), using
>
> h5tovtk -t 150 -o test.vtk test-e.h5
>
> .
>
> .
>
> What am I doing wrong?
> Thank you very much for your help in advance!
>
> Regards
> Alex
___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss

Re: [Meep-discuss] time-averaged magnetic field amplitude

2008-06-19 Thread matt




I discovered that this approach is incompatible with meep-mpi as-is. 
The h5math and file deletion needs to be run serially.  I just output 
the files I need and use h5math from the command line, but that would 
require either a long h5math expression "d1*d1 + d2*d2 + ...", or a bash 
script which operates on two h5 files at a time.

I tried putting a (= 0 (meep-my-rank)) in the step function to 
serialize this, but then meep-mpi deadlocked as warned in the 
documentation.





On Wed, 18 Jun 2008, matt wrote:

>
>
>
>
> Neat, thanks!
>
> For the time average amplitude of a complex field, I changed the
> convert-h5 function as shown below.  It's very hokey because the field
> component is hard-coded into the function, but it works.  Also, it's not
> really an average but rather a sum, which is okay if you just want a
> pretty picture.
>
>
> (define (convert-complex-h5 rm? convert-cmd . step-funcs)
>   (define (convert fname)
> (if (and rm? (zero? (system (string-append convert-cmd " \"" fname 
> ":hz.i\" \"" fname ":hz.r\""
> (system (string-append "rm \"" fname "\""
>   (lambda (to-do)
> (let ((hooksave output-h5-hook))
>   (set! output-h5-hook convert)
>   (map (lambda (f) (eval-step-func f to-do)) step-funcs)
>   (set! output-h5-hook hooksave
>
>
> (define (complex-time-avg fname step-func)
>   (let ((first-step? true))
> (lambda (to-do)
>   (if first-step?
> (begin ; just copy the output file to fname
>   (set! first-step? false)
>   ((convert-complex-h5 true
>  (string-append "h5math -e \"sqrt(d1*d1 + 
> d2*d2)\" " fname "")
>  step-func) to-do))
>   ;; otherwise, add the output file to fname
>   ((convert-complex-h5 true
>  (string-append "h5math -e \"d1 + sqrt(d2*d2 + 
> d3*d3)\" " fname " " fname "")
>  step-func) to-do)
>
>
>
>
> On Tue, 17 Jun 2008, Steven G. Johnson wrote:
>
>> On Jun 17, 2008, at 5:37 AM, matt wrote:
>>> I want meep to output the amplitude of the complex time-average
>>> magnetic
>>> field over the computation domain, as an h5 file.
>>
>>
>> See e.g.
>>
>> http://thread.gmane.org/gmane.comp.science.electromagnetism.meep.general/1456
>>
>>> but I'm not looking for for the instantaneous magnetic field.  I'm
>>> also
>>> not interested in the time-average flux or energy, which I could with
>>> flux-in-box or field-energy-in-box.
>>
>> Those two only give you time averages if you have time-harmonic
>> complex fields (i.e. a CW source, with force-complex-fields?=true, and
>> have waited for transients to disappear).
>>
>> But in the case of a time-harmonic source, the time-average field is
>> simply zero.
>>
>> Steven
>>
>> ___
>> meep-discuss mailing list
>> meep-discuss@ab-initio.mit.edu
>> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>>
>
> ___
> meep-discuss mailing list
> meep-discuss@ab-initio.mit.edu
> http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss
>

___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss


[Meep-discuss] p4_error: interrupt SIGx: 15

2008-06-19 Thread Robert Rehammar
Dear meep users,

I have installed meep on a large cluster consisting of some 100 nodes of
which I can use some from Torque/MIPCH. Meep installs fine and can be
started on as many processors as I like, but after a while the process
dies sporadic with the error
p23_602:  p4_error: interrupt SIGx: 15
p24_11906: (441.871094) net_send: could not write to fd=5, errno = 32

Googleing this tells me that some process can't write to some disc
(https://wiki.mst.edu/numerical/nic/faq) but I have no idea of how to
remedy the problem or where to start looking? Anyone have seen this
problem and can give me a hint where to start?

Meep is compiled with hdf5 parallelised and my PBS-script looks as
# Arguments to qsub can be submitted via the script as well by starting
# the line with #PBS 
# Set your mail address
#PBS -M [EMAIL PROTECTED]
#
# Mail on abort
#PBS -m a
#
# Specify time for job
#PBS -l walltime=00:02:00
#
# Request 1 processor (node)
#PBS -l nodes=2:ppn=4
#
#PBS -q ada
#
#PBS -N bend_0406
#
#PBS -v GUILE_WARN_DEPRECATED=no
#
#PBS -A Physics
#
# End of arguments to qsub

#Preparation work
cd ~/job/bended_pc_x_guided_new
common="N=10 mtrl=0 r=0.025 a=0.5 fcen=1.5 df=2 res=192 save_field=0
save_eps=0 comp=Ey fiber_res=0.05 air_frame1=10"

# Go!
mpiexec -verbose /c3se/users/e9ravn/opt/bin/meep-mpi dx=0.00 with_pc=0
$common main.ctl

#End of script (make sure line before this gets run)

Regards,
Robert


-- 
Robert Rehammar
PhD-Student
Applied Physics, Chalmers University of Technology
Department of Physics, Göteborg University
SE-421 96 Göteborg
Sweden

Tel +46 (0)31 772 3156
Fax +46 (0)31 416 984
Cel +46 (0)738 328834
Web fy.chalmers.se/~e9ravn


___
meep-discuss mailing list
meep-discuss@ab-initio.mit.edu
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss