Functions

fortranclient.c File Reference

#include <stdarg.h>
#include "netsolveclient.h"
#include "grpc.h"
Include dependency graph for fortranclient.c:

Go to the source code of this file.

Functions

void fnetsl (char *nickname,...)
void fnetslerr (int *info)
void fnetslmajor (char *maj)
void fnetslnb (char *nickname,...)
void fnetslpr (int *request_id, int *info)
void fnetslwt (int *request_id, int *info)

Detailed Description

This file contains the Fortran client calls to netsolve

Definition in file fortranclient.c.


Function Documentation

void fnetsl ( char *  nickname,
  ... 
)

This function is used to make NetSolve calls from a Fortran client in a blocking fashion.

Parameters:
nickname -- Specifies the name of the problem that needs to be solved This should have the form "problemname()". Remember the parens.
... -- Variable length arguments to accommodate variable arguments required by the problem

Definition at line 29 of file fortranclient.c.

{
  va_list argptr;
  char *buf;
  int *return_value, len;

  grpc_set_default_major("COL");

  /* Getting the problem's nickname */
  va_start(argptr, nickname);

#ifdef F2CSTRCRAYSTYLE
  va_arg(argptr, int);
#endif

  /* Get the address of the return value */
  return_value = (int *) va_arg(argptr, int *);

  /* The trailing "()" in the problem name signifies the end of the
   * string.  Strip this off since it isn't used by the GridRPC client.
   */
  buf = nickname;
  while((*buf != '(') && (*buf != '\0'))
    buf++;

  len = (int) (buf - nickname + 2);

  buf = (char *) malloc(len + 1);

  if(!buf) {
    *return_value = NetSolveSystemError;
    return;
  }

  memcpy(buf, nickname, len);
  buf[len] = '\0';

  *return_value = netslX(buf, argptr, GS_CALL_FROM_FORTRAN,
                         NS_BLOCK, NS_NOASSIGNMENT);

  free(buf);

  return;
}

Here is the call graph for this function:

void fnetslerr ( int *  info  ) 

This function is used to print the error message associated with a NetSolve return value. prints to stderr.

Parameters:
info -- Specifies the return value of a previous call to netsolve

Definition at line 82 of file fortranclient.c.

{
  fprintf(stderr, "%s\n", netsolveErrorMessage(*info));
}

Here is the call graph for this function:

void fnetslmajor ( char *  maj  ) 

This routine sets the major (row- or column-wise) used by the client.

Parameters:
maj -- Takes as input "[Rr]*" or "[Cc]*"

Definition at line 95 of file fortranclient.c.

{
  netslmajor(maj);
}

Here is the call graph for this function:

void fnetslnb ( char *  nickname,
  ... 
)

This function is used to make NetSolve calls from a Fortran client in a non-blocking fashion. This function will return as soon as the arguments have been sent to the server.

Parameters:
nickname -- Specifies the name of the problem that needs to be solved This should have the form "problemname()". Remember the parens.
... -- Variable length arguments to accomodate variable arguments required by the problem

Definition at line 112 of file fortranclient.c.

{
  va_list argptr;
  char *buf;
  int *return_value, len;

  grpc_set_default_major("COL");

  /* Getting the problem's nickname */
  va_start(argptr, nickname);

#if defined(F2CSTRCRAYSTYLE)
  va_arg(argptr, int);
#endif

  /* Get the address of the return value */
  return_value = (int *) va_arg(argptr, int *);

  buf = nickname;
  while((*buf != '(') && (*buf != '\0'))
    buf++;

  len = (int) (buf - nickname + 2);

  buf = (char *) malloc(len + 1);

  if(!buf) {
    *return_value = NetSolveSystemError;
    return;
  }

  memcpy(buf, nickname, len);
  buf[len] = '\0';

  *return_value = netslX(buf, argptr, GS_CALL_FROM_FORTRAN,
                         NS_NOBLOCK, NS_NOASSIGNMENT);

  free(buf);

  return;
}

Here is the call graph for this function:

void fnetslpr ( int *  request_id,
int *  info 
)

This function is used to in conjuction with the non-blocking call to check whether a previously submitted asynchronous request has completed. It does not block, but returns a value signifying whether the call has completed or not.

Parameters:
request_id -- Specifies the id of the previous non-blocking request
*info -- Stores the return value, which will be NetSolveOK on success. On failure it will contain the status specifying the error that occured.

Definition at line 167 of file fortranclient.c.

{
  if(!info || !request_id) return;

  *info = netslpr(*request_id);
  return;
}

Here is the call graph for this function:

void fnetslwt ( int *  request_id,
int *  info 
)

This function is used to in conjuction with the non-blocking call to wait for a previously submitted asynchronous request to complete. It blocks until the request has finished.

Parameters:
request_id -- Specifies the id of the previous non-blocking request
*info -- Stores the return value, which will be NetSolveOK on success. On failure it will contain the status specifying the error that occured.

Definition at line 188 of file fortranclient.c.

{
  if(!info || !request_id) return;

  *info = netslwt(*request_id);
  return;
}

Here is the call graph for this function: