issue with ops.getNP()

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
ricardojacomini
Posts: 4
Joined: Thu May 18, 2023 7:01 am

issue with ops.getNP()

Post by ricardojacomini »

I'm running this openseespy code below with openmpi 4.1.4 version in Linux.

I always retrieve 1 para ops.getNP() function. Any suggestions?

# ------------------ python test.py file

Code: Select all

   import openseespy.opensees as ops

   np = ops.getNP()
   print('np: ', np)

   if np < 2:
       exit()
# ------------------ command line to evaluate it
$ mpiexec -n 2 python test.py
$ mpirun -n 2 python test.py

# ------------------ output after ran the code above

np: 1
np: 1
Process 0 Terminating
Process 0 Terminating
np: 1
np: 1
Process 0 Terminating
Process 0 Terminating

# ------------------ package list
$ pip list

Package Version
--------------- -------
openseespy 3.4.0.8
openseespylinux 3.4.0.8
pip 23.1.2
setuptools 58.1.0

$ python --version
Python 3.9.15
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: issue with ops.getNP()

Post by mhscott »

If you are going to run parallel analysis with OpenSeesPy, I recommend you take a look at the OpenSees Virtual Machine, an Amazon machine image preconfigured with OpenSeesPy, MPI, etc.

AWS Marketplace: https://aws.amazon.com/marketplace/pp/p ... zfieycxidk

Usage Instructions: https://secondsees.com/opensees-ami-usage-instructions/
ricardojacomini
Posts: 4
Joined: Thu May 18, 2023 7:01 am

Re: issue with ops.getNP()

Post by ricardojacomini »

Thank you for the suggestion. I really appreciate it.

But it is the point.

How to set up my server to work like this AWS to do getNP() function to work? Do I also need to install OpenSeesMP?
mhscott
Posts: 880
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: issue with ops.getNP()

Post by mhscott »

No. Everything you need is pre-installed on the OpenSees Virtual Machine instance on AWS.
ricardojacomini
Posts: 4
Joined: Thu May 18, 2023 7:01 am

Re: issue with ops.getNP()

Post by ricardojacomini »

I got it, but I don't use it on the AWS cluster, I am trying to use it on local HPC. I'll try install OpenSeesMP as well.

Anyway, thanks for the suggestion.
ricardojacomini
Posts: 4
Joined: Thu May 18, 2023 7:01 am

Re: issue with ops.getNP()

Post by ricardojacomini »

I got it. It worked using now mpiexec.hydram in my case intel/2020.1:

$ mpiexec.hydra -n 2 python test.py
np: 2
np: 2
Process 1 Terminating
Process 0 Terminating
jfhuang
Posts: 5
Joined: Tue Dec 24, 2019 12:58 am
Location: University of Nevada, Reno

Re: issue with ops.getNP()

Post by jfhuang »

Hi Ricardo, I am having the same problem when compiling using cmake on Ubuntu. It seems the compiled python library is only the sequential version. Could you please explain in more detail how you fixed it? Did you just change mpirun/mpiexec to mpiexec.hydram? In my case, I do not have mpiexec.hydram on my system (I am using openmpi). Thanks in advance.
Post Reply