src/ffs/ffs_inst.c
int ffs_inst_create(int id, MPI_Comm parent, ffs_inst_t ** pobj) {

  ffs_inst_t * obj = NULL;
  int rank;
  int mpi_errnol = 0;

  dbg_return_if(id < 0, -1);
  dbg_return_if(parent == MPI_COMM_NULL, -1);
  dbg_return_if(pobj == NULL, -1);

  obj = u_calloc(1, sizeof(ffs_inst_t));
  mpi_sync_if(obj == NULL);

  obj->inst_id = id;
  obj->parent = parent;
  obj->x_comm = MPI_COMM_NULL;

  MPI_Comm_rank(obj->parent, &rank);
  MPI_Comm_split(obj->parent, obj->inst_id, rank, &obj->comm);

  mpi_errnol = mpilog_create(obj->comm, &obj->log);
  mpi_sync_if(mpi_errnol);

  mpi_errnol = ffs_init_create(&obj->init);
  mpi_errnol += ffs_result_summary_create(&obj->summary);

 mpi_sync:
  mpi_err_if_any(mpi_errnol, parent);

  *pobj = obj;

  return 0;

 err:

  if (obj) ffs_inst_free(obj);
  obj = NULL;

  return -1;
}
/*****************************************************************************
 *
 *  ffs_inst_create
 *
 *  Split the parent communicator based on id of the instance.
 *
 *****************************************************************************/
ffs_inst_create
Split the parent communicator based on id of the instance.
ffs_inst_create Split the parent communicator based on id of the instance .
int ffs_inst_create(int id, MPI_Comm parent, ffs_inst_t ** pobj) {
  ffs_inst_t * obj = NULL;
  int rank;
  int mpi_errnol = 0;
  dbg_return_if(id < 0, -1);
  dbg_return_if(parent == MPI_COMM_NULL, -1);
  dbg_return_if(pobj == NULL, -1);
  obj = u_calloc(1, sizeof(ffs_inst_t));
  mpi_sync_if(obj == NULL);
  obj->inst_id = id;
  obj->parent = parent;
  obj->x_comm = MPI_COMM_NULL;
  MPI_Comm_rank(obj->parent, &rank);
  MPI_Comm_split(obj->parent, obj->inst_id, rank, &obj->comm);
  mpi_errnol = mpilog_create(obj->comm, &obj->log);
  mpi_sync_if(mpi_errnol);
  mpi_errnol = ffs_init_create(&obj->init);
  mpi_errnol += ffs_result_summary_create(&obj->summary);
 mpi_sync:
  mpi_err_if_any(mpi_errnol, parent);
  *pobj = obj;
  return 0;
 err:
  if (obj) ffs_inst_free(obj);
  obj = NULL;
  return -1;
}
int ffs_inst_create ( int id , MPI_Comm parent , ffs_inst_t * * pobj ) { ffs_inst_t * obj = NULL ; int rank ; int mpi_errnol = 0 ; dbg_return_if ( id < 0 , -1 ) ; dbg_return_if ( parent == MPI_COMM_NULL , -1 ) ; dbg_return_if ( pobj == NULL , -1 ) ; obj = u_calloc ( 1 , sizeof ( ffs_inst_t ) ) ; mpi_sync_if ( obj == NULL ) ; obj -> inst_id = id ; obj -> parent = parent ; obj -> x_comm = MPI_COMM_NULL ; MPI_Comm_rank ( obj -> parent , & rank ) ; MPI_Comm_split ( obj -> parent , obj -> inst_id , rank , & obj -> comm ) ; mpi_errnol = mpilog_create ( obj -> comm , & obj -> log ) ; mpi_sync_if ( mpi_errnol ) ; mpi_errnol = ffs_init_create ( & obj -> init ) ; mpi_errnol += ffs_result_summary_create ( & obj -> summary ) ; mpi_sync : mpi_err_if_any ( mpi_errnol , parent ) ; * pobj = obj ; return 0 ; err : if ( obj ) ffs_inst_free ( obj ) ; obj = NULL ; return -1 ; }
ffs_inst_create
  Split the parent communicator based on id of the instance.
ffs_inst_create Split the parent communicator based on id of the instance .