Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ptp-user] No Display of Program Output or Console Output Debug Launch of OpenMPI C Program [PTP 3.0 / Open MPI 1.4 / SDM / x86_64]

I am having a problem with PTP displaying Program Output or even Console Output
when running an Open MPI program using the Debug Launch.   While "printf()" are called
in my MPI program, nothing is displayed in the Program Output or even Console
Output windows.  I have used Debug Launches with the following flag toggled on and off:
Debug Configurations -> Applications -> "Display output from all processes in console view."

Interestingly, the output was displayed correctly when using the standard
Run launch of the program (both appearing in Program Output and
Console depending on flag setting correctly).

Below I've attached some more detailed information.

Any help you could provide resolving this issue would be greatly appreciated!

--- PA

==============================================
I am running PTP 3.0, on Kubuntu 2.6.31-17-generic, x86_64 on Thinkpad T61 Laptop
with dual core processor.  I am using OpenMPI 1.4.1, SVN revision: r22421.  I have
compiled to obtain the binary "sdm" using sh BUILD (output below) and set the
Debug launch to point to the sdm binary for x86_64 in my local directory
"./eclipse/plug-ins/.../bin/sdm."

The program (attached below) appears to run correctly in Debug mode.  It correctly writes
test files to indicate the processes are in fact running in the debug mode and the debugger
allows stepping (f6) to the final exit(0); commands at the end of the file for each process with
no problems.

I am running using the Open MPI Resource with the launch commands:

Launch Command: "mpirun  -xml -display-map ${Open_MPI_args} ${Open_MPI_env} ${execPath}/${execName} ${progArgs}"

Debug Command: "mpirun  -xml -display-map ${Open_MPI_args} ${Open_MPI_env} ${debugExecPath}/${debugExecName} ${debugArgs}"

Note: I have seen this problem with and without the "...nodenames 1" flag, which I removed after reading other posts concerning what
seemed like related display issues.

I noticed in the sh BUILD that the answers for ".checking... -lsocket no" and "checking... poe  no" both
appear (build output with "no" lines are shown below).   

Building org.eclipse.ptp.debug.sdm_3.0.1.201002011019...
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes          
checking for a thread-safe mkdir -p... /bin/mkdir -p       
checking for gawk... gawk                                  
checking whether make sets $(MAKE)... yes  
....               
checking whether we are cross compiling... no
checking for gcc option to accept ISO C89... none needed
checking for socket in -lsocket... no
checking for clock_gettime in -lposix4... no
checking jni.h usability... no
checking jni.h presence... no
checking for jni.h... no
checking for _doprnt... no
...
checking whether we are cross compiling... no
checking for gcc option to accept ISO C89... none needed
checking whether byte ordering is bigendian... no
checking for _doprnt... no
checking for xmlto... no
...
checking build system type... x86_64-unknown-linux-gnu
checking whether we are cross compiling... no
checking for gcc option to accept ISO C89... none needed
checking llapi.h usability... no
checking llapi.h presence... no
checking for llapi.h... no
checking for poe... no
...
configure: PE not installed, skipping...
checking build system type... x86_64-unknown-linux-gnu
checking whether we are cross compiling... no
checking for gcc option to accept ISO C89... none needed
checking llapi.h usability... no
checking llapi.h presence... no
checking for llapi.h... no

----------------------------------------
The open MPI program I've been compiling and running is as follows (used open MPI Hello World project and replaced .c source code
with my own below).

------------------------------
MyOpenMPIExample1.c:
------------------------------
/*
 * Quick test of MPI calls.
 *
*/

/* #include "mpi.h" */
#include<mpi.h>
#include<stdio.h>
#include<stdlib.h>


#define TAG_PREV_PROCESS_DONE 1;

int main (int argc, char **argv) {
  int rank;
  int rc;
  int numtasks;

  int tag;

  int processID;

  int  numBufferComm = 10;
  int *bufferComm;

  int destProcessID;
  int sourceProcessID;

  MPI_Status statusMPI;

  FILE *fid;
  char filename[1000];

  /* Allocate dynamic memory */
  bufferComm = (int *) malloc(sizeof(int)*numBufferComm);

  /* Setup the MPI routines */
  rc = MPI_Init(&argc,&argv);
  if (rc != MPI_SUCCESS) {
    printf ("Error starting MPI program. Terminating.\n");
    MPI_Abort(MPI_COMM_WORLD, rc);
  }

  /* Get information about the MPI environment */
  MPI_Comm_size(MPI_COMM_WORLD, &numtasks);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  processID = rank;

  sprintf(filename,"output_p%.3d.dat", processID);
  fid = fopen(filename,"w");

  fprintf(fid,"P%.3d : I am writing my test message. \n", processID);

  fclose(fid);

  if (rank == 0) {

    printf("==================================================================== \n");
    printf(" The program has each process report its process ID in order.\n");
    printf(" This is done by using blocking Send and Receive for messages. \n");
    printf("-------------------------------------------------------------------- \n");
    printf("P%.3d : I am the Master Process. \n", processID);
    printf ("P%.3d : Number of tasks = %d \n", processID, numtasks);
  }

  /* Have the processes report information about themselves in
     order of their process ID.  This requires some information
     to be exchanged.  Using blocking sends and receive will
     cause this to occur in sequence.
  */
  if (rank > 0) {
    sourceProcessID = processID - 1;
    tag             = TAG_PREV_PROCESS_DONE;
    printf ("P%.3d : Waiting to Receive MPI Message from = %d \n", processID, sourceProcessID);
    MPI_Recv(bufferComm, numBufferComm, MPI_INT, sourceProcessID, tag, MPI_COMM_WORLD, &statusMPI);
    printf ("P%.3d : Received message from process ID = %d \n", processID, bufferComm[0]);
  }

  /* Have each process report some information about itself */
  /* Only report information after received information from
   * the previous process ID */
  printf ("P%.3d : My process ID = %d \n", processID, rank);

  if (rank < numtasks - 1) {
    destProcessID = processID + 1;
    tag           = TAG_PREV_PROCESS_DONE;
    printf ("P%.3d : Sending MPI Message to = %d \n", processID, destProcessID);
    bufferComm[0] = processID;
    MPI_Ssend(bufferComm, numBufferComm, MPI_INT, destProcessID, tag, MPI_COMM_WORLD);
  }

  MPI_Finalize();

  printf("P%.3d : Process %d is finished \n", processID, rank);

  /* free dynamic memory */
  free(bufferComm);

  exit(0);

}
--------------------------------------------------------------


Back to the top