Modify

Opened 7 years ago

Last modified 6 years ago

#46 reopened defect

printfs in src/C++/pbs_wrap.cxx

Reported by: glen.beane@… Owned by: bas
Priority: blocker Milestone:
Component: pbs Version: 4.4.0
Keywords: Cc:

Description

pbs_wrap.cxx has several printf statements that have been commented out in pbs_wrap.c.

For example, both new_attrl and new_attropl have printf("constructor called\n"); statements which are commented out in src/C/pbs_wrap.c.

new_attrl also includes printf("basje \n"); which is completely absent in the version in src/C/pbs_wrap.c

I don't know how many other printf statements need to be removed or commented out, the only message I noticed when I used pbs_python was "constructor called" (which appears many times when I run my code)

Attachments (1)

remove_basje_called.patch (1.2 KB) - added by ewan.higgs@… 6 years ago.
Patch to remove 'basje' printfs.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by bas

Glenn,

Which version did you test? The printf statements are only called if we compile with -DDEBUG statement.

comment:2 Changed 7 years ago by Glen.Beane@…

This is in trunk from subversion


comment:3 Changed 7 years ago by Glen.Beane@…

pbs_wrap.cxx:

struct attrl *new_attrl(int number)
{
  struct attrl *ptr;
  struct attrl *prev, *current;
  int i;

  /*
  allocate memory as a one block is handy for Python scripts
  and fill in the next fields so it also works for the C-library
  */
  printf("basje \n");
  ptr = (struct attrl *) malloc(number * sizeof(struct attrl));

  prev = NULL;
  current = ptr + (number - 1);
  for (i=0; i < number; i++)
  {
    printf("constructor called\n");


pbs_wrap.c:

struct attrl *new_attrl(int number)
{
  struct attrl *ptr;
  struct attrl *prev, *current;
  int i;

  /*
  allocate memory as a one block is handy for Python scripts
  and fill in the next fields so it also works for the C-library
  */
  ptr = (struct attrl *) malloc(number * sizeof(struct attrl));

  prev = NULL;
  current = ptr + (number - 1);
  for (i=0; i < number; i++)
  {
    // printf("constructor called\n");





comment:4 Changed 7 years ago by bas

I will remove them. I was busy to reduce the memory footprint.

comment:5 Changed 7 years ago by bas

  • Resolution set to fixed
  • Status changed from new to closed

In 325:

remove obsolete printf message, closes #46

comment:6 Changed 7 years ago by anonymous

  • Resolution fixed deleted
  • Status changed from closed to reopened

Looks like this didn't make it into trunk, as

printf("constructor called\n");

is still executed in pbs_wrap.cxx

I just checked out trunk today and had to edit the source to remove these printf statements

comment:7 Changed 7 years ago by anonymous

Looks like they were commented out for Torque 5 only but not Torque 4

comment:8 Changed 7 years ago by bas

I will fixed it for torque 4, sorry ;-(. I only have torque 5 and 2.5 installed

comment:9 Changed 6 years ago by ewan.higgs@…

  • Priority changed from major to blocker

This is still not fixed in trunk or 4.6.0:

Trunk: https://oss.trac.surfsara.nl/pbs_python/browser/trunk/src/C%2B%2B/pbs_wrap.cxx#L3018

4.6.0: https://oss.trac.surfsara.nl/pbs_python/browser/tags/4.6.0/src/C%2B%2B/pbs_wrap.cxx#L3018

Upping this to a blocker since it's unusable in user facing scripts.

Changed 6 years ago by ewan.higgs@…

Patch to remove 'basje' printfs.

comment:10 Changed 6 years ago by bas

thanks patch applied for trunk and devel op version. This is only for torque version 4. Torque version 5 has no printf statements

Add Comment

Modify Ticket

Change Properties
Action
as reopened The owner will remain bas.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from bas to the specified user. Next status will be 'new'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.