Problem installing petsc on a Blue Gene/L

Satish Balay balay at mcs.anl.gov
Tue Dec 30 00:52:14 CST 2008


On Mon, 29 Dec 2008, Shi Jin wrote:

> Thank you very much.
> I did 
> 1. ./configure --CC=mpixlc --FC=mpixlf77 --with-batch --download-f-blas-lapack=1
> =================================================================================
>     Since your compute nodes require use of a batch system or mpiexec you must:
>  1) Submit ./conftest to 1 processor of your batch system or system you are    
>     cross-compiling for; this will generate the file reconfigure.py            
>  2) Run ./reconfigure.py (to complete the configure process).                  
> =================================================================================
> 2.  mpirun -partition R001 -n 1 -mode vn  -cwd $PWD -exe $PWD/conftest
> But it exited with error during the run. I see the output file
> sjin at fen1 petsc-3.0.0-p0 $ cat reconfigure.py
> #!/usr/bin/python
> 
> configure_options = [
>  '--with-memcmp-ok',  '--sizeof_char=1',
>   '--sizeof_void_p=4',
>   '--sizeof_short=2',
>   '--sizeof_int=4',
>   '--sizeof_long=4',
>   '--sizeof_long_long=8',
>   '--sizeof_float=4',
>   '--sizeof_double=8',
>   '--sizeof_size_t=4',
>  '--bits_per_byte=8',
>   '--sizeof_MPI_Comm=4',
>   '--sizeof_MPI_Fint=4',
> sjin at fen1 petsc-3.0.0-p0 $
> 
> It is not complete and error must have happened after sizeof_MPI_Fint. The good news is that the sizeof(char) error is no longer there once we do the batch mode. I am wondering if there is a way to keep the conftest.c source and relevant header files (I think they are created temporarily and deleted after the built). This way, it would be fairly easy to figure out which part is having problem. 


Yes- preserving conftest.c would be useful. Currently I've managed to
grab this code by introducing a compile bug into the generated code,
and then looking at configure.log [since the compile fails - configure
spits out the code into configure.log]

For eg: - the following change will do this..
asterix:/home/balay/tmp/petsc-3.0.0-p0>hg diff
diff -r 91983f07319f config/BuildSystem/config/packages/MPI.py
--- a/config/BuildSystem/config/packages/MPI.py Tue Dec 30 00:49:45 2008 -0600
+++ b/config/BuildSystem/config/packages/MPI.py Tue Dec 30 00:50:01 2008 -0600
@@ -233,7 +233,7 @@
           self.framework.addBatchBody('''
 {
   MPI_Aint size;
-  int ierr = MPI_Type_extent(%s, &size);
+  int ierr = MPI_Type_extent(%s, &size)
   if(!ierr && (size != 0)) {
     fprintf(output, "  \'--have-mpi-%s=1\',\\n");
   } else {
asterix:/home/balay/tmp/petsc-3.0.0-p0>


However it is likely the attached patch will fix this problem [it is
scheduled for the next patch update]

cd config/BuildSystem
patch -Np1 < mpi-check-cray.patch

Satish


> Please help.
> Thank you very much.
> --
> Shi Jin, PhD
> 
> 
> --- On Mon, 12/29/08, Barry Smith <bsmith at mcs.anl.gov> wrote:
> 
> > From: Barry Smith <bsmith at mcs.anl.gov>
> > Subject: Re: Problem installing petsc on a Blue Gene/L
> > To: petsc-users at mcs.anl.gov
> > Date: Monday, December 29, 2008, 10:34 AM
> > Since the BlueGene is a batch system you need the additional
> > option --with-batch and follow
> > the directions.
> > 
> >    Barry
> > 
> > On Dec 29, 2008, at 4:34 AM, Shi Jin wrote:
> > 
> > > Hi there,
> > > 
> > > I have been trying to install petsc-3.0 on a Blue
> > Gene/L system.
> > > Here is what I used to configure:
> > > ./configure --CC=blrts_xlc
> > --CFLAGS="-I/bgl/BlueLight/ppcfloor/bglsys/include
> > -qtune=440 -qarch=440d -qlist -qsource  -O3   
> > -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts
> > -lmsglayer.rts -lrts.rts -ldevices.rts"
> > --with-mpi-compilers=0 --with-fortran=0
> > > 
> > > I got an error as following:
> > > TESTING: checkSizeof from
> > config.types(/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py:251)
> > >
> > *********************************************************************************
> > >         UNABLE to CONFIGURE with GIVEN OPTIONS    (see
> > configure.log for details):
> > >
> > ---------------------------------------------------------------------------------------
> > > Unable to determine sizeof_char
> > >
> > *********************************************************************************
> > > 
> > > Here is the relevant configure.log part:
> > > TEST checkSizeof from
> > config.types(/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py:251)
> > > TESTING: checkSizeof from
> > config.types(/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py:251)
> > >  Determines the size of type "typeName", and
> > defines SIZEOF_"typeName" to be the size
> > > Checking for size of type: char
> > >          Pushing language C
> > > sh: blrts_xlc -c -o conftest.o
> > -I/bgl/BlueLight/ppcfloor/bglsys/include -qtune=440
> > -qarch=440d -qlist -qsource  -O3   
> > -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts
> > -lmsglayer.rts -lrts.rts -ldevices.rts -g  conftest.c
> > > Executing: blrts_xlc -c -o conftest.o
> > -I/bgl/BlueLight/ppcfloor/bglsys/include -qtune=440
> > -qarch=440d -qlist -qsource  -O3   
> > -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts
> > -lmsglayer.rts -lrts.rts -ldevices.rts -g  conftest.c
> > > sh:
> > >                      Pushing language C
> > >                      Popping language C
> > > sh: blrts_xlc  -o conftest  
> > -I/bgl/BlueLight/ppcfloor/bglsys/include -qtune=440
> > -qarch=440d -qlist -qsource  -O3   
> > -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts
> > -lmsglayer.rts -lrts.rts -ldevices.rts -g  conftest.o
> > > Executing: blrts_xlc  -o conftest  
> > -I/bgl/BlueLight/ppcfloor/bglsys/include -qtune=440
> > -qarch=440d -qlist -qsource  -O3   
> > -L/bgl/BlueLight/ppcfloor/bglsys/lib -lmpich.rts
> > -lmsglayer.rts -lrts.rts -ldevices.rts -g  conftest.o
> > > sh:
> > > Executing: ./conftest
> > > sh: ./conftest
> > > Executing: ./conftest
> > > sh:
> > > ERROR while running executable: Could not execute
> > './conftest':
> > >
> > *********************************************************************************
> > >         UNABLE to CONFIGURE with GIVEN OPTIONS    (see
> > configure.log for details):
> > >
> > ---------------------------------------------------------------------------------------
> > > Unable to determine sizeof_char
> > >
> > *********************************************************************************
> > >  File "./configure", line 217, in
> > petsc_configure
> > >    framework.configure(out = sys.stdout)
> > >  File
> > "/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/framework.py",
> > line 884, in configure
> > >    child.configure()
> > >  File
> > "/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py",
> > line 353, in configure
> > >    map(lambda type: self.executeTest(self.checkSizeof,
> > type), ['char','void *', 'short',
> > 'int', 'long', 'long long',
> > 'float', 'double', 'size_t'])
> > >  File
> > "/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py",
> > line 353, in <lambda>
> > >    map(lambda type: self.executeTest(self.checkSizeof,
> > type), ['char','void *', 'short',
> > 'int', 'long', 'long long',
> > 'float', 'double', 'size_t'])
> > >  File
> > "/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/base.py",
> > line 97, in executeTest
> > >    ret = apply(test, args,kargs)
> > >  File
> > "/gpfs/bglscratch/pi/sjin/src/petsc-3.0.0-p0/config/BuildSystem/config/types.py",
> > line 275, in checkSizeof
> > >    raise RuntimeError('Unable to determine
> > '+typename)
> > > 
> > > Do you know what could be my possible cause of the
> > error?
> > > I wrote a simple C test code and was able to show that
> > sizeof(char)=1. Is there a way to get the conftest.c code
> > and try it out manually?
> > > Thanks a lot.
> > > 
> > > --
> > > Shi Jin, PhD
> > > 
> > > 
> > > 
> > >
> 
> 
>       
> 
> 
-------------- next part --------------
tree 1573f683f67d
parent 0d13e9fc4001
author Matt Knepley <knepley at mcs.anl.gov> 1230131724 21600
committer Matt Knepley <knepley at mcs.anl.gov> 1230131724 21600
revision 2207
branch default

Disable testing code
diff --git a/config/packages/MPI.py b/config/packages/MPI.py
--- a/config/packages/MPI.py
+++ b/config/packages/MPI.py
@@ -218,7 +218,8 @@
     oldLibs  = self.compilers.LIBS
     self.compilers.CPPFLAGS += ' '+self.headers.toString(self.include)
     self.compilers.LIBS = self.libraries.toString(self.lib)+' '+self.compilers.LIBS
-    for datatype, name in [('MPI_LONG_DOUBLE', 'long-double'), ('MPI_ENORMOUS_DOUBLE', 'enormous-double'), ('MPI_UNBELIEVABLE_DOUBLE', 'unbelievable-double')]:
+    #for datatype, name in [('MPI_LONG_DOUBLE', 'long-double'), ('MPI_ENORMOUS_DOUBLE', 'enormous-double'), ('MPI_UNBELIEVABLE_DOUBLE', 'unbelievable-double')]:
+    for datatype, name in [('MPI_LONG_DOUBLE', 'long-double')]:
       if self.checkCompile('#ifdef PETSC_HAVE_STDLIB_H\n  #include <stdlib.h>\n#endif\n#include <mpi.h>\n', 'MPI_Aint size;\nint ierr = MPI_Type_extent('+datatype+', &size);\nif(ierr || (size == 0)) exit(1);\n'):
         if 'have-mpi-'+name in self.argDB:
           if int(self.argDB['have-mpi-'+name]):
tree e3bac313a1d7
parent 5c1db22fa3b5
author Matt Knepley <knepley at mcs.anl.gov> 1230134339 21600
committer Matt Knepley <knepley at mcs.anl.gov> 1230134339 21600
revision 2208
branch default

Added setup/cleanup section for batch executable and made main() take arguments
- Put in MPI_Init/Finalize() for batch run
diff --git a/config/framework.py b/config/framework.py
--- a/config/framework.py
+++ b/config/framework.py
@@ -83,8 +83,10 @@
     self.argDB['CPPFLAGS']  = ''
     if not 'LDFLAGS' in self.argDB:
       self.argDB['LDFLAGS'] = ''
+    self.batchSetup         = []
     self.batchIncludes      = []
     self.batchBodies        = []
+    self.batchCleanup       = []
     self.batchIncludeDirs   = []
     self.dependencies       = {}
     self.configureParent    = None
@@ -817,6 +819,13 @@
       self.externalPackagesDir = None
     return
 
+  def addBatchSetup(self, setup):
+    '''Add code to be run before batch tests execute'''
+    if not isinstance(setup, list):
+      setup = [setup]
+    self.batchSetup.extend(setup)
+    return
+
   def addBatchInclude(self, includes):
     '''Add an include or a list of includes to the batch run'''
     if not isinstance(includes, list):
@@ -831,6 +840,13 @@
     self.batchBodies.extend(statements)
     return
 
+  def addBatchCleanup(self, cleanup):
+    '''Add code to be run after batch tests execute'''
+    if not isinstance(cleanup, list):
+      cleanup = [cleanup]
+    self.batchCleanup.extend(cleanup)
+    return
+
   def configureBatch(self):
     '''F'''
     if self.batchBodies:
@@ -841,7 +857,9 @@
       body = ['FILE *output = fopen("reconfigure.py","w");']
       body.append('fprintf(output, "#!'+sys.executable+'\\n");')
       body.append('fprintf(output, "\\nconfigure_options = [\\n");')
+      body.extend(self.batchSetup)
       body.extend(self.batchBodies)
+      body.extend(self.batchCleanup)
       body.append('fprintf(output, "  '+repr(args)[1:-1]+'\\n]");')
       driver = ['fprintf(output, "\\nif __name__ == \'__main__\':',
                 '  import os',
@@ -856,7 +874,7 @@
       oldFlags = self.compilers.CPPFLAGS
       self.compilers.CPPFLAGS += ' '.join(self.batchIncludeDirs)
       self.batchIncludes.insert(0, '#include <stdio.h>\n#include <sys/types.h>\n#include <sys/stat.h>')
-      if not self.checkLink('\n'.join(self.batchIncludes)+'\n', '\n'.join(body), cleanup = 0):
+      if not self.checkLink('\n'.join(self.batchIncludes)+'\n', '\n'.join(body), cleanup = 0, codeBegin = '\nint main(int argc, char **argv) {\n'):
         sys.exit('Unable to generate test file for cross-compilers/batch-system\n')
       self.compilers.CPPFLAGS = oldFlags
       self.logClear()
diff --git a/config/packages/MPI.py b/config/packages/MPI.py
--- a/config/packages/MPI.py
+++ b/config/packages/MPI.py
@@ -46,6 +46,7 @@
     # local state
     self.commf2c          = 0
     self.commc2f          = 0
+    self.needBatchMPI     = 1
     return
 
   def setupHelp(self, help):
@@ -230,6 +231,10 @@
             self.addDefine('HAVE_'+datatype, 1)
           self.popLanguage()
         else:
+          if self.needBatchMPI:
+            self.framework.addBatchSetup('if (MPI_Init(&argc, &argv));')
+            self.framework.addBatchCleanup('if (MPI_Finalize());')
+            self.needBatchMPI = 0
           self.framework.addBatchInclude(['#include <stdlib.h>', '#include <mpi.h>'])
           self.framework.addBatchBody('''
 {
diff -r 97d5249b8bbd config/packages/MPI.py
--- a/config/packages/MPI.py	Wed Dec 24 09:58:59 2008 -0600
+++ b/config/packages/MPI.py	Sat Dec 27 09:00:46 2008 -0600
@@ -238,8 +238,11 @@
           self.framework.addBatchInclude(['#include <stdlib.h>', '#include <mpi.h>'])
           self.framework.addBatchBody('''
 {
-  MPI_Aint size;
-  int ierr = MPI_Type_extent(%s, &size);
+  MPI_Aint size=0;
+  int ierr=0;
+  if (MPI_LONG_DOUBLE != MPI_DATATYPE_NULL) {
+    ierr = MPI_Type_extent(%s, &size);
+  }
   if(!ierr && (size != 0)) {
     fprintf(output, "  \'--have-mpi-%s=1\',\\n");
   } else {


More information about the petsc-users mailing list