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 » Thu May 18, 2023 2:01 pm

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: 819
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: issue with ops.getNP()

Post by mhscott » Fri May 19, 2023 2:09 pm

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 » Sat May 20, 2023 7:41 am

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: 819
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: issue with ops.getNP()

Post by mhscott » Sun May 21, 2023 4:19 am

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 » Mon May 22, 2023 7:33 am

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 » Mon May 22, 2023 10:32 am

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

Post Reply