Python argument types id not match C++ signature

Asked by Diego Peinado Martín

Hello, I'm trying to run the examples in the tutorial. I'm running now slope_friction_walls.py. I receive the following error:

Traceback (most recent call last):
  File "slope_friction_walls.py", line 94, in <module>
    normalK = 1.0000e+04
Boost.Python.ArgumentError: Python argument types in
    NRotBondedWallPrms.__init__(NRotBondedWallPrms)
did not match C++ signature:
    __init__(_object*, std::string name, std::string wallName, double normalK, int particleTag)

My system is Ubuntu 9.04 with Python 2.6. I'm making the tests in a small laptop so the example has not finished yet, so I do not know yet if the test will finish or this error will not let the application run till the end.

Anyone has experienced an error like that?

Thanks in advance and best regards,

Question information

Language:
English Edit question
Status:
Solved
For:
ESyS-Particle Edit question
Assignee:
No assignee Edit question
Solved by:
Dion Weatherley
Solved:
Last query:
Last reply:
Revision history for this message
Best Dion Weatherley (d-weatherley) said :
#1

Hi Diego,

Thanks for your question. It appears you have found a bug in the program listing for slope_friction_walls.py. The specification of interactions between the left (and back) wall and the particles, should use NRotElasticWallPrms (rather than NRotBondedWallPrms). Replace the code specifying "lw_bonds" and "bw_bonds" with the following code:

#specify that particles undergo elastic repulsion
#from the left side wall:
sim.createInteractionGroup (
   NRotElasticWallPrms (
      name = "lw_repell",
      wallName = "left_wall",
      normalK = 1.0000e+04
   )
)
#specify that particles undergo elastic repulsion
#from the back wall:
sim.createInteractionGroup (
   NRotElasticWallPrms (
      name = "bw_repell",
      wallName = "back_wall",
      normalK = 1.0000e+04
   )
)

You will also need to abort the simulation you are currently running on your laptop (press ^C) because the error message will mean the simulation will not work. When using mpirun, an error message like this one will not cause mpirun to terminate and it will appear as though the simulation is working (CPUs will run at 100%) but in fact it is just the slave MPI processes waiting for MPI messages that causes the CPUs to work near 100%. The best way to check if a simulation is working is to check regularly to see if output data is being recorded correctly.

I hope this helps solve your problem and thanks for trying ESyS-Particle.

Cheers,

Dion.

Revision history for this message
Diego Peinado Martín (diego-peinado) said :
#2

Thanks Dion Weatherley, that solved my question.

Revision history for this message
Diego Peinado Martín (diego-peinado) said :
#3

Hello Dion, thanks a lot for your quick answer. Probably if I knew more
of the Esys system, I would have found the problem by myself. I'm
starting right now, so I'll need this kind of assistance. Thanks again.
Your answer has clarified also one suspect I had. There only one of the
processes that consumed CPU resources. The other one was sleept. So if I
see again this behaviour, I'll suspect that something can be wrong.

Thanks and best regards.

Revision history for this message
Jessica (jescarish) said :
#4

Hello sir,

I'm a newbie of ESyS-Particle Program and I'm now starting running programs from your examples in the tutorial. It so happened I met a problem while running the gravity_cube.py. It says like this:

Traceback (most recent call last):
  File "gravity_cube.py", line 37, in <module>
    breakDistance = 50.0
Boost.Python.ArgumentError: Python argument types in
    NRotBondPrms.__init__(NRotBondPrms)
did not match C++ signature:
    __init__(_object*, int tag, std::string name, double normalE, double breakDistance)
    __init__(_object*, int tag, std::string name, double normalK, double breakDistance)

It seems like I have encountered the same problem as Diego. What is the meaning of the problem? I hope you'll help me out...

Thanks you in advance!!

Revision history for this message
Dion Weatherley (d-weatherley) said :
#5

Hi Jessica,

I don't think your problem is the same as Diego's. Could you please send me your version of gravity_cube.py? I'm not sure where this error message is coming from. Perhaps you have not supplied a bond tag after the 'breakDistance' argument? Or, maybe you forgot to add a comma (',') after "breakDistance = 50.0"?

Just in case, could you also please tell me which version of ESyS-Particle you are using? Last Saturday I released a new version of ESyS-Particle (ESyS-Particle-2.0.tar.gz) and updated the Tutorial:
https://twiki.esscc.uq.edu.au/pub/ESSCC/DocumentationAndPresentations/ESyS-Particle_Tutorial.pdf

I've tested all the tutorial examples against the new version and all of them appear to work. Please note that I did change some of the tutorial scripts so they were compatible with the latest version of ESyS-Particle. Unfortunately, I am no longer able to support the earlier (2.0.0beta) versions of ESyS-Particle.

Cheers,

Dion.

Revision history for this message
Vince Boros (v-boros) said :
#6

Hello Jessica:

Welcome to the ESyS-Particle community.

The traceback that you provided tells me that you are running an older version of ESyS-Particle, and therein may be the cause of the error running gravity_cube.py. (The traceback shows two possible parameter lists for NRotBondPrms, but the latest version of the code allows only one form for the parameters.) ESyS-Particle has undergone many changes in the last few months, so I highly recommend downloading the latest tarball (ESyS-Particle-2.0.tar.gz) from https://launchpad.net/esys-particle/+download and reinstalling ESyS-Particle.

It is also possible that the syntax in the argument list of NRotBondPrms in your script was wrong. The line in the traceback, "breakDistance = 50.0", is the last parameter that was listed for NRotBondPrms, indicating that the error may be in the parameters that appear before breakDistance. Check that each parameter before breakDistance is spelled correctly and that a comma appears after the value assigned to it.

The new version of ESyS-Particle has reordered the parameters of some functions (such as NRotBondPrms: tag now follows breakDistance). Although your version of Python may allow any ordering of arguments in the function call if they are named (e.g., normalK = 10000.0), they need to follow the order specified in the API documentation if values only, without the names, are provided in the function call.

I also recommend downloading an updated version of the tutorial. I have in the last hour uploaded a new version with corrections. There were commas missing (yes, they are easy to miss: my apologies) in the appendix listings which would have caused errors when running the scripts.

I do hope that our replies resolve the error running your script and that you find ESyS-Particle useful in your endeavours.

Best,

Vince

Revision history for this message
Dion Weatherley (d-weatherley) said :
#7

Dear Jessica,

I must apologise. After reviewing your message today with Vince, I realised that I missed an error in the ESyS-Particle Tutorial. The Tutorial contained a typographical error in the text, in which a comma was missing. This error has now been corrected. Thank you for reporting this.

Regardless of this oversight on my part, the error message you received indicates you were using an earlier version of ESyS-Particle (before the v2.0 stable release). I strongly encourage all users to update to the v2.0 stable version as the ESyS-Particle development team will be unable to support earlier versions of ESyS-Particle after 31 August 2009.

Once again, my sincere apologies for your difficulties with ESyS-Particle. I hope this will not deter you from using the software for your research.

Cheers,

Dion.

Revision history for this message
Jessica (jescarish) said :
#8

Dear Sir Vince and Sir Dion,

Thanks a lot for the immediate response. Unfortunately, I actually have not yet check my codes since the software is installed in our institute's computational laboratory and our school has been quarantined until next week for some important reasons. But I promise to report here as soon as I finish checking my codes.

To Sir Vince, I guess the version I used is the latest. But I'm still going to check and ask my adviser about that. Maybe, I really just missed a comma there.

To sir Dion, I am so thankful to have found ESyS software because it means a big help and serve as my tool in achieving my objectives for my study. I just hope you won't get tired of answering my inquiries coz I'm really not good with programming. But with your User Guide, I find it very comprehensible. I thank you for the good Tutorial book.

Best wishes and GoodLuck!

Jessica

Revision history for this message
Dion Weatherley (d-weatherley) said :
#9

Hi Jessica,

Your questions are always welcome and I'm sure the ESyS-Particle development team and user community will be glad to help wherever we can. Do not be concerned about your level of knowledge in programming. As long as you have a desire to learn new skills, I'm sure you will be very successful.

Best wishes,

Dion.