#include <stdarg.h>#include "netsolveclient.h"#include "grpc.h"
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) |
This file contains the Fortran client calls to netsolve
Definition in file fortranclient.c.
| void fnetsl | ( | char * | nickname, | |
| ... | ||||
| ) |
This function is used to make NetSolve calls from a Fortran client in a blocking fashion.
| 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;
}

| void fnetslerr | ( | int * | info | ) |
This function is used to print the error message associated with a NetSolve return value. prints to stderr.
| 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));
}

| void fnetslmajor | ( | char * | maj | ) |
This routine sets the major (row- or column-wise) used by the client.
| maj | -- Takes as input "[Rr]*" or "[Cc]*" |
Definition at line 95 of file fortranclient.c.
{
netslmajor(maj);
}

| 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.
| 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;
}

| 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.
| 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;
}

| 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.
| 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;
}

1.6.3-20100507