Exemplo n.º 1
0
/** 
Function called by GAP after a workspace restore. This is also called by us in
InitLibrary();
**/ 
static Int PostRestore(StructInitInfo* module)
{
  Int i;
  Int gvar;
  Obj tmp;
  
  gvar = GVarName("LinBox");
  tmp = (Obj)VAL_GVAR(gvar);
  if(!tmp) 
  {
    tmp = (Obj)NEW_PREC(0);
  }

  /* Write the names of my functions into th LinBox record */
  for(i = 0; GVarFuncs[i].name != 0; i++) 
  {
    AssPRec(
      tmp, 
      RNamName((Char*)GVarFuncs[i].name), 
      NewFunctionC(
        GVarFuncs[i].name, 
        GVarFuncs[i].nargs, 
        GVarFuncs[i].args, 
        GVarFuncs[i].handler) );
  }
  
  MakeReadWriteGVar(gvar);
  AssGVar(gvar, tmp);
  MakeReadOnlyGVar(gvar);
  return 0;
}
Exemplo n.º 2
0
/* called after MPI_Init() and after GAP system initialization */
void Init_MPIvars( void ) {
  UInt gvar;

  AssGVar( gvar = GVarName("MPI_TAG_UB"), INTOBJ_INT(MPI_TAG_UB) );
  MakeReadOnlyGVar(gvar);
  AssGVar( gvar = GVarName("MPI_HOST"), INTOBJ_INT(MPI_HOST) );
  MakeReadOnlyGVar(gvar);
  AssGVar( gvar = GVarName("MPI_IO"), INTOBJ_INT(MPI_IO) );
  MakeReadOnlyGVar(gvar);
  AssGVar( gvar = GVarName("MPI_COMM_WORLD"), INTOBJ_INT(MPI_COMM_WORLD) );
  MakeReadOnlyGVar(gvar);
  AssGVar( gvar = GVarName("MPI_ANY_SOURCE"), INTOBJ_INT(MPI_ANY_SOURCE) );
  MakeReadOnlyGVar(gvar);
  AssGVar( gvar = GVarName("MPI_ANY_TAG"), INTOBJ_INT(MPI_ANY_TAG) );
  MakeReadOnlyGVar(gvar);
#ifdef USE_MPINU
  AssGVar( gvar = GVarName("MPI_USE_MPINU"), True );
  #ifdef MPINU_V2
    AssGVar( gvar = GVarName("MPI_USE_MPINU_V2"), True );
  #else
    AssGVar( gvar = GVarName("MPI_USE_MPINU_V2"), False );
  #endif
#else
  AssGVar( gvar = GVarName("MPI_USE_MPINU"), False );
#endif
  MakeReadOnlyGVar(gvar);
}