Changeset 13691


Ignore:
Timestamp:
10/16/12 09:55:40 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: PrintBanner is now done by EnvironmentInit instead of FemModel so that it is printed only once

Location:
issm/trunk-jpl/src/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r13689 r13691  
    222222}
    223223/*}}}*/
    224 /*FUNCTION FemModel::PrintBanner {{{*/
    225 void FemModel::PrintBanner(void){
    226 
    227         _pprintLine_("");
    228         _pprintLine_("Ice Sheet System Model (" << PACKAGE_NAME << ") version " << PACKAGE_VERSION);
    229         _pprintLine_("(website: " << PACKAGE_URL << " contact: " << PACKAGE_BUGREPORT << ")");
    230         _pprintLine_("");
    231 
    232 }
    233 /*}}}*/
    234224/*FUNCTION FemModel::SetStaticComm {{{*/
    235225void FemModel::SetStaticComm(void){
  • issm/trunk-jpl/src/c/classes/FemModel.h

    r13689 r13691  
    5757                void OutputResults(void);
    5858                void SetStaticComm();
    59                 void PrintBanner(void);
    6059                /*}}}*/
    6160                /*Fem: {{{*/
  • issm/trunk-jpl/src/c/solutions/EnvironmentInit.cpp

    r13621 r13691  
    77#error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!"
    88#endif
     9#include <stdio.h>
    910#include "../include/include.h"
    1011#include "../toolkits/toolkits.h"
     
    1213COMM EnvironmentInit(int argc,char** argv){
    1314
     15        /*Output*/
     16        COMM comm = 0;
     17
    1418        /*Initialize environments: Petsc, MPI, etc...: */
    15         #ifdef _HAVE_PETSC_
     19        #if defined (_HAVE_PETSC_)
    1620        int ierr=PetscInitialize(&argc,&argv,(char*)0,""); 
    1721        if(ierr) _error_("Could not initialize Petsc");
    18         return MPI_COMM_WORLD;
     22        comm = MPI_COMM_WORLD;
     23        #elif defined(_HAVE_MPI_)
     24        MPI_Init(&argc,&argv);
     25        comm = MPI_COMM_WORLD;
    1926        #else
    20         #ifdef _HAVE_MPI_
    21         MPI_Init(&argc,&argv);
    22         return MPI_COMM_WORLD;
    23         #else
    24         return 1; //return bogus number for comm, which does not exist anyway.
    25         #endif
     27        comm = 1; //bogus number for comm, which does not exist anyway.
    2628        #endif
    2729
     30        /*Print Banner*/
     31        int my_rank = 0;
     32        #ifdef _HAVE_MPI_
     33        MPI_Comm_rank(comm,&my_rank);
     34        #endif
     35        if(!my_rank) printf("\n");
     36        if(!my_rank) printf("Ice Sheet System Model (%s) version  %s\n",PACKAGE_NAME,PACKAGE_VERSION);
     37        if(!my_rank) printf("(website: %s contact: %s\n",PACKAGE_URL,PACKAGE_BUGREPORT);
     38        if(!my_rank) printf("\n");
     39
     40        /*Return communicator*/
     41        return comm;
    2842}
Note: See TracChangeset for help on using the changeset viewer.