1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
 SAF_LibProps *
 saf_createProps_lib(void)
 {
    SAF_ENTER_NOINIT(saf_createProps_lib, NULL);

    SAF_LibProps *p = NULL;

 #ifdef HAVE_PARALLEL
    {  int result;
       /* confirm MPI is initialized */
       if ((MPI_Initialized(&result) != MPI_SUCCESS) || !result)
       {
          _SAF_GLOBALS.p.DoAbort = false; /* we have to turn off call to abort here */
          SAF_ERROR(NULL, _saf_errmsg("MPI is not running"));
       }
    }
 #endif

    /* allocate a property packet */
    p = calloc(1, sizeof *p);
    if (p == NULL)
       SAF_ERROR(NULL, _saf_errmsg("out of memory--unable to allocate properties object"));

    {  char *s=0;
       SAF_GETENV_WORLD(s,"SAF_ERROR_REPORTING");
       _saf_set_error_logging(s, p);
       if(s) free(s);/*cannot use _saf_free until lib is initialized*/
    }

    /* set api tracing (this call MUST COME AFTER call to setup error logging) */
    _saf_set_tracing("SAF_TRACING", p);

    /* some properties used primarily in testing and installation */
    p->DoAbort           = true; /* always do the abort by default */

    /* parallel mpi communicator */
    p->LibComm = SS_COMM_WORLD;

    /* string pool size */
    p->StrPoolSize = 4096;

    SAF_LEAVE(p);
 }