Dear John,

I haven't tried the parallel version of python meep yet, but the very first 
line,
import meep as mp
is very essential. Otherwise, you are executing a python script without meep at 
all. The line is necessary to tell python to use meep.
The exception you get comes from the fact that the vector3 class is part of the 
meep module which was not imported. 'mp' is just the abbreviation for meep you 
declare with '... as mp'. You could also write 'import meep' in the first line 
and use the vector3 class via 'meep.ve<http://meep.ve>ctor3'.

Anyways, adding the import line back to you script won't help you to fix the 
original issue. But at least you know that you need it.

I hope, I could help you a little bit at least!

Best regards,
Max


------ Originalnachricht------
Von: John Weiner
Datum: Sa., 4. Aug. 2018 16:03
An: meep-discuss@ab-initio.mit.edu;
Cc:
Betreff:[Meep-discuss] getting parallel python meep up and running


Hello to all,

Having gotten the impression that  future development of meep will be 
essentially in python meep, I have taken the first tentative baby steps to get 
python meep working on my pc Ubuntu box.  Scheme meep, both stand-alone and 
parallel, is now working on this box running Ubuntu 18.04 LTS.

Using the CONDA package, I was able to install one-core python meep without 
incident.  It works.

Then I tried to install the parallel version using the instructions at 
https://meep.readthedocs.io/en/latest/Installation/#conda-packages<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmeep.readthedocs.io%2Fen%2Flatest%2FInstallation%2F%23conda-packages&data=02%7C01%7C%7Ce4c2eb6afd014756e82a08d5fa130b7e%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636689882052808778&sdata=bFKp8aM6Rtl4A4bSJJSR0UWw%2FljqFa4cffMRfvI%2BLa4%3D&reserved=0>,
 and in particular,

conda create -n pmp -c chogan -c conda-forge pymeep-parallel
source activate pmp


But when I tried to run a .py script using

mpirun -np 2 python foo.py,

I got the MPI error about init being disallowed, etc.  I think this problem has 
been observed and discussed earlier.

I then tried the nightly builds and was able to create the environment 
pmp_test.  When I entered the same mpirun command line as above, I got the 
following message,

 File "<string>", line 1, in <module>
  File 
"/home/john/.conda/envs/pmp_test/lib/python3.6/site-packages/meep/__init__.py", 
line 8, in <module>
    from . import _meep
ImportError: 
/home/john/.conda/envs/pmp_test/lib/python3.6/site-packages/meep/_meep.so: 
undefined symbol: 
_ZN4meep6fields17add_volume_sourceENS_9componentERKNS_8src_timeERKNS_6volumeEPKcS9_St7complexIdE

I thought that maybe the first line in the foo.py file,

import meep as mp

was not correct.  So I deleted it and ran the script again.  Then I got the 
error message,

Traceback (most recent call last):
  File "straight_waveguide.py", line 2, in <module>
    cell = mp.Vector3(16, 8, 0)
NameError: name 'mp' is not defined

which I take to mean that maybe the meep library is not "imported" without the 
import command or there is some more serious problem in the meep library.

I don't know what to do to move forward with python parallel meep and would 
appreciate any help.

Best regards,

John


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

Reply via email to