⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 asa-notes

📁 simulated annealing code ASA
💻
📖 第 1 页 / 共 4 页
字号:
extreme quenching).  This is greater than the factor of 30 that was
reported to me by Michael de la Maza for Dynamic Hill Climbing (DHC).
This is a simple change of one number in the code, turning it into a
variant of SQ, and is not equivalent to "tuning" any of the other many
ASA options, e.g., like SELF_OPTIMIZE, USER_COST_SCHEDULE, etc.  Note
that SQ will not suffice for all systems; several users of ASA reported
that Quenching did not find the global optimal point that was otherwise
be found using the "correct" ASA algorithm.\*U

========================================================================
	@@FORTRAN Issues

20 Oct 06

Two very useful URLs for combining C/C++ and Fortran are:
http://yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html
http://arnholm.org/software/cppf77/cppf77.htm

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 Jul 00

I've included my old 1987 RATFOR VFSR code in asa_contrib.txt.
This code is unsupported.

20 May 93

Some users have requested a FORTRAN version of ASA.  I wrote early
versions of VFSR in RATFOR and used ratfor to translate to FORTRAN,
but picked C for my own convenience for these later versions.

There are at least three reasonable options for people using FORTRAN:

(1) If the FORTRAN code you use is relatively small compared to
the ASA code, you might try f2c to change your FORTRAN source
into C.  This code can be gotten from Netlib, by logging into
netlib@research.att.com as netlib and then cd f2c.

(2) You can use CFORTRAN, available via anonymous ftp from
zebra.desy.de to interface your FORTRAN and C source and/or binary
codes.  It seems the easiest way to use this would be to call a FORTRAN
cost function from within the ASA C cost_function().

(3) You can see if your compiler will accept a rather simple approach
to calling your FORTRAN fcost() from the ASA C cost_function(), just
passing only those variables to fcost() necessary for your
calculation.  The procedure below worked on a Sun SPARC-2/4.1.3 using
gcc and Sun's f77.

(a) In the asa_usr.c file, at the location described in the ASA-README, or in
your asa_usr_cst.c file if you are using COST_FILE set to TRUE, insert your
own cost function:
_______________________________________________________________________
{
#if HAVE_ANSI
  extern void fcost_ (double *q, double *x);    /* note "_" on fcost_ */
#else
  extern void fcost_ ();
#endif
  double q;                     /* returned by fcost_() */
  fcost_ (&q, x);
  *cost_flag = TRUE;            /* or, add some feedback from fcost_() */
  return (q);
}
________________________________________________________________________
The requirement to use an "_" on the C-function call is machine
dependent.

(b) Create a file, e.g., cost.f, containing your FORTRAN cost
function, e.g., if the *parameter_dimension is 4, then:
________________________________________________________________________
      subroutine fcost (q_n, x)
      double precision q_n, x(4)
      ...
      q_n = ...
      end
________________________________________________________________________
Note that element x[0] in C is mapped to x(1) in FORTRAN.

(c) In the Makefile add to the "compile: " (tabbed) commands:
________________________________________________________________________
compile: $(USEROBJS) $(ASAOBJS)
        f77 -c cost.f -lm
        @$(CC) $(LDFLAGS) -o asa_run $(USEROBJS) $(ASAOBJS) cost.o -lm
________________________________________________________________________
Some compilers may require the addition of additional libraries and
options, e.g., -f77 on the CC line.  In general, it seems that the
proper compiler to link all the object files, e.g., cc or f77, should
correspond to the language of main().  If your main() is in FORTRAN,
then use ASA_LIB set to TRUE to use asa_main() in the ASA modules.

========================================================================
	@@Specific Machines/Architectures

5 Aug 97

Under Watcom version 11 exception fault errors are reported.  When
CHECK_EXPONENT is set to TRUE, these do not appear; apparently, there
are problems with handling too large and/or too small exponentials.
See the ASA-README for a discussion on the use of this Pre-Compile
OPTIONS.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 Aug 93

On a PC, under MicroSoft Visual C++ 2.0, asa_opt likely should be
placed with the *.c source code, _not_ the executables if they are in a
different directory.

On a Mac, under Code Warrior 6.0, asa_opt likely should be placed with
the executables, _not_  the *.c source code if they are in a different
directory.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Intel Paragon

17 Dec 93
On an Intel Paragon Supercomputer, Graham Campbell
<campbell@ams.sunysb.edu> reported that the ASA test problem runs
without error or warning using gcc-2.4.5 as gcc -g -Wall.  However,
when using cc -O or gcc -g -O, compilation fails.

22 Mar 95
On an Intel Paragon Supercomputer, Shinichi Sakata
<ssakata@weber.ucsd.edu> reported that ASA crashed using the native cc
compiler when entering reanneal(), at the same location as reported by
Graham Campbell.

The location of the problem seems to be within the compiled pow()
function.  I put together an s_pow() function by modifying some public
domain source code from Sun available in the fdlibm directory in
NETLIB.  s_pow() is used instead of pow() when FDLIBM_POW is set to
TRUE.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 Mar 93

A problem in compilation,
} Though I compiled successfully
}
} on an old SUN 4/260 and a new IBM risc 6000 using both ansi c and
}
} old version c, troubles comes in when I try it on a newly obtained
}
} HWSs310 sparc workstation (claimed to be equivalent to sparc 10).
}
} When using cc compiler, both asa_usr.c and asa.c have been compiled,
}
} and it gave error message:
}
} undefined symbol  -dlopen
}                   _dlclose
}                   _dlsym
}
was solved by Walter Roberson <roberson@hamer.ibd.nrc.ca> by linking
with -ldl.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
15 Jan 93

Davyd Norris <daffy@sci.monash.edu.au> reports that compilation
was successful on a Pyramid:
"On Pyramid OSx the -Xa compiler option had to be added so that the
compiler knows to expect ANSI code.  Also on our system there is no
stdlib.h include file."

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
PC Code For Time Modules

4 May 94

From selveria@salem.sylvania.com Wed May  4 11:19:58 1994
From: "Selverian, John" <selveria@salem.sylvania.com>
To: "Ingber, Lester" <ingber@alumni.caltech.edu>
Subject: time calculation
Date: Wed, 04 May 94 14:19:00 PDT

Lester,

I move my code (along with ASA) back and forth between a PC & a UNIX
machine.  The time commands work fine on the UNIX machine but not on
the PC.  I currently use the ansi <time.h> header file and the
following command to get the time

#include <time.h>
...
main()
{
      double  start_time,end_time,elapsed_time;
      time_t    tloc;
...
      start_time = (double)time(&tloc);     /* define starting time */
      asa_main(....);                       /* call ASA */
      end_time = (double)time(&tloc);       /* define ending time */
      elapsed_time = end_time - start_time; /* define time spend in ASA */
...
}

This works on both machines & I would guess with all ansi-C compliers.

JS

_________________________________________________________________________
14 Apr 94
Note that there now is only one set of time routines in asa.c, and that
now both asa.c and asa_usr.c pass two arguments to print_time(char
*message, FILE * ptr_asa_out).

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 Aug 93

For Turbo C, Davyd.Norris@physics.monash.edu.au suggests adding another
include file, tcdefs.h, after
#include <stdlib.h>
in asa.h and in asa_usr.h.
/***** tcdefs.h */
/* Custom defines for Turbo C 2.0 and above */
#include <float.h>
#define MAX_DOUBLE    DBL_MAX
#define MIN_DOUBLE    DBL_MIN
#define EPS_DOUBLE    DBL_EPSILON
}
/*****/

He also suggests:
} When compiling for Turbo/MS C, you need to set INT_ALLOC=TRUE and
} INT_LONG=TRUE.  Lotsa warnings about unused variables, but no errors
} or warnings that might mean something more serious.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
27 Aug 93

From zg11@midway.uchicago.edu Thu Aug 26 19:50:31 1993
Return-Path: <zg11@midway.uchicago.edu>
Date: Thu, 26 Aug 93 21:53:02 CDT
From: "zening  ge" <zg11@midway.uchicago.edu>
Subject: asa on PC

I have had the version 1.4 asa codes compiled using Turbo C++ 3.0 on my
386SX25 PC. The only thing needs to be changed is to set IO_PROTOTYPE
to FALSE.

It is necessary to turn IO_PROTOTYPES to FALSE to avoid the errors of
type mismatch in redefining "fprintf", "fflush", etc. For your example
problem, it took about 5 minutes to complete the computation on my
386SX25 PC without math-coprocessor.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
31 Aug 93

Return-Path: <selveria@salem.sylvania.com>
From: "Selverian, John" <selveria@salem.sylvania.com>
To: "'Ingber, Lester'" <ingber@alumni.caltech.edu>
Date: Tue, 31 Aug 93 13:58:00 PDT

thanks for the tip.

Setting INT_ALLOC = TRUE and INT_LONG = TRUE solved the problem. Now
the PC and SGI give the same answers.

Just for your info I am running a 486 66Mhz PC with a math co-processor
with MS Quick C for Windows version 1.0.

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
HP Code For Time Modules

4 Nov 93

The changes recommended below for hpux have been implemented using the
TIME_STD DEFINE_OPTION.

========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -